@ehfuse/taskbox 0.5.31 → 0.5.32

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
@@ -1,14 +1,14 @@
1
- var zn="waiting",mr="replied";import{createContext as Im,useContext as _m,useMemo as sl}from"react";import{Box as wm}from"@mui/material";var bi="--app-mobile-font-offset";function po(e,o=0){return`calc(${e}px + max(0px, var(${bi}, 0px) - ${o}px))`}import{jsx as ll}from"react/jsx-runtime";var cl=Im({});function Dm({config:e,children:o}){let t=sl(()=>e??{},[e]),n=t.mobileFontOffsetPx;return ll(cl.Provider,{value:t,children:n===void 0?o:ll(wm,{sx:{display:"contents",[bi]:`${n}px`},children:o})})}function Co(){return _m(cl)}function hi(){let{buildFileUrl:e}=Co();return sl(()=>e||((o,t)=>{let n=[];return t?.thumb&&n.push(`thumb=${t.thumb}`),t?.download&&n.push("download=1"),`/api/v1/files/${o}${n.length?`?${n.join("&")}`:""}`}),[e])}function qn(){let{uploadMaxMb:e}=Co();return e??50}import{useGlobalForm as pp}from"@ehfuse/forma";import ml from"@mui/icons-material/DoNotDisturbAltOutlined";import ul from"@mui/icons-material/BookmarkBorderOutlined";import Om from"@mui/icons-material/LabelOutlined";import Mm from"@mui/icons-material/FlagOutlined";import Em from"@mui/icons-material/StarBorderOutlined";import Pm from"@mui/icons-material/FolderOutlined";import Rm from"@mui/icons-material/EventOutlined";import zm from"@mui/icons-material/BuildOutlined";import qm from"@mui/icons-material/LocalShippingOutlined";import Am from"@mui/icons-material/StorefrontOutlined";import Lm from"@mui/icons-material/GroupsOutlined";import Nm from"@mui/icons-material/LightbulbOutlined";import Fm from"@mui/icons-material/FavoriteBorderOutlined";import Hm from"@mui/icons-material/AssignmentOutlined";import Wm from"@mui/icons-material/HomeOutlined";import $m from"@mui/icons-material/WorkOutline";import Km from"@mui/icons-material/SchoolOutlined";import Um from"@mui/icons-material/LocalHospitalOutlined";import Vm from"@mui/icons-material/RestaurantOutlined";import Gm from"@mui/icons-material/LocalFloristOutlined";import Ym from"@mui/icons-material/DirectionsCarOutlined";import jm from"@mui/icons-material/CampaignOutlined";import Xm from"@mui/icons-material/SavingsOutlined";import Qm from"@mui/icons-material/Inventory2Outlined";import Jm from"@mui/icons-material/CleaningServicesOutlined";import dl from"@mui/icons-material/HandymanOutlined";import Zm from"@mui/icons-material/LocalPhoneOutlined";import eu from"@mui/icons-material/EmailOutlined";import ou from"@mui/icons-material/ShoppingCartOutlined";import tu from"@mui/icons-material/BarChartOutlined";import nu from"@mui/icons-material/PrintOutlined";import ru from"@mui/icons-material/SecurityOutlined";import iu from"@mui/icons-material/AlarmOutlined";import au from"@mui/icons-material/AttachFileOutlined";import lu from"@mui/icons-material/PhotoCameraOutlined";import su from"@mui/icons-material/ImageOutlined";import cu from"@mui/icons-material/MenuBookOutlined";import mu from"@mui/icons-material/EditOutlined";import uu from"@mui/icons-material/KeyOutlined";import du from"@mui/icons-material/LockOutlined";import pu from"@mui/icons-material/LockOpenOutlined";import fu from"@mui/icons-material/SettingsOutlined";import xu from"@mui/icons-material/CloudOutlined";import gu from"@mui/icons-material/WifiOutlined";import bu from"@mui/icons-material/ComputerOutlined";import hu from"@mui/icons-material/SmartphoneOutlined";import ku from"@mui/icons-material/TvOutlined";import Tu from"@mui/icons-material/AccessTimeOutlined";import yu from"@mui/icons-material/TimerOutlined";import Su from"@mui/icons-material/MapOutlined";import Bu from"@mui/icons-material/PlaceOutlined";import Cu from"@mui/icons-material/NavigationOutlined";import vu from"@mui/icons-material/FlightOutlined";import Iu from"@mui/icons-material/TrainOutlined";import _u from"@mui/icons-material/DirectionsBusOutlined";import wu from"@mui/icons-material/DirectionsBikeOutlined";import Du from"@mui/icons-material/DirectionsWalkOutlined";import Ou from"@mui/icons-material/DirectionsRunOutlined";import Mu from"@mui/icons-material/FitnessCenterOutlined";import Eu from"@mui/icons-material/SportsSoccerOutlined";import Pu from"@mui/icons-material/EmojiEventsOutlined";import Ru from"@mui/icons-material/CardGiftcardOutlined";import zu from"@mui/icons-material/CakeOutlined";import pl from"@mui/icons-material/CoffeeOutlined";import qu from"@mui/icons-material/LocalPizzaOutlined";import Au from"@mui/icons-material/ShoppingBagOutlined";import fl from"@mui/icons-material/CreditCardOutlined";import Lu from"@mui/icons-material/AccountBalanceOutlined";import Nu from"@mui/icons-material/AccountBalanceWalletOutlined";import Fu from"@mui/icons-material/AttachMoneyOutlined";import Hu from"@mui/icons-material/ReceiptLongOutlined";import Wu from"@mui/icons-material/CalculateOutlined";import $u from"@mui/icons-material/TrendingUpOutlined";import Ku from"@mui/icons-material/ListAltOutlined";import Uu from"@mui/icons-material/TaskAltOutlined";import Vu from"@mui/icons-material/DoneAllOutlined";import Gu from"@mui/icons-material/WarningAmberOutlined";import Yu from"@mui/icons-material/InfoOutlined";import ju from"@mui/icons-material/HelpOutlined";import Xu from"@mui/icons-material/SupportAgentOutlined";import Qu from"@mui/icons-material/PersonOutlined";import Ju from"@mui/icons-material/PersonAddOutlined";import Zu from"@mui/icons-material/BadgeOutlined";import ed from"@mui/icons-material/WbSunnyOutlined";import od from"@mui/icons-material/DarkModeOutlined";import td from"@mui/icons-material/LocalFireDepartmentOutlined";import nd from"@mui/icons-material/WaterDropOutlined";import rd from"@mui/icons-material/BoltOutlined";import id from"@mui/icons-material/AutorenewOutlined";import ad from"@mui/icons-material/ScienceOutlined";import ld from"@mui/icons-material/MedicalServicesOutlined";import sd from"@mui/icons-material/NotificationsOutlined";import cd from"@mui/icons-material/SendOutlined";import md from"@mui/icons-material/LinkOutlined";import ud from"@mui/icons-material/PublicOutlined";import xl from"@mui/icons-material/ApartmentOutlined";import dd from"@mui/icons-material/PlumbingOutlined";import pd from"@mui/icons-material/ElectricalServicesOutlined";import fd from"@mui/icons-material/ChatOutlined";import xd from"@mui/icons-material/DescriptionOutlined";import gd from"@mui/icons-material/FactCheckOutlined";import bd from"@mui/icons-material/RocketLaunchOutlined";import hd from"@mui/icons-material/PaletteOutlined";import kd from"@mui/icons-material/MusicNoteOutlined";import Td from"@mui/icons-material/VideocamOutlined";import yd from"@mui/icons-material/ThumbUpOutlined";import Sd from"@mui/icons-material/PushPinOutlined";import Bd from"@mui/icons-material/SearchOutlined";import Cd from"@mui/icons-material/VisibilityOutlined";import vd from"@mui/icons-material/VerifiedOutlined";import Id from"@mui/icons-material/TrackChangesOutlined";import _d from"@mui/icons-material/ExtensionOutlined";import wd from"@mui/icons-material/CodeOutlined";import Dd from"@mui/icons-material/BugReportOutlined";import Od from"@mui/icons-material/SmartToyOutlined";import Md from"@mui/icons-material/StorageOutlined";import Ed from"@mui/icons-material/QrCode2Outlined";import Pd from"@mui/icons-material/FileDownloadOutlined";import Rd from"@mui/icons-material/FileUploadOutlined";import zd from"@mui/icons-material/MicOutlined";import qd from"@mui/icons-material/HeadphonesOutlined";import Ad from"@mui/icons-material/MovieOutlined";import Ld from"@mui/icons-material/SportsEsportsOutlined";import Nd from"@mui/icons-material/BrushOutlined";import Fd from"@mui/icons-material/ArchitectureOutlined";import Hd from"@mui/icons-material/EngineeringOutlined";import Wd from"@mui/icons-material/FactoryOutlined";import $d from"@mui/icons-material/AgricultureOutlined";import Kd from"@mui/icons-material/DirectionsBoatOutlined";import Ud from"@mui/icons-material/TwoWheelerOutlined";import Vd from"@mui/icons-material/HandshakeOutlined";import Gd from"@mui/icons-material/GavelOutlined";import Yd from"@mui/icons-material/BalanceOutlined";import jd from"@mui/icons-material/TranslateOutlined";import Xd from"@mui/icons-material/PsychologyOutlined";import Qd from"@mui/icons-material/PetsOutlined";import Jd from"@mui/icons-material/CelebrationOutlined";import Zd from"@mui/icons-material/BeachAccessOutlined";import ep from"@mui/icons-material/AcUnitOutlined";import op from"@mui/icons-material/ForestOutlined";import tp from"@mui/icons-material/LandscapeOutlined";import np from"@mui/icons-material/HotelOutlined";import rp from"@mui/icons-material/LocalLaundryServiceOutlined";import ip from"@mui/icons-material/ChairOutlined";import ap from"@mui/icons-material/LocalBarOutlined";import lp from"@mui/icons-material/LunchDiningOutlined";import sp from"@mui/icons-material/IcecreamOutlined";import cp from"@mui/icons-material/WorkspacePremiumOutlined";import mp from"@mui/icons-material/DiamondOutlined";import up from"@mui/icons-material/VaccinesOutlined";var ki="bookmark",we="label",zo="notifications",An="warning",Ln="#e53e3e",gl="none",Ti=[{key:gl,Icon:ml},{key:"label",Icon:Om},{key:"bookmark",Icon:ul},{key:"flag",Icon:Mm},{key:"star",Icon:Em},{key:"folder",Icon:Pm},{key:"event",Icon:Rm},{key:"build",Icon:zm},{key:"shipping",Icon:qm},{key:"store",Icon:Am},{key:"groups",Icon:Lm},{key:"idea",Icon:Nm},{key:"heart",Icon:Fm},{key:"assignment",Icon:Hm},{key:"home",Icon:Wm},{key:"work",Icon:$m},{key:"school",Icon:Km},{key:"hospital",Icon:Um},{key:"restaurant",Icon:Vm},{key:"flower",Icon:Gm},{key:"car",Icon:Ym},{key:"campaign",Icon:jm},{key:"savings",Icon:Xm},{key:"inventory",Icon:Qm},{key:"cleaning",Icon:Jm},{key:"handyman",Icon:dl},{key:"phone",Icon:Zm},{key:"email",Icon:eu},{key:"cart",Icon:ou},{key:"chart",Icon:tu},{key:"print",Icon:nu},{key:"security",Icon:ru},{key:"alarm",Icon:iu},{key:"attach",Icon:au},{key:"camera",Icon:lu},{key:"image",Icon:su},{key:"book",Icon:cu},{key:"edit",Icon:mu},{key:"key",Icon:uu},{key:"lock",Icon:du},{key:"unlock",Icon:pu},{key:"settings",Icon:fu},{key:"cloud",Icon:xu},{key:"wifi",Icon:gu},{key:"computer",Icon:bu},{key:"smartphone",Icon:hu},{key:"tv",Icon:ku},{key:"clock",Icon:Tu},{key:"timer",Icon:yu},{key:"map",Icon:Su},{key:"place",Icon:Bu},{key:"navigation",Icon:Cu},{key:"flight",Icon:vu},{key:"train",Icon:Iu},{key:"bus",Icon:_u},{key:"bike",Icon:wu},{key:"walk",Icon:Du},{key:"run",Icon:Ou},{key:"fitness",Icon:Mu},{key:"soccer",Icon:Eu},{key:"trophy",Icon:Pu},{key:"gift",Icon:Ru},{key:"cake",Icon:zu},{key:"coffee",Icon:pl},{key:"pizza",Icon:qu},{key:"bag",Icon:Au},{key:"card",Icon:fl},{key:"bank",Icon:Lu},{key:"wallet",Icon:Nu},{key:"money",Icon:Fu},{key:"receipt",Icon:Hu},{key:"calculate",Icon:Wu},{key:"trending",Icon:$u},{key:"listalt",Icon:Ku},{key:"task",Icon:Uu},{key:"doneall",Icon:Vu},{key:"warning",Icon:Gu},{key:"info",Icon:Yu},{key:"help",Icon:ju},{key:"support",Icon:Xu},{key:"person",Icon:Qu},{key:"personadd",Icon:Ju},{key:"badge",Icon:Zu},{key:"sun",Icon:ed},{key:"moon",Icon:od},{key:"fire",Icon:td},{key:"water",Icon:nd},{key:"bolt",Icon:rd},{key:"renew",Icon:id},{key:"science",Icon:ad},{key:"medical",Icon:ld},{key:"notifications",Icon:sd},{key:"send",Icon:cd},{key:"link",Icon:md},{key:"public",Icon:ud},{key:"apartment",Icon:xl},{key:"plumbing",Icon:dd},{key:"electrical",Icon:pd},{key:"chat",Icon:fd},{key:"description",Icon:xd},{key:"factcheck",Icon:gd},{key:"rocket",Icon:bd},{key:"palette",Icon:hd},{key:"music",Icon:kd},{key:"video",Icon:Td},{key:"thumbup",Icon:yd},{key:"pin",Icon:Sd},{key:"search",Icon:Bd},{key:"eye",Icon:Cd},{key:"verified",Icon:vd},{key:"target",Icon:Id},{key:"extension",Icon:_d},{key:"code",Icon:wd},{key:"bug",Icon:Dd},{key:"robot",Icon:Od},{key:"storage",Icon:Md},{key:"qrcode",Icon:Ed},{key:"download",Icon:Pd},{key:"upload",Icon:Rd},{key:"mic",Icon:zd},{key:"headphones",Icon:qd},{key:"movie",Icon:Ad},{key:"game",Icon:Ld},{key:"brush",Icon:Nd},{key:"architecture",Icon:Fd},{key:"engineering",Icon:Hd},{key:"factory",Icon:Wd},{key:"agriculture",Icon:$d},{key:"boat",Icon:Kd},{key:"motorcycle",Icon:Ud},{key:"handshake",Icon:Vd},{key:"gavel",Icon:Gd},{key:"balance",Icon:Yd},{key:"translate",Icon:jd},{key:"psychology",Icon:Xd},{key:"pets",Icon:Qd},{key:"celebration",Icon:Jd},{key:"beach",Icon:Zd},{key:"snow",Icon:ep},{key:"forest",Icon:op},{key:"mountain",Icon:tp},{key:"hotel",Icon:np},{key:"laundry",Icon:rp},{key:"chair",Icon:ip},{key:"bar",Icon:ap},{key:"burger",Icon:lp},{key:"icecream",Icon:sp},{key:"medal",Icon:cp},{key:"diamond",Icon:mp},{key:"vaccine",Icon:up}],dp={cafe:pl,payment:fl,business:xl,construction:dl};function Pe(e){return e===gl?null:Ti.find(o=>o.key===e)?.Icon??dp[String(e??"")]??ul}function ur(e){return Pe(e)??ml}var yi={title:"",icon:we,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,is_open:!1,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",sprint_seq:0,story_points:0,event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:"",reminder:"none",priority:"medium",label_keys:[],note:"",content:"",checklist:[],tab_key:""},Si={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function fp(e){let{formId:o="taskbox-create-form",initialValues:t,onValidate:n,onSubmit:r}=e;return pp({formId:o,initialValues:{...yi,...t},onValidate:n,onSubmit:r})}import{useGlobalFormaState as xp}from"@ehfuse/forma";var bl="taskbox-ui-state";function it(){return xp({stateId:bl,initialValues:Si})}import{useMemo as gp}from"react";import{useTheme as bp}from"@mui/material";function pn(e,o){let t=Math.max(0,Math.min(1,o));if(t<=0)return"transparent";let n=e.trim().replace("#",""),r=n.length===3?n.split("").map(d=>d+d).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=Number.parseInt(r.slice(0,2),16),a=Number.parseInt(r.slice(2,4),16),l=Number.parseInt(r.slice(4,6),16);return`rgba(${i}, ${a}, ${l}, ${t})`}function hl(e,o){let t=Math.max(0,Math.min(1,o)),n=e.trim().replace("#",""),r=n.length===3?n.split("").map(m=>m+m).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=m=>Math.round(m+(255-m)*t),a=i(Number.parseInt(r.slice(0,2),16)),l=i(Number.parseInt(r.slice(2,4),16)),d=i(Number.parseInt(r.slice(4,6),16));return`#${[a,l,d].map(m=>m.toString(16).padStart(2,"0")).join("")}`}function Bi(e,o,t){return t==="dark"?{accent:e,accentContrast:o,accentSoft:"#1d2b45",accentOnSurface:"#b3d1ff",danger:"#f87171",dangerSoft:"#3a1f22",success:"#4ade80",warning:"#fbbf24",textStrong:"#ffffff",textPrimary:"#e2e8f0",textSecondary:"#a3adbb",textMuted:"#77808d",textInverse:"#0f1216",surface:"#161a1f",surfaceSubtle:"#1e232a",surfaceHover:"#272d36",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:o,accentSoft:"#eef4ff",accentOnSurface:e,danger:"#e5484d",dangerSoft:"#fdebec",success:"#16a34a",warning:"#e8a33d",textStrong:"#000000",textPrimary:"#37352f",textSecondary:"#787774",textMuted:"#9a9a97",textInverse:"#ffffff",surface:"#ffffff",surfaceSubtle:"#fafaf9",surfaceHover:"#f4f4f2",border:"#e6e6e3",borderStrong:"#dedddb"}}function hp(e,o){let t=o==="dark";return{bg:t?hl(e.accent,.45):e.accent,color:t?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function kl(e,o){return{...e,...o??{}}}function dr(e,o="light"){let t=o==="dark",n=hp(e,o),r=e.accentOnSurface;return{mode:o,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:r,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:o==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHover,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:o==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:o==="dark"?400:700,minHeight:48,badge:{...n,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...n,borderRadius:4,width:34}},summary:{gaugeTrackColor:o==="dark"?e.borderStrong:"#ececea",gaugeBarColor:r,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:r,overdueColor:e.danger,textColor:e.textStrong},actionButton:{bg:"#2f80ed",color:"#ffffff",hoverBg:"#2470dd",bgImage:"linear-gradient(180deg, #5ba1f5 0%, #2f80ed 100%)",hoverBgImage:"linear-gradient(180deg, #4d95ee 0%, #2470dd 100%)"},tabs:{bg:o==="dark"?e.surfaceSubtle:e.surface,color:o==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:o==="dark"?e.border:e.borderStrong,selectedBg:o==="dark"?e.surfaceHover:e.textStrong,selectedColor:o==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:t?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:t?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:t?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:t?"#232a33":e.surface,borderColor:t?"#333c47":e.border,hoverBg:t?"#2b3441":e.surfaceHover,titleColor:e.textPrimary,subColor:e.textSecondary},timeline:{bg:e.surface,gridColor:e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,todayLineColor:e.accentOnSurface,barColor:e.accentOnSurface,overdueBarColor:e.danger},avatar:{ringColor:o==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:o==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function Ci(e,o){if(!o)return e;let t=o.mode??e.mode,r={...t===e.mode?e.colors:Bi(e.colors.accent,e.colors.accentContrast,t),...o.colors??{}},i=dr(r,t),{groupHeader:a,...l}=o.table??{},{badge:d,...m}=o.board??{},{badge:s,...p}=a??{};return{mode:t,colors:r,table:{...i.table,...l,groupHeader:{...i.table.groupHeader,...p,badge:kl(i.table.groupHeader.badge,s)}},board:{...i.board,...m,badge:kl(i.board.badge,d)},summary:{...i.summary,...o.summary??{}},chip:{...i.chip,...o.chip??{}},actionButton:{...i.actionButton,...o.actionButton??{}},tabs:{...i.tabs,...o.tabs??{}},avatar:{...i.avatar,...o.avatar??{}},calendar:{...i.calendar,...o.calendar??{}},card:{...i.card,...o.card??{}},timeline:{...i.timeline,...o.timeline??{}}}}function kp(e={}){let{mode:o="light",accent:t="#2563eb",accentContrast:n="#ffffff",input:r}=e;return Ci(dr(Bi(t,n,o),o),r)}function se(){let e=bp(),{theme:o}=Co(),t=e.palette.primary.main,n=e.palette.primary.contrastText,r=e.palette.mode==="dark"?"dark":"light";return gp(()=>Ci(dr(Bi(t,n,r),r),o),[t,n,r,o])}import{useCallback as mt,useEffect as Vl,useMemo as Vt,useRef as Yf,useState as ut}from"react";import{Box as Ao,Divider as jf,IconButton as Xf,ListItemIcon as Qf,Menu as Gl,MenuItem as Or}from"@mui/material";import Yl from"@mui/icons-material/Add";import Jf from"@mui/icons-material/ArrowUpward";import Zf from"@mui/icons-material/ArrowDownward";import ex from"@mui/icons-material/KeyboardArrowDown";import ox from"@mui/icons-material/KeyboardArrowRight";import Xi from"@mui/icons-material/Check";import tx from"@mui/icons-material/FilterList";import nx from"@mui/icons-material/InboxOutlined";import{Virtuoso as jl}from"react-virtuoso";import rx from"@ehfuse/overlay-scrollbar";import{DatePicker as ix}from"@ehfuse/mui-datetime-picker";function Tp(e){let o=String(e??"").trim().replace("T"," "),t=o.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(o)}function Le(e,o="YYYY-MM-DD"){let t=typeof e=="string"?Tp(e):e;if(!e||e===""||isNaN(t.getTime()))return"";let n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),a=n.toString().slice(-2);switch(o){case"YYYY-MM-DD":return`${n}-${r}-${i}`;case"YY.MM.DD":return`${a}.${r}.${i}`;case"MM/DD/YYYY":return`${r}/${i}/${n}`;case"DD.MM.YYYY":return`${i}.${r}.${n}`;case"YYYYMMDD":return`${n}${r}${i}`;default:return o.replace(/YYYY/g,n.toString()).replace(/YY/g,a).replace(/MM/g,r).replace(/DD/g,i)}}import{Box as Tl}from"@mui/material";import{jsx as Sp,jsxs as Bp}from"react/jsx-runtime";var yp={high:{label:"\uB192\uC74C",dot:"#e5484d",bgcolor:"#fdebec",color:"#c4554d"},medium:{label:"\uC911\uAC04",dot:"#2f80ed",bgcolor:"#e3eefb",color:"#1d4f91"},low:{label:"\uB0AE\uC74C",dot:"#9a9a97",bgcolor:"#efefed",color:"#57564f"}};function qo({priority:e,small:o=!1,plain:t=!1}){let n=yp[e],r=se(),i=r.mode==="dark",a=t||e==="low";return Bp(Tl,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:a?0:o?.9:1.25,py:a?0:o?.25:.5,borderRadius:.75,fontSize:o?11.5:13,fontWeight:500,bgcolor:a?"transparent":i?pn(n.dot,r.chip.darkBgAlpha):n.bgcolor,color:a?i?r.chip.plainColor:n.color:i?r.chip.darkTextSource==="fg"?n.color:n.dot:n.color,whiteSpace:"nowrap"},children:[Sp(Tl,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:n.dot}}),n.label]})}import{Menu as wp,MenuItem as Dp}from"@mui/material";import Op from"@mui/icons-material/Check";function Go(){return{}}var vi=[{key:"always",name:"\uD56D\uC0C1"},{key:"often",name:"\uC790\uC8FC"},{key:"sometimes",name:"\uAC00\uB054"},{key:"once",name:"1\uD68C"},{key:"unable",name:"\uC7AC\uD604\uBD88\uAC00"}],Ii=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],_i=[{key:"fixed",name:"\uC218\uC815\uC644\uB8CC"},{key:"duplicate",name:"\uC911\uBCF5"},{key:"cannot_reproduce",name:"\uC7AC\uD604\uBD88\uAC00"},{key:"by_design",name:"\uC0AC\uC591\uB300\uB85C"},{key:"wont_fix",name:"\uC548 \uACE0\uCE68"}];function yl(e){return vi.find(o=>o.key===e)?.name??""}function Sl(e){return Ii.find(o=>o.key===e)?.name??""}function pr(e){return _i.find(o=>o.key===e)?.name??""}function wi(e,o=new Date){if(!e.is_event)return!1;let t=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;let n=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(n)){let i=new Date(`${t}T${n}:00`);return!Number.isNaN(i.getTime())&&i.getTime()<=o.getTime()}let r=new Date(`${t}T00:00:00`);return Number.isNaN(r.getTime())?!1:(r.setDate(r.getDate()+1),r.getTime()<=o.getTime())}function fr(e,o=new Date){return e.is_event?wi(e,o):!!e.completed}var Wt=[{key:"not_started",name:"\uC2DC\uC791\uC804",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"},{key:"in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"hold",name:"\uBCF4\uB958",bg:"#fbeee0",fg:"#8a5a2b",dot:"#d9730d"},{key:zn,name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:mr,name:"\uD655\uC778\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"}],Fn=Wt.filter(e=>e.key!==zn&&e.key!==mr);function xr(e){return Wt.find(o=>o.key===e)??Wt[0]}var Di={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function fo(e){if(e.is_notice)return Bl(e.status);if(e.is_bug&&e.completed){let o=pr(e.resolution)||"\uC644\uB8CC";return{...Di,name:o}}return e.completed?Di:e.is_bug?vp(e.status):xr(e.status)}var Cp={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function Hn(e){return wi(e)?Cp:null}var Nn=[{key:"notice_scheduled",name:"\uAC8C\uC2DC\uC608\uC815",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"notice_active",name:"\uAC8C\uC2DC\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"notice_closed",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}];function Bl(e){return Nn.find(o=>o.key===e)??Nn[1]}var Oi="__closed__",$t=[{key:"bug_received",name:"\uC811\uC218",bg:"#fdeaea",fg:"#9b2c2c",dot:"#e53e3e"},{key:"bug_confirmed",name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"bug_in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"bug_hold",name:"\uBCF4\uB958",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}],$C=[...$t.filter(e=>e.key!=="bug_hold"),{key:Oi,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...$t.filter(e=>e.key==="bug_hold")];function vp(e){return $t.find(o=>o.key===e)??$t[0]}function Cl(e){return e.is_notice?Nn:e.is_bug?$t:Fn}function Mi(e){return e.status===zn}var Ip={in_progress:0,[zn]:1,not_started:2,hold:3,[mr]:4};function KC(e){return e.completed?9:Ip[String(e.status??"")]??2}function Dt(e,o){let t=new Map(o.map(r=>[r.key,r])),n=(e.label_keys??[]).map(r=>t.get(r)).filter(r=>!!r);if(e.is_event){let r=Hn({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return r?[r,...n]:n}return e.is_notice?String(e.status??"")==="notice_active"?n:[Bl(e.status),...n]:e.is_bug?[fo({...e,is_notice:!1}),...n]:e.completed?[Di,...n]:[xr(e.status),...n]}function vl(e){return{bg:`${e}1f`,fg:e,dot:e}}function gr(e,o){return e.includes(o)?e.filter(t=>t!==o):[...e,o]}import{Box as br}from"@mui/material";import{jsx as Wn,jsxs as _p}from"react/jsx-runtime";function Me({option:e,small:o=!1}){let t=se(),n=t.mode==="dark",r=e.key==="not_started";return _p(br,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:r?0:o?.9:1.25,py:r?0:o?.25:.5,borderRadius:1.25,fontSize:o?11.5:13,fontWeight:500,bgcolor:r?"transparent":n?pn(e.dot,t.chip.darkBgAlpha):e.bg,color:r?n?t.chip.plainColor:e.fg:n?t.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[Wn(br,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function XC({task:e,statusOptions:o,small:t=!1}){let n=Dt(e,o);return n.length===0?null:Wn(br,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Wn(Me,{option:r,small:t},r.key))})}function Ot({labelKeys:e,labelOptions:o}){let t=new Map(o.map(r=>[r.key,r])),n=e.map(r=>t.get(r)).filter(r=>!!r);return n.length===0?null:Wn(br,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Wn(Me,{option:r,small:!0},r.key))})}import{jsx as Ei,jsxs as Mp}from"react/jsx-runtime";function hr({anchorEl:e,value:o,options:t=Wt,onSelect:n,onClose:r}){let i=Go();return Ei(wp,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,...i,children:t.map(a=>Mp(Dp,{onClick:()=>{n(a.key),r()},sx:{fontSize:14,minWidth:150,gap:1},children:[Ei(Me,{option:a}),o===a.key?Ei(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},a.key))})}function kr(e,o){if(o<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===o)return!0;let t=(e.target_account_seqs??[]).filter(n=>n>0);return t.length===0||t.includes(o)}return Pi(e)?!0:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}function Pi(e){return e.is_notice||!e.is_open||e.completed||e.archived?!1:(e.manager_account_seq??0)===0}function Tr(e,o){return o<=0?!1:Pi(e)}function yr(e,o){return o<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||Pi(e)?!1:(e.receiver_account_seqs??[]).includes(o)||(e.author_account_seq??0)===o}function Il(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function at(e,o){return o<=0?!1:e.is_notice?(e.author_account_seq??0)===o:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}var av=[119,121,141,143];var Ri=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uAE30\uD55C"},{value:"status",label:"\uADF8\uB8F9 : \uC0C1\uD0DC"},{value:"manager",label:"\uADF8\uB8F9 : \uCC45\uC784\uC790"},{value:"tab",label:"\uADF8\uB8F9 : \uD504\uB85C\uC81D\uD2B8"},{value:"none",label:"\uADF8\uB8F9 \uC5C6\uC74C"}];function Ep(e){let o=new Date(`${e}T00:00:00`);return o.setDate(o.getDate()+(6-o.getDay())),Le(o)}var Pp=[{key:"overdue",label:"\uC9C0\uB0A8"},{key:"today",label:"\uC624\uB298"},{key:"this_week",label:"\uC774\uBC88 \uC8FC"},{key:"later",label:"\uC774\uD6C4"},{key:"no_due",label:"\uB9C8\uAC10 \uC5C6\uC74C"}];function Rp(e,o,t){let n=e.due_date.slice(0,10);return n?n<o?"overdue":n===o?"today":n<=t?"this_week":"later":"no_due"}function zi(e,o,t,n=[],r=[],i="",a){let l=e.filter(u=>u.is_notice);if(l.length>0){let u=zi(e.filter(c=>!c.is_notice),o,t,n,r,i,a);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:l},...u]}let d=new Map,m=(u,c)=>{let f=d.get(u);f?f.push(c):d.set(u,[c])},s;if(o==="due"){let u=Ep(t);for(let c of e)m(Rp(c,t,u),c);s=Pp}else if(o==="status"){for(let u of e)m(xr(u.status).key,u);s=Wt.map(u=>({key:u.key,label:u.name}))}else if(o==="tab"){for(let u of e)m(u.tab_key?.trim()||"__none__",u);s=[...n.filter(u=>!u.archived).map(u=>({key:u.key,label:u.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...n.filter(u=>u.archived).map(u=>({key:u.key,label:`${u.label} (\uBCF4\uAD00\uB428)`}))]}else if(a?.enabled){let u=Number(a.myAccountSeq??0),c=i.trim();for(let f of e){if(!(Number(f.manager_account_seq??0)>0||String(f.manager_name??"").trim()!=="")){m("__none__",f);continue}let x=u>0&&Number(f.manager_account_seq??0)===u||!!c&&String(f.manager_name??"").trim()===c;m(x?"__manager__":"__reference__",f)}s=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let x of e)m(String(x.manager_name??"").trim()||"__none__",x);let u=i.trim(),c=[...d.keys()].filter(x=>x!=="__none__").sort((x,h)=>{if(u){if(x===u)return-1;if(h===u)return 1}return x.localeCompare(h)}),f=!!u&&c.includes(u),_=c.filter(x=>x!==u);s=[...f?[{key:u,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},..._.map(x=>({key:x,label:x}))]}let p=[];for(let u of s){let c=d.get(u.key);!c||c.length===0||p.push({key:u.key,label:u.label,tasks:c})}return p}import zp from"@mui/icons-material/NotesOutlined";import qp from"@mui/icons-material/AutorenewOutlined";import Ap from"@mui/icons-material/CalendarTodayOutlined";import Lp from"@mui/icons-material/EventOutlined";import Np from"@mui/icons-material/PersonOutlineOutlined";import wl from"@mui/icons-material/PeopleAltOutlined";import Li from"@mui/icons-material/CheckCircleOutlineOutlined";import Fp from"@mui/icons-material/FlagOutlined";import Hp from"@mui/icons-material/AccessTimeOutlined";import Wp from"@mui/icons-material/StickyNote2Outlined";import $p from"@mui/icons-material/ViewKanbanOutlined";import Kp from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as so}from"react/jsx-runtime";var Up={role_mark:"11px",completed:"44px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"120px",manager_name:"110px",receiver_names:"170px",targets:"170px",priority:"84px",ack:"104px",confirm:"100px",project:"150px",request:"100px",completed_time:"150px",note:"minmax(200px, 1.2fr)"};function Sr(e){return Ni(e).map(o=>Up[o.id]).join(" ")}var Vp={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:so(Hp,{sx:{fontSize:15}}),align:"center",sortable:!0},Gp={id:"ticket_no",label:"\uD2F0\uCF13",icon:so(Kp,{sx:{fontSize:15}}),align:"center"},Yp={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:so($p,{sx:{fontSize:15}}),projectFilter:!0},jp={id:"targets",label:"\uB300\uC0C1\uC790",icon:so(wl,{sx:{fontSize:15}})},_l={id:"priority",label:"\uC911\uC694\uB3C4",icon:so(Fp,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},Xp={id:"ack",label:"\uD655\uC778",icon:so(Li,{sx:{fontSize:15}}),align:"center",ackFilter:!0},Qp={id:"confirm",label:"\uD655\uC778",icon:so(Li,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function qi(e){let o=e.findIndex(n=>n.id==="receiver_names"||n.id==="targets"),t=o>=0?o+1:e.findIndex(n=>n.id==="note");return t<0?[...e,_l]:[...e.slice(0,t),_l,...e.slice(t)]}function Ni(e){let{showProject:o=!1,showManager:t=!0,showActions:n=!0,showRequest:r=!0,notice:i=!1,bug:a=!1,confirmMode:l="none"}=e??{},d=p=>{if(!a)return p;let u=p.filter(_=>_.id!=="note"),c=u.findIndex(_=>_.id==="completed"),f=c>=0?c+1:0;return[...u.slice(0,f),Gp,...u.slice(f)]};if(i)return d(qi(Ai.filter(p=>!["manager_name","receiver_names","request"].includes(p.id)).flatMap(p=>p.id==="due_date"?[p,jp]:p.id==="note"?[Xp,p]:[p])));let m=t?Ai:Ai.filter(p=>p.id!=="manager_name");if(n)r||(m=m.filter(p=>p.id!=="request"));else{m=m.filter(u=>u.id!=="request");let p=m.findIndex(u=>u.id==="note");m=[...m.slice(0,p),Vp,...m.slice(p)]}if(l==="action"){let p=m.findIndex(u=>u.id==="note");m=[...m.slice(0,p),Qp,...m.slice(p)]}if(!o)return d(qi(m));let s=m.findIndex(p=>p.id==="receiver_names");return d(qi([...m.slice(0,s+1),Yp,...m.slice(s+1)]))}var Ai=[{id:"role_mark",label:"",icon:null},{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:so(zp,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:so(qp,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC790",icon:so(Ap,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uAE30\uD55C",icon:so(Lp,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:so(Np,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:so(wl,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:so(Li,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:so(Wp,{sx:{fontSize:15}})}];import{Button as Dl,ClickAwayListener as ef,Dialog as of,Paper as tf,Popper as nf,Typography as rf,Box as af}from"@mui/material";import{useMediaQuery as Jp,useTheme as Zp}from"@mui/material";function $e(){let{isMobile:e}=Co(),o=Zp(),t=Jp(o.breakpoints.up("lg"));return e!==void 0?e:!t}import{Fragment as sf,jsx as Mt,jsxs as Ol}from"react/jsx-runtime";function lf({title:e,content:o,confirmText:t,cancelText:n,titleFontSize:r,actionFontSize:i,actionMinHeight:a,onCancel:l,onConfirm:d}){return Ol(sf,{children:[Mt(rf,{component:"div",sx:{fontSize:r,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),o,Ol(af,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[Mt(Dl,{size:"medium",variant:"outlined",color:"inherit",onClick:l,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:n}),Mt(Dl,{size:"medium",variant:"contained",color:"primary",onClick:d,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:t})]})]})}function Ge({open:e,anchorEl:o,title:t="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:n,confirmText:r="\uD655\uC778",cancelText:i="\uCDE8\uC18C",placement:a="top",minWidth:l=160,minHeight:d,titleFontSize:m=17,actionFontSize:s=16,actionMinHeight:p=44,zIndex:u=1300,onCancel:c,onConfirm:f}){let _=$e(),x=Mt(lf,{title:t,content:n,confirmText:r,cancelText:i,titleFontSize:m,actionFontSize:s,actionMinHeight:p,onCancel:c,onConfirm:f});return _?Mt(of,{open:e,onClose:c,sx:{zIndex:u},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:x}):Mt(nf,{open:e,anchorEl:o,placement:a,sx:{zIndex:u},children:Mt(ef,{onClickAway:c,children:Mt(tf,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:l,minHeight:d,justifyContent:d?"space-between":"flex-start"},onClick:h=>h.stopPropagation(),onMouseDown:h=>h.stopPropagation(),children:x})})})}import{useEffect as Tf,useRef as yf,useState as Ll}from"react";import{Box as be,Button as Sf,Checkbox as Bf,Tooltip as Wi}from"@mui/material";import Cf from"@mui/icons-material/AlarmOutlined";import vf from"@mui/icons-material/CheckCircle";import If from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as cf,useState as Ml}from"react";import{Avatar as El}from"@mui/material";import mf from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Hi}from"react/jsx-runtime";var Fi=new Set,Pl=e=>e.startsWith("data:")||e.startsWith("blob:");function lt({src:e,avatarSx:o,iconFontSize:t=40}){let[n,r]=Ml(()=>e?Pl(e)||Fi.has(e):!1),[i,a]=Ml(!1),l={position:"relative",overflow:"hidden",borderRadius:"15px"},d=o?[l,...Array.isArray(o)?o:[o]]:l;return cf(()=>{a(!1),r(e?Pl(e)||Fi.has(e):!1)},[e]),!e||i?Hi(El,{sx:d,children:Hi(mf,{sx:{fontSize:t}})}):Hi(El,{src:e,imgProps:{onLoad:()=>{Fi.add(e),r(!0)},onError:()=>a(!0),style:n?void 0:{opacity:0}},sx:d})}var uf=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Br=(e,o)=>{if(!o||!o.trim())return[{text:e,highlight:!1}];try{let t=uf(o.trim()),n=new RegExp(`(${t})`,"gi");return e.split(n).map(i=>i.toLowerCase()===o.trim().toLowerCase()?{text:i,highlight:!0}:{text:i,highlight:!1}).filter(i=>i.text)}catch{return[{text:e,highlight:!1}]}};var df=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Yo(e){let o=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(o))return"";let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?"":`${o.slice(2).replaceAll("-",".")} (${df[t.getDay()]})`}function st(e){let o=String(e??"").trim(),[t,n=""]=o.split(" "),r=Yo(t);return r?n?`${r} ${n.slice(0,5)}`:r:""}import{Box as Rl,Tooltip as pf}from"@mui/material";import{jsx as Cr}from"react/jsx-runtime";var fn=[{bgcolor:"#dbe7ff",color:"#24408e"},{bgcolor:"#ffe4d6",color:"#8a4b21"},{bgcolor:"#dcf2e3",color:"#1f6b3a"},{bgcolor:"#f3e3f7",color:"#6d2f80"},{bgcolor:"#fdf0cf",color:"#8a6d1d"},{bgcolor:"#e0f0f6",color:"#1d5f78"},{bgcolor:"#efe6dc",color:"#6b4a2b"}];function xo({names:e,size:o=22,ringFirst:t=!1,avatarSrcByName:n}){let r=se();return Cr(Rl,{sx:{display:"flex",alignItems:"center"},children:e.map((i,a)=>{let l=t&&a===0;return Cr(pf,{title:l?`\uCC45\uC784\uC790 \xB7 ${i}`:i,arrow:!0,children:Cr(Rl,{sx:{ml:a===0?0:"-7px",zIndex:a,borderRadius:"50%",border:`2px solid ${l?r.avatar.ringColor:r.avatar.separatorColor}`,display:"inline-flex",...r.avatar.sx},children:Cr(lt,{src:n?.get(i)??"",avatarSx:{width:o,height:o,fontSize:Math.round(o/2),borderRadius:"50%",...fn[a%fn.length]},iconFontSize:Math.round(o*.6)})})},`${i}-${a}`)})})}import{Box as zl,Button as Al}from"@mui/material";import ff from"@mui/icons-material/CheckCircle";import{Fragment as bf,jsx as $n,jsxs as ql}from"react/jsx-runtime";function xf(e){let o=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:o?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:o?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function gf(e){return{minWidth:0,px:1.25,py:.25,fontSize:13,whiteSpace:"nowrap",color:e.actionButton.color,backgroundColor:e.actionButton.bg,backgroundImage:e.actionButton.bgImage,boxShadow:"none","&:hover":{backgroundColor:e.actionButton.hoverBg,backgroundImage:e.actionButton.hoverBgImage,boxShadow:"none"},...e.actionButton.sx}}function xn({onClick:e,children:o,fullWidth:t=!1,sx:n}){let r=se();return $n(Al,{size:"small",variant:"contained",color:"inherit",fullWidth:t,sx:[gf(r),...Array.isArray(n)?n:n?[n]:[]],onClick:i=>{i.stopPropagation(),e(i)},children:o})}function gn({canConfirm:e,count:o,total:t,myConfirmed:n=!1,onConfirm:r,onShowList:i}){let a=se(),l=xf(a);return e?$n(xn,{onClick:()=>r(),children:"\uD655\uC778"}):ql(Al,{size:"small",variant:"outlined",color:"inherit",sx:l,onClick:d=>{d.stopPropagation(),i(d.currentTarget)},children:[n?$n(ff,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,$n(zl,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:t>0&&o>=t?"\uC644\uB8CC":ql(bf,{children:[o,$n(zl,{component:"span",sx:{mx:.15},children:"/"}),t]})})]})}import{SvgIcon as hf}from"@mui/material";import{jsx as vr,jsxs as kf}from"react/jsx-runtime";function Ir({sx:e,...o}){return kf(hf,{viewBox:"0 0 48 48",...o,sx:{fill:"none",...e},children:[vr("path",{d:"M24,6C13.23,6,4.5,12.93,4.5,21.46c0,5.39,3.5,10.13,8.79,12.89l-1.76,7.06a.46.46,0,0,0,.68.51L21,36.7a24,24,0,0,0,3,.2c10.77,0,19.5-6.91,19.5-15.44S34.77,6,24,6Z",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),vr("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),vr("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),vr("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as Ki,jsx as G,jsxs as bn}from"react/jsx-runtime";function Nl(e){let o=String(e??"").trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function $i(e,o){let t=String(e??"").trim()||"-";return Br(t,o).map((n,r)=>G("span",{className:n.highlight?"font-semibold text-blue-600":void 0,children:n.text},`${n.text}-${r}`))}function _r({names:e,searchText:o,avatarSrcByName:t,emphasize:n=!1}){let r=e.filter(i=>i.trim());if(r.length===0)return null;if(r.length===1){let i=r[0]??"";return bn(Ki,{children:[G(lt,{src:t?.get(i)??"",avatarSx:{width:24,height:24,borderRadius:"50%",...fn[0]},iconFontSize:15}),G(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{fontWeight:500,color:"#2f80ed"}:{}},children:$i(i,o)})]})}return G(xo,{names:r,size:22,avatarSrcByName:t})}function Fl({display:e,summary:o,searchText:t,avatarSrcByName:n}){if(!e||e.kind==="everyone")return G(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:r,individualNames:i}=e;if(r.length===0)return G(_r,{names:i,searchText:t,avatarSrcByName:n});let a=[...r,...i],l=a.join(", ");return a.length>2?G(Wi,{title:l,arrow:!0,children:G(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${a[0]}, ${a[1]} \uC678 ${a.length-2}\uBA85`})}):G(Wi,{title:l,arrow:!0,children:bn(be,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[G(be,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.join(", ")+(i.length>0?",":"")}),i.length>0?G(_r,{names:i,searchText:t,avatarSrcByName:n}):null]})})}function Hl({task:e,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:r=0,todayStr:i,showProject:a=!1,showManager:l=!0,showActions:d=!0,showRequest:m=!0,confirmMode:s="none",bugMode:p=!1,confirmInfo:u,onConfirmTask:c,projectLabel:f="",projectIcon:_="",onProjectClick:x,onRequestToggleCompleted:h,onDateClick:g,onChangeNote:v,onMemberClick:b,onClaimClick:I,onVolunteerClick:O,onStatusClick:P,onOpenDetail:S,onTaskContextMenu:q,hideBottomBorder:B=!1,completeLocked:oe=!1,unread:y=!1,notice:k=!1,noticeReadOnly:H=!1,noteLocked:$=!1,targetSummary:K="",targetDisplay:M,onArchiveTask:ae,ackInfo:ie,onAckConfirm:Oe,onAckListClick:N,onPriorityClick:U}){let[F,V]=Ll(!1),[E,z]=Ll(""),ne=yf(null);Tf(()=>{if(!F)return;let W=X=>{let ze=ne.current;ze&&(X.target instanceof Node&&ze.contains(X.target)||ze.blur())};return document.addEventListener("mousedown",W,!0),document.addEventListener("touchstart",W,!0),()=>{document.removeEventListener("mousedown",W,!0),document.removeEventListener("touchstart",W,!0)}},[F]);let te=[e.manager_account_seq??0,...e.receiver_account_seqs??[]].some(W=>W>0&&W!==(e.author_account_seq??0)),Z=H,ye=r>0&&!e.is_notice&&!e.is_event&&(e.manager_account_seq??0)===r,R=Z||!!e.is_notice,j=se(),ke=!!I&&Tr(e,r),w=!!O&&yr(e,r),le=R&&!Il(e),xe=e.is_notice?G(gn,{canConfirm:!!ie?.canAck,count:ie?.count??0,total:ie?.total??0,myConfirmed:!!ie?.acked,onConfirm:()=>Oe?.(e),onShowList:W=>N?.(e,W)}):null,Je=!e.is_notice&&!!e.due_date&&e.due_date.slice(0,10)<=i?"#e5484d":"#2f80ed";return bn(be,{onContextMenu:W=>q(e,W),sx:{display:"grid",gridTemplateColumns:Sr({showProject:a,showManager:l,showActions:d,showRequest:m,notice:k,confirmMode:s,bug:p}),minHeight:48,fontSize:15,bgcolor:j.table.rowBg,color:j.table.rowColor,borderBottom:B?"none":`1px solid ${j.table.rowBorderColor}`,"&:hover":{bgcolor:j.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${j.table.rowBorderColor}`},"& > .cell:first-of-type":{px:0,borderRight:"none"},"& > .cell:nth-of-type(2)":{pl:1.5,pr:2},"& > .cell:last-child":{borderRight:"none",pr:2}},children:[G(be,{className:"cell",children:ye?G(be,{sx:{width:3,alignSelf:"stretch",my:.5,ml:.5,bgcolor:"#2f80ed",borderRadius:1.5}}):null}),G(be,{className:"cell",sx:{justifyContent:"center"},children:!Z&&!oe?G(Wi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${st(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:G(Bf,{checked:e.completed,icon:G(If,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:G(vf,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:W=>W.stopPropagation(),onChange:(W,X)=>h({anchorEl:W.currentTarget,task:e,nextCompleted:X}),sx:{p:.5}})}):null}),p?G(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:e.ticket_no||"-"}):null,bn(be,{className:"cell",onClick:()=>S(e),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}},children:[(()=>{let W=Pe(e.icon||(e.is_notice?zo:we));if(!W)return null;let X=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return G(W,{sx:{fontSize:18,flexShrink:0,color:X}})})(),G(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:e.completed?400:j.table.rowTitleFontWeight,color:e.completed?j.colors.textMuted:j.table.rowTitleColor,textDecoration:e.completed?"line-through":"none"},children:$i(e.title,n)}),(e.comment_count??e.comments?.length??0)>0?G(Ir,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,G(be,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:G(Ot,{labelKeys:e.label_keys??[],labelOptions:o})}),y?G(be,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,fr(e)&&!e.archived&&!Z&&ae?G(Sf,{size:"small",variant:"outlined",color:"inherit",sx:{ml:"auto",flexShrink:0,minWidth:0,px:1.25,py:.25,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},onClick:W=>{W.stopPropagation(),ae(e)},children:"\uBCF4\uAD00"}):null]}),(()=>{let W=Z||!!e.is_event||!!e.completed;return G(be,{className:"cell",onClick:W?void 0:X=>P(e,X.currentTarget),sx:{py:.5,justifyContent:"center",...W?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:e.is_event?(()=>{let X=Hn(e);return X?G(Me,{option:X}):null})():G(Me,{option:fo(e)})})})(),G(be,{className:"cell",onClick:Z?void 0:W=>g(e,"start_date",W.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...Z?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:Nl(e.start_date)}),G(be,{className:"cell",onClick:Z?void 0:W=>g(e,"due_date",W.currentTarget),sx:{justifyContent:"center",gap:.5,color:Je,fontWeight:500,whiteSpace:"nowrap",...Z?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:e.due_date?bn(Ki,{children:[Nl(e.due_date),G(Cf,{sx:{fontSize:15}})]}):null}),k?G(be,{className:"cell",onClick:Z?void 0:()=>b(e,"targets"),sx:{gap:.75,...Z?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:G(Fl,{display:M,summary:K,searchText:n,avatarSrcByName:t})}):null,!k&&e.is_notice?G(be,{className:"cell",onClick:Z?void 0:()=>b(e,"targets"),sx:{gridColumn:l?"span 2":"auto",gap:.75,...Z?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:G(Fl,{display:M,summary:K,searchText:n,avatarSrcByName:t})}):null,!k&&!e.is_notice&&!e.is_event&&l?G(be,{className:"cell",onClick:le?void 0:()=>b(e,"manager"),sx:{gap:.75,...ke||w?{justifyContent:"center"}:{},...le?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:ke?G(xn,{onClick:W=>I?.(e,W.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):w?G(xn,{onClick:W=>O?.(e,W.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):G(_r,{names:e.manager_name?[e.manager_name]:[],searchText:n,avatarSrcByName:t,emphasize:ye})}):null,!k&&!e.is_notice?G(be,{className:"cell",onClick:R?void 0:()=>b(e,"receivers"),sx:{gridColumn:e.is_event&&l?"span 2":"auto",gap:.75,...R?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:G(_r,{names:e.receiver_names,searchText:n,avatarSrcByName:t})}):null,G(be,{className:"cell",onClick:Z?void 0:W=>U?.(e,W.currentTarget),sx:{py:.5,justifyContent:"center",...Z?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:G(qo,{priority:e.priority,plain:!0})}),a?G(be,{className:"cell",onClick:Z?void 0:W=>x?.(e,W.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...Z?{}:{cursor:"pointer","&:hover":{bgcolor:j.table.cellHoverBg}}},children:f?bn(Ki,{children:[(()=>{let W=Pe(_);return W?G(W,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),G(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f})]}):null}):null,k?G(be,{className:"cell",sx:{justifyContent:"center"},children:xe}):null,!k&&d&&m?G(be,{className:"cell",sx:{justifyContent:"center"},children:e.is_notice?xe:te?G(gn,{canConfirm:!!u?.canConfirm,count:u?.count??0,total:u?.total??0,myConfirmed:!!u?.myTime,onConfirm:()=>c?.(e),onShowList:W=>N?.(e,W)}):null}):null,!k&&s==="action"?G(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:j.table.rowSubColor},children:e.is_notice?xe:u&&u.total>0?G(gn,{canConfirm:!!u.canConfirm,count:u.count,total:u.total,myConfirmed:!!u.myTime,onConfirm:()=>c?.(e),onShowList:W=>N?.(e,W)}):"-"}):null,!k&&!d?G(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:j.table.rowSubColor},children:e.completed_time||"-"}):null,p?null:G(be,{className:"cell",onClick:()=>{!$&&!F&&(z(e.note),V(!0))},sx:{color:"#6f6f6c",cursor:$?"default":"text"},children:F?G(be,{component:"input",ref:ne,autoFocus:!0,spellCheck:!1,value:E,onChange:W=>z(W.target.value),onBlur:()=>{V(!1),E.trim()!==e.note&&v(e.seq,E)},onKeyDown:W=>{W.key==="Enter"&&W.target.blur(),W.key==="Escape"&&(z(e.note),V(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:j.table.rowTitleColor,caretColor:j.table.rowTitleColor,p:0,m:0}}):G(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.note?$i(e.note,n):""})})]})}import{useState as _f}from"react";import{Box as Kn,Button as Wl,ButtonBase as wf,Dialog as Df,Divider as $l,Menu as Of,MenuItem as Mf,Popover as Ef}from"@mui/material";import Pf from"@mui/icons-material/ChevronRight";import Rf from"@mui/icons-material/Check";import zf from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as qf}from"@ehfuse/mui-datetime-picker";import{Fragment as Nf,jsx as wo,jsxs as Kt}from"react/jsx-runtime";var Af=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],Kl=[{value:"day_before",label:"1\uC77C \uC804"},{value:"two_days_before",label:"2\uC77C \uC804"},{value:"three_days_before",label:"3\uC77C \uC804"},{value:"week_before",label:"1\uC8FC\uC77C \uC804"}],Ul=[{value:"none",label:"\uC5C6\uC74C"},...Af,...Kl];function Ui(e){return e?Ul:[{value:"none",label:"\uC5C6\uC74C"},...Kl]}function Vi(e){return e==="same_day"?"\uB2F9\uC77C":Ul.find(o=>o.value===e)?.label??"\uC5C6\uC74C"}function Lf(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function Et({anchorEl:e,open:o,date:t,reminder:n,hideReminder:r=!1,centered:i=!1,onClose:a,onDateChange:l,onReminderChange:d}){let[m,s]=_f(null),p=Go(),u=Kt(Kn,{sx:{width:300,maxWidth:"100%"},children:[wo(Kn,{sx:{height:320},children:wo(qf,{selectedDate:Lf(t),onSelect:c=>{l(Le(c)),a()},onClose:a,showFooter:!1,autoApply:!0})}),r?null:Kt(Nf,{children:[wo($l,{sx:{borderColor:"#e6e6e3"}}),Kt(wf,{onClick:c=>s(c.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Kt(Kn,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[wo(zf,{sx:{fontSize:17,color:"#9a9a97"}}),"\uB9AC\uB9C8\uC778\uB354"]}),Kt(Kn,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[Vi(n),wo(Pf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),wo(Of,{transitionDuration:0,anchorEl:m,open:!!m,onClose:()=>s(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...p,children:Ui(!1).map(c=>Kt(Mf,{selected:c.value===n,onClick:()=>{d(c.value),s(null)},sx:{fontSize:14,minWidth:120,justifyContent:"space-between",gap:1},children:[c.label,c.value===n?wo(Rf,{sx:{fontSize:16,color:"#2f80ed"}}):null]},c.value))})]}),wo($l,{sx:{borderColor:"#e6e6e3"}}),Kt(Kn,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[wo(Wl,{size:"small",onClick:()=>{l(Le(new Date)),a()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),wo(Wl,{size:"small",onClick:a,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return i?wo(Df,{open:o,onClose:a,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:u}):wo(Ef,{transitionDuration:0,open:o,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{borderRadius:2,boxShadow:"0 8px 24px rgba(0,0,0,0.14)"}}},children:u})}import{useEffect as Wf,useState as Yi}from"react";import{Box as Ut,Button as $f,Switch as Kf}from"@mui/material";import{FormDialog as Uf}from"@ehfuse/mui-form-dialog";import{ClearTextField as Vf}from"@ehfuse/mui-form-controls";import{ErrorAlert as Gf}from"@ehfuse/alerts";import{Box as Ff,ButtonBase as Hf}from"@mui/material";import{jsx as Gi}from"react/jsx-runtime";function wr({value:e,onChange:o}){return Gi(Ff,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:Ti.map(({key:t,Icon:n})=>{let r=t===e;return Gi(Hf,{onClick:()=>o(t),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:r?"2px solid #2563eb":"1px solid #dedddb",bgcolor:r?"#eef4ff":"#fff",color:r?"#1e3a8a":"#787774","&:hover":{bgcolor:r?"#eef4ff":"#f4f4f2"}},children:Gi(n,{sx:{fontSize:20}})},t)})})}import{jsx as ct,jsxs as ji}from"react/jsx-runtime";function Dr({open:e,title:o="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:t="",initialIcon:n=ki,confirmText:r="\uCD94\uAC00",initialUseSprints:i=!1,onClose:a,onSubmit:l}){let[d,m]=Yi(""),[s,p]=Yi(ki),[u,c]=Yi(!1);Wf(()=>{e&&(m(t),p(n),c(i))},[e]);let f=()=>{let x=d.trim();if(!x){Gf("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}l(x,s,u),a()};return ct(Uf,{open:e,onClose:a,maxWidth:"xs",title:o,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:ji(Ut,{children:[ct(Vf,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:d,onChange:x=>m(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),f())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),ct(Ut,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),ct(Ut,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:ct(wr,{value:s,onChange:p})}),ji(Ut,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[ji(Ut,{children:[ct(Ut,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),ct(Ut,{sx:{fontSize:12.5,color:"#9a9a97"},children:"\uBAA9\uD45C \uBC30\uC815\uC73C\uB85C \uBC18\uBCF5 \uC8FC\uAE30\uB97C \uAD00\uB9AC\uD569\uB2C8\uB2E4(\uAC1C\uBC1C\uD300\uC6A9)"})]}),ct(Kf,{checked:u,onChange:(x,h)=>c(h)})]})]})}],actions:{showCancelButton:!0,right:ct($f,{variant:"contained",onClick:f,children:r})}})}import{jsx as pe,jsxs as jo}from"react/jsx-runtime";function ax(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function Xl({tasks:e,statusOptions:o,avatarSrcByName:t,searchText:n,todayStr:r,sortBy:i,sortDirection:a,onSort:l,onRequestReply:d,onToggleCompleted:m,onChangeTaskDate:s,onChangeTaskReminder:p,groupBy:u,collapsedGroupKeys:c,customTabs:f,onToggleGroup:_,hideCompleted:x=!1,onAddInGroup:h,canAddInGroup:g,renderGroupSummary:v,renderGroupTitleSummary:b,onChangeTaskProject:I,onAddProject:O,onChangeNote:P,onMemberClick:S,onClaimTask:q,onChangeTaskStatus:B,onOpenDetail:oe,onTaskContextMenu:y,onMemberFilterClick:k,activeMemberFilters:H=[],onStatusFilterClick:$,statusFilterActive:K=!1,onAckFilterClick:M,ackFilterActive:ae=!1,onProjectFilterClick:ie,projectFilterActive:Oe=!1,onPriorityFilterClick:N,priorityFilterActive:U=!1,columns:F,getConfirmInfo:V,onConfirmTask:E,myAccountSeq:z=0,currentUserName:ne="",groupManagerByMyRole:te=!1,allowManagerVolunteer:Z=!0,noticeAdmin:ye=!1,getTargetSummary:R,getTargetDisplay:j,onArchiveTask:ke,isTaskUnread:w,getAckInfo:le,onAckConfirm:xe,onAckListClick:Ne,onChangeTaskPriority:Je,onEndReached:W}){let X=se(),ze=Vt(()=>({showManager:!0,showActions:!0,showRequest:!0,...F}),[F]),Io=ze.showManager??!0,St=ze.showActions??!0,tt=ze.showRequest??!0,Bt=ze.confirmMode??"none",Ct=ze.notice??!1,Ro=ze.bug??!1,vt=u!=="none",nt=Vt(()=>vt?zi(e,u,r,f,o,ne,{enabled:te,myAccountSeq:z}):[],[vt,e,u,r,f,o,ne,te,z]),lo=Vt(()=>x?nt.map(T=>({section:T,visibleTasks:T.tasks.filter(ee=>!ee.completed)})).filter(T=>T.visibleTasks.length>0):nt.map(T=>({section:T,visibleTasks:T.tasks})),[nt,x]),eo=Vt(()=>x?e.filter(T=>!T.completed):e,[e,x]),Vo=Vt(()=>new Set(c),[c]),So=ze.showProject??(!Ct&&u!=="tab"),En=Vt(()=>Ni({...ze,showProject:So}),[ze,So]),Ie=Sr({...ze,showProject:So}),C=Vt(()=>{let T=new Map;for(let ee of f)T.set(ee.key,{label:ee.archived?`${ee.label} (\uBCF4\uAD00\uB428)`:ee.label,icon:ee.icon});return T},[f]),L=Yf(null),[Q,ce]=ut(null),ge=e.length>0;Vl(()=>{if(!ge){ce(null);return}let T=window.requestAnimationFrame(()=>{ce(L.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(T)},[ge]);let[D,uo]=ut(!1);Vl(()=>{if(!Q)return;let T=()=>uo(Q.scrollHeight>Q.clientHeight);T();let ee=new ResizeObserver(T);return ee.observe(Q),Q.firstElementChild&&ee.observe(Q.firstElementChild),()=>ee.disconnect()},[Q]);let[de,Ze]=ut(null),[Ve,oo]=ut(null),[It,_t]=ut(null),[Bo,wt]=ut(null),[fi,el]=ut(!1),[xi,ol]=ut(null),Pn=xi?e.find(T=>T.seq===xi.taskSeq)??null:null,[lr,gi]=ut(null),sr=lr?e.find(T=>T.seq===lr.taskSeq)??null:null,tl=mt((T,ee)=>{gi({anchorEl:ee,taskSeq:T.seq})},[]),nl=mt((T,ee)=>{ol({anchorEl:ee,taskSeq:T.seq})},[]),ym=mt((T,ee)=>{if(!ee)return;l(T,i===T&&a==="asc"?"desc":"asc")},[l,i,a]),rl=mt((T,ee,Se)=>{Ze({anchorEl:Se,taskSeq:T.seq,field:ee,date:T[ee],reminder:T.reminder,completed:T.completed})},[]),il=mt((T,ee)=>{wt({anchorEl:ee,task:T})},[]),Sm=mt(T=>{de&&(s(de.taskSeq,de.field,Le(T)),Ze(null))},[de,s]),Bm=mt(T=>{de&&(s(de.taskSeq,de.field,T),Ze(ee=>ee&&{...ee,date:T}))},[de,s]),Cm=mt(T=>{de&&(p(de.taskSeq,T),Ze(ee=>ee&&{...ee,reminder:T}))},[de,p]),al=mt((T,ee=!1)=>pe(Hl,{hideBottomBorder:ee,task:T,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:z,todayStr:r,showProject:So,showManager:Io,showActions:St,showRequest:tt,confirmMode:Bt,confirmInfo:T.is_notice?void 0:V?.(T),onConfirmTask:E,projectLabel:C.get(T.tab_key??"")?.label??"",projectIcon:C.get(T.tab_key??"")?.icon??"",onProjectClick:il,onRequestReply:d,onRequestToggleCompleted:oo,onDateClick:rl,onChangeNote:P,onMemberClick:S,onClaimClick:q?(Se,_o)=>_t({anchorEl:_o,taskSeq:Se.seq,title:Se.title,kind:"claim"}):void 0,onVolunteerClick:Z?(Se,_o)=>_t({anchorEl:_o,taskSeq:Se.seq,title:Se.title,kind:"volunteer"}):void 0,onStatusClick:nl,onOpenDetail:oe,onTaskContextMenu:y,notice:Ct,bugMode:Ro,noticeReadOnly:!at(T,z),noteLocked:T.is_notice?!kr(T,z):!at(T,z),completeLocked:T.is_event?!0:T.is_notice?(T.author_account_seq??0)!==z:(T.author_account_seq??0)!==z&&(T.manager_account_seq??0)!==z,targetSummary:T.is_notice?R?.(T):void 0,targetDisplay:T.is_notice?j?.(T):void 0,onArchiveTask:ke,unread:w?.(T)??!1,ackInfo:T.is_notice?le?.(T):void 0,onAckConfirm:xe,onAckListClick:Ne,onPriorityClick:tl},T.seq),[n,o,t,r,So,Io,St,tt,Bt,V,E,Ct,Ro,z,ye,R,j,ke,w,le,xe,Ne,tl,C,il,d,rl,P,S,q,nl,oe,y]);return jo(Ao,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${X.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:X.table.bg,color:X.table.rowColor,...X.table.sx},children:[pe(Ao,{sx:{display:"grid",gridTemplateColumns:Ie,borderBottom:`1px solid ${X.table.borderColor}`,flexShrink:0,bgcolor:X.table.headerBg,"& > *":{borderRight:`1px solid ${X.table.rowBorderColor}`},"& > *:first-of-type":{px:0,borderRight:"none"},"& > *:nth-of-type(2)":{pl:1.5,pr:2},"& > *:last-child":{borderRight:"none",pr:2},...X.table.headerSx},children:En.map(T=>{let ee=i===T.id,Se=!!T.memberFilter,_o=Se&&H.includes(T.memberFilter),Rn=Se||!!T.statusFilter||!!T.ackFilter||!!T.projectFilter||!!T.priorityFilter,cr=_o||!!T.statusFilter&&K||!!T.ackFilter&&ae||!!T.projectFilter&&Oe||!!T.priorityFilter&&U;return jo(Ao,{onClick:rt=>{T.memberFilter?k(T.memberFilter,rt.currentTarget):T.statusFilter?$(rt.currentTarget):T.ackFilter?M?.(rt.currentTarget):T.projectFilter?ie?.(rt.currentTarget):T.priorityFilter?N?.(rt.currentTarget):ym(T.id,T.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:T.align==="center"?"center":"flex-start",gap:.5,px:1,py:1,minWidth:0,fontSize:X.table.headerFontSize,color:T.sortable||Rn?X.table.headerActiveColor:X.table.headerColor,whiteSpace:"nowrap",cursor:T.sortable||Rn?"pointer":"default",userSelect:"none",...ee?{color:X.table.headerFilteredColor}:{},...cr?{color:X.table.headerFilteredColor,fontWeight:600}:{}},children:[T.icon,T.label,cr?pe(tx,{sx:{fontSize:14}}):null,ee?a==="asc"?pe(Jf,{sx:{fontSize:13}}):pe(Zf,{sx:{fontSize:13}}):null]},T.id)})}),eo.length===0?pe(Ao,{sx:{py:8,textAlign:"center",color:X.table.emptyColor,fontSize:14},children:Ro?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":Ct?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):pe(Ao,{sx:{flex:1,minHeight:0},children:pe(rx,{ref:L,style:{height:"100%"},thumb:{width:8},children:Q?vt?pe(jl,{customScrollParent:Q,data:lo,computeItemKey:(T,ee)=>ee.section.key,itemContent:(T,ee)=>{let{section:Se,visibleTasks:_o}=ee,Rn=Vo.has(Se.key),cr=T===lo.length-1;return jo(Ao,{children:[jo(Ao,{onClick:()=>_(Se.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:X.table.groupHeader.minHeight,bgcolor:X.table.groupHeader.bg,borderBottom:`1px solid ${X.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:X.table.groupHeader.hoverBg},...X.table.groupHeader.sx},children:[Rn?pe(ox,{sx:{fontSize:20,color:X.colors.textMuted}}):pe(ex,{sx:{fontSize:20,color:X.colors.textMuted}}),pe(Ao,{component:"span",sx:{fontSize:X.table.groupHeader.labelFontSize,fontWeight:X.table.groupHeader.labelFontWeight,color:X.table.groupHeader.labelColor},children:Se.label}),b?pe(Ao,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:b(Se.key,Se.tasks)}):null,h&&(!g||g(Se.key))?pe(Xf,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:rt=>{rt.stopPropagation(),h(Se.key,Se.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:X.colors.textSecondary,"&:hover":{bgcolor:X.colors.surfaceHover,color:X.colors.accentOnSurface}},children:pe(Yl,{sx:{fontSize:21}})}):null,jo(Ao,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[v?v(Se.key,Se.tasks):null,pe(Ao,{component:"span",sx:{flexShrink:0,width:X.table.groupHeader.badge.width,py:X.table.groupHeader.badge.paddingY,borderRadius:`${X.table.groupHeader.badge.borderRadius}px`,bgcolor:X.table.groupHeader.badge.bg,border:X.table.groupHeader.badge.border,color:X.table.groupHeader.badge.color,fontSize:X.table.groupHeader.badge.fontSize,fontWeight:X.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:_o.length})]})]}),Rn?null:_o.map((rt,vm)=>al(rt,cr&&vm===_o.length-1&&D))]})}}):pe(jl,{customScrollParent:Q,data:eo,computeItemKey:(T,ee)=>ee.seq,endReached:W,itemContent:(T,ee)=>al(ee,T===eo.length-1&&D)}):null})}),pe(hr,{anchorEl:xi?.anchorEl??null,value:Pn?.status??"",options:Pn?Cl(Pn):Fn,onSelect:T=>{Pn&&B(Pn.seq,T)},onClose:()=>ol(null)}),pe(Gl,{transitionDuration:0,anchorEl:lr?.anchorEl??null,open:!!lr,onClose:()=>gi(null),children:["high","medium","low"].map(T=>jo(Or,{selected:sr?.priority===T,onClick:()=>{sr&&Je?.(sr.seq,T),gi(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[pe(qo,{priority:T,small:!0}),sr?.priority===T?pe(Xi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},T))}),jo(Gl,{anchorEl:Bo?.anchorEl??null,open:!!Bo,onClose:()=>wt(null),transitionDuration:0,children:[jo(Or,{selected:!Bo?.task.tab_key,onClick:()=>{Bo&&I(Bo.task.seq,""),wt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[pe(nx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",Bo?.task.tab_key?null:pe(Xi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),f.filter(T=>!T.archived).map(T=>{let ee=Pe(T.icon),Se=Bo?.task.tab_key===T.key;return jo(Or,{selected:Se,onClick:()=>{Bo&&I(Bo.task.seq,T.key),wt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ee?pe(ee,{sx:{fontSize:17,color:"#1e3a8a"}}):null,T.label,Se?pe(Xi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},T.key)}),O?[pe(jf,{},"add-project-divider"),jo(Or,{onClick:()=>el(!0),sx:{fontSize:14,color:"#787774"},children:[pe(Qf,{children:pe(Yl,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),O?pe(Dr,{open:fi,onClose:()=>el(!1),onSubmit:(T,ee)=>{let Se=Bo?.task.seq??0;(async()=>{let _o=await O(T,ee);_o&&Se&&I(Se,_o)})(),wt(null)}}):null,pe(ix,{anchorEl:de?.anchorEl??null,open:!!de&&de?.field==="start_date",onClose:()=>Ze(null),selectedDate:ax(de?.date??""),onDateChange:Sm}),pe(Et,{anchorEl:de?.anchorEl??null,open:!!de&&de?.field==="due_date",date:de?.date??"",reminder:de?.reminder??"none",hideReminder:!!de?.completed,onClose:()=>Ze(null),onDateChange:Bm,onReminderChange:Cm}),pe(Ge,{open:!!It,anchorEl:It?.anchorEl??null,title:It?.kind==="claim"?"\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:()=>_t(null),onConfirm:()=>{It&&q?.(It.taskSeq),_t(null)}}),pe(Ge,{open:!!Ve,anchorEl:Ve?.anchorEl??null,title:Ve?.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:Ve?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>oo(null),onConfirm:()=>{Ve&&m(Ve.task,Ve.nextCompleted),oo(null)}})]})}import{useCallback as Xo,useMemo as pt,useRef as Ix,useState as ft}from"react";import{Box as Be,ButtonBase as ms,Divider as es,IconButton as os,Menu as ts,MenuItem as Rt}from"@mui/material";import ea from"@mui/icons-material/Add";import ns from"@mui/icons-material/MoreVert";import rs from"@mui/icons-material/EditOutlined";import is from"@mui/icons-material/ArchiveOutlined";import as from"@mui/icons-material/UnarchiveOutlined";import _x from"@mui/icons-material/NotificationsOutlined";import wx from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as lx}from"@mui/material";import{jsx as Ql}from"react/jsx-runtime";function dt({sx:e,...o}){return Ql(lx,{viewBox:"0 0 24 24",...o,sx:{fill:"none",...e},children:Ql("path",{d:"M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6M14 10V17M10 10V17",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{DndContext as Dx,DragOverlay as Ox,PointerSensor as Mx,pointerWithin as Ex,rectIntersection as Px,useDroppable as Rx,useSensor as zx,useSensors as qx}from"@dnd-kit/core";import{SortableContext as us,arrayMove as ls,horizontalListSortingStrategy as Ax,useSortable as Lx,verticalListSortingStrategy as Nx}from"@dnd-kit/sortable";import{CSS as Fx}from"@dnd-kit/utilities";import oa from"@ehfuse/overlay-scrollbar";import{useState as dx}from"react";import{Box as Pt,ButtonBase as px,Checkbox as fx,Tooltip as xx}from"@mui/material";import gx from"@mui/icons-material/AlarmOutlined";import bx from"@mui/icons-material/TimerOutlined";import{Box as Gt,Button as sx,Popover as cx}from"@mui/material";import mx from"@mui/icons-material/CheckCircle";import{jsx as Yt,jsxs as Mr}from"react/jsx-runtime";function Er({anchorEl:e,open:o,acks:t,total:n,avatarSrcByName:r,onRequestConfirm:i,onClose:a}){let l=$e();return Yt(cx,{open:o&&(l||!!e),anchorEl:e,onClose:a,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...l?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:Mr(Gt,{sx:{minWidth:240,maxWidth:320,py:1},children:[Mr(Gt,{sx:{px:2,pb:.75,fontSize:po(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",t.length,"/",n]}),t.length===0?Yt(Gt,{sx:{px:2,py:1.5,fontSize:po(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(d=>Mr(Gt,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[Yt(xo,{names:[d.name],size:22,avatarSrcByName:r}),Yt(Gt,{component:"span",sx:{fontSize:po(14),color:"#37352f",whiteSpace:"nowrap"},children:d.name}),Yt(Gt,{component:"span",sx:{ml:"auto",fontSize:po(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:st(d.time)}),Yt(mx,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},d.account_seq)),i?Yt(Gt,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:Mr(sx,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{i(),a()},sx:{fontSize:po(13)},children:["\uD655\uC778 \uC694\uCCAD (",n-t.length,"\uBA85 \uBBF8\uD655\uC778)"]})}):null]})})}function ux(e){let o=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(t=>t>0&&t!==o))]}function Jl(e,o){let t=ux(e),n=e.acks??[],r=o>0?n.find(i=>i.account_seq===o):void 0;return{myTime:r?.time??"",canConfirm:o>0&&t.includes(o)&&!r,count:n.filter(i=>t.includes(i.account_seq)).length,total:t.length}}function w1(e){let o=String(e??"").trim();return o?o.slice(5,16).replaceAll("-","."):""}import{Fragment as Tx,jsx as go,jsxs as jt}from"react/jsx-runtime";function hn(e){return{border:`1px solid ${e.borderColor}`,borderRadius:1,p:1,bgcolor:e.bg,display:"flex",flexDirection:"column",gap:.75,boxShadow:"0 1px 2px rgba(0,0,0,0.04)",...e.sx}}function hx(e){let o=e.trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function kx(){let e=new Date,o=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${o}-${t}`}function Xt({task:e,statusOptions:o,showDueDate:t=!1,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,titleFontSize:a=13}){let l=se(),m=!!e.due_date&&e.due_date.slice(0,10)<=kx()?l.colors.danger:l.colors.accentOnSurface,s=Jl(e,0),[p,u]=dx(null),c=Dt(e,o),f=new Set(e.label_keys??[]),_=c.filter(h=>!f.has(h.key)),x=c.filter(h=>f.has(h.key));return jt(Tx,{children:[jt(Pt,{sx:{display:"flex",alignItems:"center",gap:.5},children:[go(fx,{size:"small",checked:e.completed,onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),onChange:(h,g)=>n?.({anchorEl:h.currentTarget,taskSeq:e.seq,nextCompleted:g}),sx:{p:0}}),go(xx,{title:e.title,arrow:!0,enterDelay:300,children:jt(Pt,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:a,fontWeight:l.mode==="dark"||e.completed?400:500,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary,lineHeight:1.35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:e.completed?"line-through":"none"},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})}),(e.comment_count??e.comments?.length??0)>0?go(Ir,{sx:{fontSize:15,flexShrink:0,color:l.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?go(Pt,{sx:{pl:3,mt:-.5,fontSize:12.5,color:l.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,jt(Pt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[jt(Pt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[_.map(h=>go(Me,{option:h,small:!0},h.key)),go(qo,{priority:e.priority,small:!0}),x.map(h=>go(Me,{option:h,small:!0},h.key))]}),t&&String(e.due_date??"").trim()?jt(px,{disabled:!i,onPointerDown:h=>h.stopPropagation(),onClick:h=>{h.stopPropagation(),i?.(e,h.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:m,whiteSpace:"nowrap","&:hover":i?{bgcolor:l.colors.border}:void 0},children:[hx(e.due_date),go(gx,{sx:{fontSize:15}})]}):null]}),t&&e.estimated_time?jt(Pt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:l.colors.textSecondary},children:[go(bx,{sx:{fontSize:14}}),e.estimated_time]}):null,go(xo,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),s.total>0?go(Pt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:go(Pt,{sx:{flexShrink:0,width:64},onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),children:go(gn,{canConfirm:!1,count:s.count,total:s.total,onConfirm:()=>{},onShowList:h=>u(h)})})}):null,go(Er,{anchorEl:p,open:!!p,acks:e.acks??[],total:s.total,onRequestConfirm:r&&s.count<s.total?()=>{r(e),u(null)}:void 0,onClose:()=>u(null)})]})}import{Box as yx}from"@mui/material";import{useSortable as Sx}from"@dnd-kit/sortable";import{CSS as Bx}from"@dnd-kit/utilities";import{jsx as Zl}from"react/jsx-runtime";function Cx(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function Pr({task:e,statusOptions:o,variant:t="card",showDueDate:n=!1,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,onCardClick:l,onCardContextMenu:d,titleFontSize:m}){let s=se(),{attributes:p,listeners:u,setNodeRef:c,transform:f,transition:_,isDragging:x}=Sx({id:String(e.seq)}),h=t==="list";return Zl(yx,{ref:c,...p,...u,onClick:l?()=>l(e):void 0,onContextMenu:d?g=>d(e,g):void 0,sx:{...h?Cx(s.card):hn(s.card),opacity:x?.35:e.completed?.55:1,transform:Bx.Translate.toString(f),transition:_,position:"relative",cursor:"default",touchAction:"none","&:hover":h?{bgcolor:s.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:Zl(Xt,{task:e,statusOptions:o,showDueDate:n,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,titleFontSize:m})})}function vx(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function Do(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let o=vx(e.end_date);return o?`${e.name} (~${o})`:e.name}import{jsx as J,jsxs as Re}from"react/jsx-runtime";var ss=2,Rr="group-",Oo="colmove-",Qi="__default__",Ji=Oi,Zi="__other__",zr="sprint-",cs=`${zr}0`,Hx={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function ds(e){return{flexShrink:0,width:e.width,py:e.paddingY,borderRadius:`${e.borderRadius}px`,bgcolor:e.bg,border:e.border,color:e.color,fontSize:e.fontSize,fontWeight:e.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums",...e.sx}}function Wx({column:e,tasks:o,statusOptions:t,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onAddTask:a,canAdd:l,onOpenMenu:d,onCardClick:m,onCardContextMenu:s,grow:p,summary:u,onOpenSprintMenu:c}){let f=se(),{setNodeRef:_,isOver:x}=Rx({id:`${Rr}${e.key}`}),{attributes:h,listeners:g,setNodeRef:v,transform:b,transition:I,isDragging:O}=Lx({id:`${Oo}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return Re(Be,{ref:P=>{_(P),v(P)},sx:{flex:p?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:P=>P.shadows[1],bgcolor:x?f.colors.accentSoft:f.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:Fx.Translate.toString(b),...I?{transition:`${I}, background-color 0.15s`}:{},opacity:O?.6:1},children:[Re(Be,{...h,...g,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${f.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?J(Be,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let P=Pe(e.icon);return P?J(P,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),J(Be,{component:"span",sx:{fontSize:f.board.columnHeaderFontSize,fontWeight:700,color:f.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),J(Be,{component:"span",sx:{...ds(f.board.badge),ml:"auto"},children:o.length}),e.sprint&&c?J(os,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>c(P.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:J(ns,{sx:{fontSize:18}})}):e.locked?null:J(os,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>d({anchorEl:P.currentTarget,column:e}),sx:{color:"#9a9a97"},children:J(ns,{sx:{fontSize:18}})})]}),u?J(Be,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${f.card.borderColor}`,flexShrink:0},children:u}):null,J(Be,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:J(oa,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Re(Be,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[J(us,{items:o.map(P=>String(P.seq)),strategy:Nx,children:o.map(P=>J(Pr,{task:P,statusOptions:t,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onCardClick:m,onCardContextMenu:s},P.seq))}),o.length===0&&!l?J(Be,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,o.length===0&&l?J(Be,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:Re(ms,{className:"taskbox-board-add",onClick:()=>a(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.card.borderColor}`,bgcolor:f.card.bg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.card.hoverBg}},children:[J(ea,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function ta({tasks:e,statusOptions:o,customTabs:t,mode:n="active",onToggleCompleted:r,onRequestReply:i,onChangeDueDate:a,onChangeReminder:l,onMoveTask:d,columnAxis:m="project",statusColumns:s=[],onMoveTaskStatus:p,sprintColumns:u=[],onMoveTaskSprint:c,onAddGroup:f,onAddTask:_,canAdd:x=!0,onRequestRename:h,onArchiveProject:g,onDeleteProject:v,onReorderProjects:b,onOpenDetail:I,onTaskContextMenu:O,hideCompleted:P=!1,renderColumnSummary:S,onEditSprint:q,onChangeSprintStatus:B,onRemoveSprint:oe}){let y=se(),[k,H]=ft(null),[$,K]=ft(null),[M,ae]=ft(null),[ie,Oe]=ft(null),[N,U]=ft(null),[F,V]=ft(null),[E,z]=ft(null),[ne,te]=ft(null),[Z,ye]=ft(null),R=Ix(!1),j=pt(()=>new Map(e.map(C=>[C.seq,C])),[e]),ke=pt(()=>{let C=e.filter(L=>L.is_notice);return C.sort((L,Q)=>L.completed!==Q.completed?L.completed?1:-1:Q.seq-L.seq),C},[e]),w=pt(()=>t.filter(C=>!C.archived),[t]),le=pt(()=>t.filter(C=>C.archived),[t]),xe=C=>({key:C.key,label:C.label,icon:C.icon,isDefault:!1,isArchived:C.archived}),Ne=pt(()=>new Set(s.map(C=>C.key)),[s]),Je=pt(()=>new Set(u.map(C=>C.seq)),[u]),W=pt(()=>{if(m==="sprint")return[{key:cs,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...u.map(C=>({key:`${zr}${C.seq}`,label:Do(C),icon:"",isDefault:!1,isArchived:!1,dot:Hx[C.status],locked:!0,sprint:C}))];if(m==="status"){let C=s.map(L=>({key:L.key,label:L.name,icon:"",isDefault:!1,isArchived:!1,dot:L.dot,locked:!0}));return C.some(L=>L.key===Ji)?C:[...C,{key:Ji,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return n==="archived"?le.map(xe):[{key:Qi,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...w.map(xe)]},[m,s,u,n,w,le]),X=qx(zx(Mx,{activationConstraint:{distance:5}})),ze=Xo(C=>{let L=String(C.active.id).startsWith(Oo),Q=Ex(C),ce=Q.length>0?Q:Px(C);if(L)return ce.filter(uo=>String(uo.id).startsWith(Oo));let ge=ce.filter(uo=>!String(uo.id).startsWith(Oo)),D=ge.filter(uo=>!String(uo.id).startsWith(Rr));return D.length>0?D:ge},[]),Io=pt(()=>{let C=new Map;for(let L of e){if(L.is_notice)continue;let Q;if(m==="sprint"){let ge=L.sprint_seq??0;Q=Je.has(ge)?`${zr}${ge}`:cs}else Q=m==="status"?L.completed?Ji:Ne.has(String(L.status??""))?String(L.status??""):Zi:L.tab_key?.trim()||Qi;let ce=C.get(Q);ce?ce.push(L):C.set(Q,[L])}for(let L of C.values())L.sort((Q,ce)=>{if(Q.completed!==ce.completed)return Q.completed?1:-1;let ge=(Q.group_sort_no??0)>0,D=(ce.group_sort_no??0)>0;return ge&&D?(Q.group_sort_no??0)-(ce.group_sort_no??0):ge!==D?ge?-1:1:Q.due_date!==ce.due_date?Q.due_date<ce.due_date?-1:1:Q.seq-ce.seq});return C},[e,m,Ne,Je]),St=pt(()=>m!=="status"||(Io.get(Zi)??[]).length===0?W:[...W,{key:Zi,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[m,W,Io]),tt=Xo(C=>E?(E.get(C)??[]).map(L=>j.get(L)).filter(L=>!!L):Io.get(C)??[],[E,j,Io]),Bt=Xo(C=>{let L=tt(C);return P?L.filter(Q=>!Q.completed):L},[tt,P]),Ct=Xo(C=>{let L=String(C.active.id);if(L.startsWith(Oo)){ye(L.slice(Oo.length));return}te(Number(L)),z(new Map(W.map(Q=>[Q.key,(Io.get(Q.key)??[]).map(ce=>ce.seq)])))},[W,Io]),Ro=Xo((C,L)=>{if(C.startsWith(Rr))return{key:C.slice(Rr.length),overSeq:null};let Q=Number(C);for(let[ce,ge]of L)if(ge.includes(Q))return{key:ce,overSeq:Q};return null},[]),vt=Xo(C=>{let{active:L,over:Q}=C;!Q||String(L.id).startsWith(Oo)||z(ce=>{if(!ce)return ce;let ge=Number(L.id),D=Ro(String(Q.id),ce);if(!D)return ce;let uo=[...ce.entries()].find(([,oo])=>oo.includes(ge))?.[0];if(!uo||uo===D.key)return ce;let de=new Map(ce);de.set(uo,(de.get(uo)??[]).filter(oo=>oo!==ge));let Ze=[...de.get(D.key)??[]],Ve=Ze.length;if(D.overSeq!==null){let oo=Ze.indexOf(D.overSeq);oo!==-1&&(Ve=oo)}return Ze.splice(Ve,0,ge),de.set(D.key,Ze),de})},[Ro]),nt=Xo(C=>{let L=String(C.active.id);if(L.startsWith(Oo)){ye(null);let Ve=String(C.over?.id??"");if(!Ve.startsWith(Oo))return;let oo=L.slice(Oo.length),It=Ve.slice(Oo.length);if(oo===It)return;let _t=t.map(fi=>fi.key),Bo=_t.indexOf(oo),wt=_t.indexOf(It);if(Bo===-1||wt===-1)return;b(ls(_t,Bo,wt));return}let Q=E;if(z(null),te(null),R.current=!0,!Q||!C.over)return;let ce=Number(L),ge=[...Q.entries()].find(([,Ve])=>Ve.includes(ce));if(!ge)return;let[D,uo]=ge,de=[...uo],Ze=Ro(String(C.over.id),Q);if(Ze&&Ze.key===D&&Ze.overSeq!==null&&Ze.overSeq!==ce){let Ve=de.indexOf(ce),oo=de.indexOf(Ze.overSeq);Ve!==-1&&oo!==-1&&(de=ls(de,Ve,oo))}if(m==="status"){p?.(ce,D);return}if(m==="sprint"){c?.(ce,Number(D.slice(zr.length))||0);return}d(ce,D===Qi?"":D,de)},[t,E,Ro,d,b,m,p,c]),lo=Xo(()=>{z(null),te(null),ye(null),R.current=!0},[]),eo=Xo(C=>{if(R.current){R.current=!1;return}I(C)},[I]),Vo=ne!==null?j.get(ne)??null:null,So=Z!==null?W.find(C=>C.key===Z)??null:null,En=Xo((C,L)=>{V({anchorEl:L,taskSeq:C.seq,date:C.due_date,reminder:C.reminder})},[]),Ie=$?.column??null;return Re(Be,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${y.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:ss,bgcolor:y.colors.surfaceSubtle},children:[Re(Dx,{sensors:X,collisionDetection:ze,onDragStart:Ct,onDragOver:vt,onDragEnd:nt,onDragCancel:lo,children:[J(Be,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:n==="archived"&&W.length===0?J(Be,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):J(oa,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:Re(Be,{sx:{display:"flex",alignItems:"flex-start",gap:ss,height:"100%",minWidth:"min-content",pb:.5},children:[n==="active"&&ke.length>0?Re(Be,{sx:{flex:m!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:C=>C.shadows[1],bgcolor:y.card.bg,overflow:"hidden"},children:[Re(Be,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${y.card.borderColor}`,flexShrink:0,minHeight:48},children:[J(_x,{sx:{fontSize:17,color:"#e8763a"}}),J(Be,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:y.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),Re(Be,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",ke.length,")"]})]}),J(Be,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:J(oa,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:J(Be,{sx:{display:"flex",flexDirection:"column"},children:ke.map(C=>Re(Be,{onClick:()=>eo(C),onContextMenu:L=>O(C,L),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${y.card.borderColor}`,bgcolor:y.card.bg,cursor:"pointer","&:hover":{bgcolor:y.card.hoverBg}},children:[J(Xt,{task:C,statusOptions:o,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:H}),(()=>{let L=(C.target_names??[]).filter(ce=>ce.trim());if(L.length===0)return null;let Q=L.length>2?`${L[0]}, ${L[1]} \uC678 ${L.length-2}`:L.join(", ");return Re(Be,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[J(wx,{sx:{fontSize:14,flexShrink:0}}),J(Be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:Q})]})})()]},C.seq))})})})]}):null,J(us,{items:w.map(C=>`${Oo}${C.key}`),strategy:Ax,children:St.map(C=>J(Wx,{column:C,tasks:Bt(C.key),summary:S?.(C.key,tt(C.key)),onOpenSprintMenu:q||B||oe?(L,Q)=>ae({anchorEl:L,sprint:Q}):void 0,statusOptions:o,onRequestArchiveToggle:H,onRequestReply:i,onDueDateClick:En,onAddTask:_,canAdd:x&&m==="project",onOpenMenu:K,onCardClick:eo,onCardContextMenu:O,grow:m!=="project"},C.key))}),n==="active"&&m==="project"?Re(ms,{onClick:f,sx:{flex:"0 0 270px",minWidth:270,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:2,border:"1.5px dashed #cfcfcc",borderRadius:1.5,color:"#787774",fontSize:14,"&:hover":{bgcolor:"#eef2f6",borderColor:"#9a9a97"}},children:[J(ea,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,n==="active"&&St.length===0&&ke.length===0?J(Be,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:m==="project"?"\uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0C8 \uD504\uB85C\uC81D\uD2B8\uB97C \uCD94\uAC00\uD574 \uC5C5\uBB34\uB97C \uC815\uB9AC\uD558\uC138\uC694.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})}),J(Ox,{children:Vo?J(Be,{sx:{...hn,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:J(Xt,{task:Vo,statusOptions:o,showDueDate:!0,titleFontSize:15})}):So?Re(Be,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:y.card.bg,border:`1px solid ${y.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let C=Pe(So.icon);return C?J(C,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),J(Be,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:y.board.columnHeaderColor},children:So.label}),J(Be,{component:"span",sx:ds(y.board.badge),children:(Io.get(So.key)??[]).length})]}):null})]}),Re(ts,{transitionDuration:0,anchorEl:$?.anchorEl??null,open:!!$,onClose:()=>K(null),children:[Ie&&!Ie.isArchived&&x?Re(Rt,{onClick:()=>{Ie&&_(Ie.isDefault?"":Ie.key),K(null)},sx:{fontSize:14,gap:1},children:[J(ea,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,Ie&&!Ie.isDefault&&!Ie.isArchived?Re(Rt,{onClick:()=>{h(Ie.key,Ie.label,Ie.icon),K(null)},sx:{fontSize:14,gap:1},children:[J(rs,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,Ie&&!Ie.isDefault&&!Ie.isArchived?Re(Rt,{onClick:()=>{g(Ie.key,!0),K(null)},sx:{fontSize:14,gap:1},children:[J(is,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,Ie&&Ie.isArchived?Re(Rt,{onClick:()=>{g(Ie.key,!1),K(null)},sx:{fontSize:14,gap:1},children:[J(as,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,Ie&&!Ie.isDefault?J(es,{}):null,Ie&&!Ie.isDefault?Re(Rt,{onClick:()=>{$&&U($),K(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[J(dt,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),Re(ts,{transitionDuration:0,anchorEl:M?.anchorEl??null,open:!!M,onClose:()=>ae(null),children:[q?Re(Rt,{onClick:()=>{M&&q(M.sprint.seq),ae(null)},sx:{fontSize:14,gap:1},children:[J(rs,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,B?Re(Rt,{onClick:()=>{M&&B(M.sprint.seq,M.sprint.status==="closed"?"active":"closed"),ae(null)},sx:{fontSize:14,gap:1},children:[M?.sprint.status==="closed"?J(as,{sx:{fontSize:18,color:"#787774"}}):J(is,{sx:{fontSize:18,color:"#787774"}}),M?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,oe?J(es,{}):null,oe?Re(Rt,{onClick:()=>{M&&Oe(M),ae(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[J(dt,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),J(Ge,{open:!!ie,anchorEl:ie?.anchorEl??null,title:`"${ie?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>Oe(null),onConfirm:()=>{ie&&oe?.(ie.sprint.seq),Oe(null)}}),J(Et,{anchorEl:F?.anchorEl??null,open:!!F,date:F?.date??"",reminder:F?.reminder??"none",onClose:()=>V(null),onDateChange:C=>{F&&(a(F.taskSeq,C),V(L=>L&&{...L,date:C}))},onReminderChange:C=>{F&&(l(F.taskSeq,C),V(L=>L&&{...L,reminder:C}))}}),J(Ge,{open:!!N,anchorEl:N?.anchorEl??null,title:`"${N?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
2
- \uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>U(null),onConfirm:()=>{N&&v(N.column.key),U(null)}}),J(Ge,{open:!!k,anchorEl:k?.anchorEl??null,title:k?.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:k?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>H(null),onConfirm:()=>{k&&r(k.taskSeq,k.nextCompleted),H(null)}})]})}import{useCallback as qt,useMemo as Un,useRef as Yx,useState as Vn}from"react";import{Box as Ye,Button as jx,ButtonBase as fs,IconButton as ps}from"@mui/material";import Xx from"@mui/icons-material/Add";import Qx from"@mui/icons-material/ChevronLeft";import Jx from"@mui/icons-material/ChevronRight";import Zx from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as eg}from"@ehfuse/mui-datetime-picker";import{DndContext as og,DragOverlay as tg,PointerSensor as ng,pointerWithin as rg,rectIntersection as ig,useDroppable as ag,useSensor as lg,useSensors as sg}from"@dnd-kit/core";import{SortableContext as cg,arrayMove as mg,verticalListSortingStrategy as ug}from"@dnd-kit/sortable";import dg from"@ehfuse/overlay-scrollbar";import{useEffect as $x,useState as Kx}from"react";function zt(e){let{loadHolidays:o}=Co(),[t,n]=Kx(()=>new Map),r=e.join(",");return $x(()=>{if(!o||!r){n(new Map);return}let i=!1;return o(r.split(",").map(Number)).then(a=>{if(i)return;let l=new Map;for(let d of a)l.has(d.date)||l.set(d.date,d.name);n(l)}).catch(()=>{}),()=>{i=!0}},[o,r]),t}function Ux(e){let[o,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(o,t-1,n+1)),i=a=>String(a).padStart(2,"0");return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`}function kn(e){let o=new Map;for(let t of e){let n=t.start_date;for(let r=0;r<62&&n<=t.end_date;r+=1){let i=o.get(n);i?i.push(t):o.set(n,[t]),n=Ux(n)}}for(let t of o.values())t.sort((n,r)=>(n.time||"99:99").localeCompare(r.time||"99:99")||n.title.localeCompare(r.title));return o}import{Box as na,Tooltip as Vx}from"@mui/material";import{jsx as ra,jsxs as Gx}from"react/jsx-runtime";function Tn({event:e,small:o=!1}){let t=e.time?`${e.time} ${e.title}`:e.title,n=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",r=i=>{i.stopPropagation();let[a,l,d]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${a}/${l}/${d}`,"_blank")};return ra(Vx,{title:`(${n}) ${t}`,arrow:!0,enterDelay:300,children:Gx(na,{onClick:r,onPointerDown:i=>i.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:o?.6:.8,borderRadius:.75,bgcolor:"#f1f1ef",color:"#37352f",fontSize:15,fontWeight:500,overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,minWidth:0,maxWidth:"100%",cursor:"pointer","&:hover":{bgcolor:"#ececea"}},children:[ra(na,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),ra(na,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t})]})})}import{jsx as Ce,jsxs as xt}from"react/jsx-runtime";var xs=36,pg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],qr="day-";function ia(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function aa(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function fg(e){let o=e[0],t=e[e.length-1];return o.getMonth()===t.getMonth()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4`:o.getFullYear()===t.getFullYear()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getMonth()+1}\uC6D4`:`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getFullYear()}\uB144 ${t.getMonth()+1}\uC6D4`}function xg(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function gg({dayKey:e,isToday:o,dayLabel:t,holidayName:n,tasks:r,googleEvents:i,statusOptions:a,onRequestArchiveToggle:l,onRequestReply:d,onAddSchedule:m,canAdd:s,onCardClick:p,onCardContextMenu:u,summary:c}){let f=se(),{setNodeRef:_}=ag({id:`${qr}${e}`});return xt(Ye,{ref:_,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:o?f.calendar.todayBg:f.calendar.cellBg},children:[xt(Ye,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:xs,bgcolor:o?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:r.length>0?`1px solid ${f.calendar.borderColor}`:"none",flexShrink:0},children:[n?Ce(Ye,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}):null,o?Ce(Ye,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Ce(Ye,{component:"span",sx:{fontSize:13.5,fontWeight:o?700:400,color:n?f.colors.danger:f.mode==="dark"?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:t})]}),c?Ce(Ye,{sx:{px:1,py:1,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0},children:c}):null,Ce(Ye,{sx:{flex:1,minHeight:0,bgcolor:o?f.calendar.todayBg:f.colors.surfaceSubtle},children:Ce(dg,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:xt(Ye,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[i.length>0?Ce(Ye,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:i.map(x=>Ce(Tn,{event:x},x.uid))}):null,Ce(cg,{items:r.map(x=>String(x.seq)),strategy:ug,children:r.map(x=>Ce(Pr,{titleFontSize:15,task:x,statusOptions:a,variant:"list",onRequestArchiveToggle:l,onRequestReply:d,onCardClick:p,onCardContextMenu:u},x.seq))}),Ce(Ye,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...s?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:xt(fs,{className:"taskbox-add-schedule",onClick:()=>m(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[Ce(Xx,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function gs({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,todayStr:r,onToggleCompleted:i,onMoveTask:a,onRequestReply:l,onAddSchedule:d,canAdd:m=!0,onOpenDetail:s,onTaskContextMenu:p,renderColumnSummary:u}){let c=se(),[f,_]=Vn(()=>ia(new Date)),[x,h]=Vn(null),[g,v]=Vn(null),[b,I]=Vn(null),[O,P]=Vn(null),S=Yx(!1),q=Un(()=>Array.from({length:7},(E,z)=>aa(f,z)),[f]),B=Un(()=>new Map(e.map(E=>[E.seq,E])),[e]),oe=Un(()=>[...new Set(q.map(E=>E.getFullYear()))],[q]),y=zt(oe),k=sg(lg(ng,{activationConstraint:{distance:5}})),H=qt(E=>{let z=rg(E),ne=z.length>0?z:ig(E),te=ne.filter(Z=>!String(Z.id).startsWith(qr));return te.length>0?te:ne},[]),$=Un(()=>kn(o),[o]),K=Un(()=>{let E=new Map;for(let z of e){let ne=z.due_date.slice(0,10)||(n?z.start_date.slice(0,10):"");if(!ne)continue;let te=E.get(ne);te?te.push(z):E.set(ne,[z])}for(let z of E.values())z.sort((ne,te)=>{let Z=ne.sort_no>0,ye=te.sort_no>0;if(Z&&ye)return ne.sort_no-te.sort_no;if(Z!==ye)return Z?-1:1;if(ne.completed!==te.completed)return ne.completed?1:-1;let R=Mi(ne),j=Mi(te);return R!==j?R?-1:1:ne.seq-te.seq});return E},[e,n]),M=qt(E=>b?(b.get(E)??[]).map(z=>B.get(z)).filter(z=>!!z):K.get(E)??[],[b,B,K]),ae=qt(E=>{P(Number(E.active.id)),I(new Map(q.map(z=>{let ne=Le(z);return[ne,(K.get(ne)??[]).map(te=>te.seq)]})))},[q,K]),ie=qt((E,z)=>{if(E.startsWith(qr))return{day:E.slice(qr.length),overSeq:null};let ne=Number(E);for(let[te,Z]of z)if(Z.includes(ne))return{day:te,overSeq:ne};return null},[]),Oe=qt(E=>{let{active:z,over:ne}=E;ne&&I(te=>{if(!te)return te;let Z=Number(z.id),ye=ie(String(ne.id),te);if(!ye)return te;let R=[...te.entries()].find(([,le])=>le.includes(Z))?.[0];if(!R||R===ye.day)return te;let j=new Map(te);j.set(R,(j.get(R)??[]).filter(le=>le!==Z));let ke=[...j.get(ye.day)??[]],w=ke.length;if(ye.overSeq!==null){let le=ke.indexOf(ye.overSeq);le!==-1&&(w=le)}return ke.splice(w,0,Z),j.set(ye.day,ke),j})},[ie]),N=qt(E=>{let{active:z,over:ne}=E,te=b;if(I(null),P(null),S.current=!0,!te||!ne)return;let Z=Number(z.id),ye=[...te.entries()].find(([,le])=>le.includes(Z));if(!ye)return;let[R,j]=ye,ke=[...j],w=ie(String(ne.id),te);if(w&&w.day===R&&w.overSeq!==null&&w.overSeq!==Z){let le=ke.indexOf(Z),xe=ke.indexOf(w.overSeq);le!==-1&&xe!==-1&&(ke=mg(ke,le,xe))}a(Z,R,ke)},[b,a,ie]),U=qt(()=>{I(null),P(null),S.current=!0},[]),F=qt(E=>{if(S.current){S.current=!1;return}s(E)},[s]),V=O!==null?B.get(O)??null:null;return xt(Ye,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${c.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[xt(Ye,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0},children:[xt(Ye,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Ce(ps,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>_(aa(f,-7)),children:Ce(Qx,{sx:{fontSize:20,color:c.colors.textSecondary}})}),Ce(jx,{size:"small",color:"inherit",onClick:()=>_(ia(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:c.mode==="dark"?400:500,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),Ce(ps,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>_(aa(f,7)),children:Ce(Jx,{sx:{fontSize:20,color:c.colors.textSecondary}})})]}),xt(fs,{onClick:E=>v(E.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,"&:hover":{bgcolor:c.colors.surfaceHover}},children:[fg(q),Ce(Zx,{sx:{fontSize:18,color:c.colors.textMuted}})]})]}),Ce(Ye,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:q.map(E=>{let z=E.getDay(),ne=y.has(Le(E));return Ce(Ye,{sx:{height:xs,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:z===0||ne?c.colors.danger:z===6?c.colors.accentOnSurface:c.colors.textSecondary},children:pg[z]},Le(E))})}),Ce(Ye,{sx:{flex:1,minHeight:0},children:xt(og,{sensors:k,collisionDetection:H,onDragStart:ae,onDragOver:Oe,onDragEnd:N,onDragCancel:U,children:[Ce(Ye,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:q.map(E=>{let z=Le(E);return Ce(gg,{dayKey:z,isToday:z===r,dayLabel:xg(E),holidayName:y.get(z)??"",summary:u?.(z,M(z)),tasks:M(z),googleEvents:$.get(z)??[],statusOptions:t,onRequestArchiveToggle:h,onRequestReply:l,onAddSchedule:d,canAdd:m,onCardClick:F,onCardContextMenu:p},z)})}),Ce(tg,{children:V?Ce(Ye,{sx:{...hn,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Ce(Xt,{task:V,statusOptions:t})}):null})]})}),Ce(eg,{anchorEl:g,open:!!g,onClose:()=>v(null),selectedDate:f,onDateChange:E=>{_(ia(E)),v(null)}}),Ce(Ge,{open:!!x,anchorEl:x?.anchorEl??null,title:x?.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:x?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>h(null),onConfirm:()=>{x&&i(x.taskSeq,x.nextCompleted),h(null)}})]})}import{useCallback as Gn,useMemo as Qt,useState as Ar}from"react";import{Box as je,Button as bg,ButtonBase as ks,IconButton as bs,Tooltip as hg}from"@mui/material";import kg from"@mui/icons-material/Add";import Tg from"@mui/icons-material/ChevronLeft";import yg from"@mui/icons-material/ChevronRight";import Sg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Bg}from"@ehfuse/mui-datetime-picker";import{DndContext as Cg,DragOverlay as vg,PointerSensor as Ig,pointerWithin as _g,rectIntersection as wg,useDraggable as Dg,useDroppable as Ts,useSensor as Og,useSensors as Mg}from"@dnd-kit/core";import Eg from"@ehfuse/overlay-scrollbar";import{jsx as Ee,jsxs as Lo}from"react/jsx-runtime";var Pg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Lr="mday-",Nr="mchip-",ys=36,Ss=15,Bs={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"};function Rg(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Fr(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function zg(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function hs(e,o){let t=Fr(e);return t.setMonth(t.getMonth()+o),t}function qg({task:e,statusOptions:o,isPreview:t=!1,onOpenDetail:n,onContextMenu:r}){let i=se(),a=i.mode==="dark",{attributes:l,listeners:d,setNodeRef:m,isDragging:s}=Dg({id:String(e.seq),disabled:t}),{setNodeRef:p}=Ts({id:`${Nr}${e.seq}`,disabled:t}),u=Pe(e.icon||we),[c]=Dt(e,o);return Ee(hg,{title:e.title,arrow:!0,enterDelay:400,children:Lo(je,{ref:f=>{m(f),p(f)},...l,...d,onClick:()=>n(e),onContextMenu:f=>r(e,f),sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,flexShrink:0,borderRadius:.75,bgcolor:c?a?pn(c.dot,i.chip.darkBgAlpha):c.bg:a?i.card.bg:i.colors.surfaceHover,color:c?a?i.chip.darkTextSource==="fg"?c.fg:c.dot:c.fg:i.colors.textPrimary,fontSize:Ss,fontWeight:a||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:t?.5:s?.35:e.completed?.6:1,border:t?`1px dashed ${i.colors.accent}`:"1px solid transparent",pointerEvents:t?"none":"auto",cursor:"pointer",touchAction:"none",overflow:"hidden","&:hover":{filter:"brightness(0.96)"}},children:[Ee(je,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:Bs[e.priority]}}),u?Ee(u,{sx:{fontSize:14,flexShrink:0,opacity:.75}}):null,Lo(je,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:a?i.colors.textStrong:i.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})]})})}function Ag({dayKey:e,dayNumber:o,isToday:t,isOtherMonth:n,weekday:r,holidayName:i,tasks:a,googleEvents:l,statusOptions:d,previewSeq:m,onOpenDetail:s,onTaskContextMenu:p,onAddSchedule:u,canAdd:c}){let f=se(),_=f.mode==="dark",{setNodeRef:x,isOver:h}=Ts({id:`${Lr}${e}`}),g=a,v=!!i||r===0;return Lo(je,{ref:x,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:h?f.colors.accentSoft:t?f.calendar.todayBg:n?f.calendar.otherMonthBg:f.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...c?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[Lo(je,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:ys,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:t?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:`1px solid ${f.calendar.borderColor}`},children:[i?Ee(je,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}):null,t?Ee(je,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Ee(je,{component:"span",sx:{fontSize:13.5,fontWeight:t?700:400,color:n?f.colors.textMuted:v?f.colors.danger:r===6?f.colors.accentOnSurface:_?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:o})]}),l.map(b=>Ee(Tn,{event:b,small:!0},b.uid)),g.map(b=>Ee(qg,{task:b,statusOptions:d,isPreview:b.seq===m,onOpenDetail:s,onContextMenu:p},b.seq)),Ee(je,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:Lo(ks,{className:"taskbox-month-add",onClick:()=>u(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[Ee(kg,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function Cs({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,todayStr:r,onMoveTask:i,onAddSchedule:a,canAdd:l=!0,onOpenDetail:d,onTaskContextMenu:m}){let s=se(),p=s.mode==="dark",[u,c]=Ar(()=>Fr(new Date)),[f,_]=Ar(null),[x,h]=Ar(null),[g,v]=Ar(null),b=Qt(()=>{let N=Rg(u);return Array.from({length:42},(U,F)=>zg(N,F))},[u]),I=Qt(()=>new Map(e.map(N=>[N.seq,N])),[e]),O=Qt(()=>kn(o),[o]),P=Qt(()=>[...new Set(b.map(N=>N.getFullYear()))],[b]),S=zt(P),q=Qt(()=>{let N=new Map;for(let U of e){let F=U.due_date.slice(0,10)||(n?U.start_date.slice(0,10):"");if(!F)continue;let V=N.get(F);V?V.push(U):N.set(F,[U])}for(let U of N.values())U.sort((F,V)=>{let E=F.sort_no>0,z=V.sort_no>0;return E&&z?F.sort_no-V.sort_no:E!==z?E?-1:1:F.completed!==V.completed?F.completed?1:-1:F.seq-V.seq});return N},[e,n]),B=Mg(Og(Ig,{activationConstraint:{distance:5}})),oe=Gn(N=>{let U=_g(N),F=U.length>0?U:wg(N),V=F.filter(E=>String(E.id).startsWith(Nr));return V.length>0?V:F.filter(E=>String(E.id).startsWith(Lr))},[]),y=Gn(N=>{h(Number(N.active.id))},[]),k=Gn(N=>{v(N.over?String(N.over.id):null)},[]),H=Qt(()=>{let N=new Map;for(let[U,F]of q)for(let V of F)N.set(V.seq,U);return N},[q]),$=x!==null?I.get(x)?.due_date.slice(0,10)??"":"",K=Qt(()=>{if(x===null||!g)return null;if(g.startsWith(Nr)){let N=Number(g.slice(Nr.length)),U=H.get(N);if(!U)return null;let F=(q.get(U)??[]).filter(E=>E.seq!==x),V=F.findIndex(E=>E.seq===N);return{day:U,index:V===-1?F.length:V}}if(g.startsWith(Lr)){let N=g.slice(Lr.length),U=(q.get(N)??[]).filter(F=>F.seq!==x);return{day:N,index:U.length}}return null},[x,H,g,q]),M=Gn(N=>{let U=q.get(N)??[];if(x===null||!K)return U;let F=I.get(x);if(!F)return U;let V=U.filter(E=>E.seq!==x);return N===K.day?[...V.slice(0,K.index),F,...V.slice(K.index)]:N===$?V:U},[x,$,K,I,q]),ae=Gn(N=>{let U=x,F=K;if(h(null),v(null),U===null||!F)return;let V=(q.get(F.day)??[]).filter(z=>z.seq!==U),E=[...V.slice(0,F.index).map(z=>z.seq),U,...V.slice(F.index).map(z=>z.seq)];i(U,F.day,E)},[x,K,i,q]),ie=x!==null?I.get(x)??null:null,Oe=`${u.getFullYear()}\uB144 ${u.getMonth()+1}\uC6D4`;return Lo(je,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${s.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[Lo(je,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:s.calendar.headerBg,borderBottom:`1px solid ${s.calendar.borderColor}`,flexShrink:0},children:[Lo(je,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Ee(bs,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>c(hs(u,-1)),children:Ee(Tg,{sx:{fontSize:20,color:s.colors.textSecondary}})}),Ee(bg,{size:"small",color:"inherit",onClick:()=>c(Fr(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:s.mode==="dark"?400:500,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary},children:"\uC624\uB298"}),Ee(bs,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>c(hs(u,1)),children:Ee(yg,{sx:{fontSize:20,color:s.colors.textSecondary}})})]}),Lo(ks,{onClick:N=>_(N.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:s.mode==="dark"?400:700,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary,"&:hover":{bgcolor:s.colors.surfaceHover}},children:[Oe,Ee(Sg,{sx:{fontSize:18,color:s.colors.textMuted}})]})]}),Ee(je,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:s.calendar.headerBg,borderBottom:`1px solid ${s.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${s.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Pg.map((N,U)=>Ee(je,{sx:{height:ys,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:U===0?s.colors.danger:U===6?s.colors.accentOnSurface:s.colors.textSecondary},children:N},N))}),Ee(je,{sx:{flex:1,minHeight:0},children:Lo(Cg,{sensors:B,collisionDetection:oe,onDragStart:y,onDragOver:k,onDragEnd:ae,onDragCancel:()=>{h(null),v(null)},children:[Ee(Eg,{style:{height:"100%"},thumb:{width:8},children:Ee(je,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${s.calendar.borderColor}`,borderBottom:`1px solid ${s.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:b.map(N=>{let U=Le(N);return Ee(Ag,{dayKey:U,dayNumber:N.getDate(),isToday:U===r,isOtherMonth:N.getMonth()!==u.getMonth(),weekday:N.getDay(),holidayName:S.get(U)??"",tasks:M(U),googleEvents:O.get(U)??[],statusOptions:t,previewSeq:K?.day===U?x:null,onOpenDetail:d,onTaskContextMenu:m,onAddSchedule:a,canAdd:l},U)})})}),Ee(vg,{children:ie?Lo(je,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:s.calendar.cellBg,border:`1px solid ${s.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:Ss,fontWeight:500,color:s.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[Ee(je,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:Bs[ie.priority]}}),ie.title]}):null})]})}),Ee(Bg,{anchorEl:f,open:!!f,onClose:()=>_(null),selectedDate:u,onDateChange:N=>{c(Fr(N)),_(null)}})]})}import{useEffect as Lg,useMemo as Yn,useRef as Ng,useState as la}from"react";import{Box as De,Button as vs,Dialog as Fg,IconButton as Is}from"@mui/material";import Hg from"@mui/icons-material/ChevronLeft";import Wg from"@mui/icons-material/ChevronRight";import $g from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Kg}from"@ehfuse/mui-datetime-picker";import{jsx as ve,jsxs as bo}from"react/jsx-runtime";var Ug=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Vg={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"};function sa(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function _s(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function ws({task:e,statusOptions:o,onOpenDetail:t,isMine:n=!1,avatarSrcByName:r,onOpenMembers:i}){let a=se(),[l]=Dt(e,o),d=String(e.manager_name??"").trim(),m=Pe(e.icon||(e.is_notice?zo:we));return bo(De,{onClick:s=>{s.stopPropagation(),t(e)},sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:1,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:l?.bg??a.colors.surfaceHover,color:l?.fg??a.colors.textPrimary,fontSize:15,fontWeight:e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:e.completed?.6:1,cursor:"pointer",overflow:"hidden",...n?{borderLeft:`3px solid ${a.colors.accentOnSurface}`,pl:.75}:{}},children:[ve(De,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:Vg[e.priority]??a.colors.accentOnSurface}}),m?ve(m,{sx:{fontSize:16,flexShrink:0,opacity:.75}}):null,bo(De,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:a.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]}),!n&&d?ve(De,{component:"span",onClick:s=>{s.stopPropagation(),i?.(e)},sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:ve(lt,{src:r?.get(d)??"",avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}function Ds({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onOpenDetail:r,onAddSchedule:i,myAccountSeq:a=0,avatarSrcByName:l,fallbackToStartDate:d=!1}){let m=se(),[s,p]=la(()=>sa(new Date)),[u,c]=la(!1),f=Yn(()=>{let S=new Date(s.getFullYear(),s.getMonth()+1,0).getDate();return Array.from({length:S},(q,B)=>{let oe=new Date(s.getFullYear(),s.getMonth(),B+1);return{ymd:_s(oe),dayNumber:B+1,weekday:oe.getDay()}})},[s]),_=Yn(()=>{let S=new Map;for(let q of e){let B=q.due_date.slice(0,10)||(d?q.start_date.slice(0,10):"");if(!B)continue;let oe=S.get(B);oe?oe.push(q):S.set(B,[q])}for(let q of S.values())q.sort((B,oe)=>B.completed!==oe.completed?B.completed?1:-1:B.seq-oe.seq);return S},[e,d]),x=Yn(()=>d?e.filter(S=>!S.due_date.slice(0,10)&&!S.start_date.slice(0,10)).sort((S,q)=>S.completed!==q.completed?S.completed?1:-1:S.seq-q.seq):[],[e,d]),[h,g]=la(null),v=Yn(()=>kn(o),[o]),b=Yn(()=>[s.getFullYear()],[s]),I=zt(b),O=Ng(null),P=n.slice(0,7)===_s(s).slice(0,7);return Lg(()=>{if(!P)return;let S=y=>{let k=y?.parentElement??null;for(;k;){let H=window.getComputedStyle(k);if(/(auto|scroll)/.test(H.overflowY)&&k.scrollHeight>k.clientHeight)return k;k=k.parentElement}return null},q=()=>{let y=O.current,k=S(y);if(!k||!y)return;let H=y.getBoundingClientRect().top-k.getBoundingClientRect().top+k.scrollTop;k.scrollTop=Math.max(0,H-k.clientHeight/2+y.clientHeight/2)},B=setTimeout(q,100),oe=setTimeout(q,400);return()=>{clearTimeout(B),clearTimeout(oe)}},[P,s]),bo(De,{sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:m.colors.surface},children:[bo(De,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[ve(Is,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>p(S=>new Date(S.getFullYear(),S.getMonth()-1,1)),children:ve(Hg,{sx:{fontSize:20,color:m.colors.textSecondary}})}),ve(vs,{size:"small",color:"inherit",onClick:()=>p(sa(new Date)),sx:{minWidth:0,px:1,fontSize:13.5,color:m.mode==="dark"?m.colors.textStrong:m.colors.textPrimary},children:"\uC624\uB298"}),ve(Is,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>p(S=>new Date(S.getFullYear(),S.getMonth()+1,1)),children:ve(Wg,{sx:{fontSize:20,color:m.colors.textSecondary}})}),bo(De,{onClick:()=>c(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:m.mode==="dark"?400:700,color:m.mode==="dark"?m.colors.textStrong:m.colors.textPrimary,cursor:"pointer"},children:[s.getFullYear(),"\uB144 ",s.getMonth()+1,"\uC6D4",ve($g,{sx:{fontSize:20,color:m.colors.textMuted}})]})]}),bo(De,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${m.calendar.borderColor}`},children:[x.length>0?bo(De,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${m.calendar.borderColor}`},children:[bo(De,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:m.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",ve("br",{}),"\uC5C6\uC74C"]}),ve(De,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:x.map(S=>ve(ws,{task:S,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(S.manager_account_seq??0)===a,avatarSrcByName:l,onOpenMembers:g},S.seq))})]}):null,f.map(({ymd:S,dayNumber:q,weekday:B})=>{let oe=I.get(S)??"",y=S===n,k=!!oe||B===0,H=_.get(S)??[],$=v.get(S)??[],K=H.length>0||$.length>0;return bo(De,{ref:y?O:void 0,onClick:i?()=>i(S):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:K?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${m.calendar.borderColor}`,...i?{cursor:"pointer"}:{}},children:[ve(De,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:bo(De,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ve(De,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:26,height:26,borderRadius:"50%",fontSize:15.5,fontWeight:y?700:500,color:y?m.colors.surface:k?m.colors.danger:B===6?m.colors.accentOnSurface:m.colors.textPrimary,bgcolor:y?m.colors.accentOnSurface:"transparent"},children:q}),ve(De,{component:"span",sx:{fontSize:12.5,color:k?m.colors.danger:B===6?m.colors.accentOnSurface:m.colors.textSecondary},children:Ug[B]})]})}),bo(De,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[$.map(M=>ve(Tn,{event:M},M.uid)),H.map(M=>ve(ws,{task:M,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(M.manager_account_seq??0)===a,avatarSrcByName:l,onOpenMembers:g},M.seq))]})]},S)})]}),ve(Fg,{open:!!h,onClose:()=>g(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:h?bo(De,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:m.colors.surface},children:[ve(De,{sx:{fontSize:15.5,fontWeight:600,color:m.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.title}),[{label:"\uCC45\uC784\uC790",names:[String(h.manager_name??"").trim()]},{label:"\uCC38\uC870\uC790",names:h.receiver_names??[]},{label:"\uC791\uC131\uC790",names:[String(h.created_by??"").trim()]}].map(S=>{let q=S.names.filter(B=>!!B);return bo(De,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[ve(De,{sx:{width:56,flexShrink:0,fontSize:13.5,color:m.colors.textSecondary,pt:.5},children:S.label}),ve(De,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:q.length===0?ve(De,{sx:{fontSize:14,color:m.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):q.map(B=>bo(De,{sx:{display:"flex",alignItems:"center",gap:.75},children:[ve(lt,{src:l?.get(B)??"",avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),ve(De,{sx:{fontSize:14.5,color:m.colors.textPrimary},children:B})]},`${S.label}-${B}`))})]},S.label)}),ve(De,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:ve(vs,{size:"small",color:"inherit",onClick:()=>g(null),children:"\uB2EB\uAE30"})})]}):null}),ve(Kg,{open:u,centered:!0,monthOnly:!0,onClose:()=>c(!1),selectedDate:s,onDateChange:S=>{p(sa(S)),c(!1)}})]})}import{useCallback as Os,useEffect as Ms,useMemo as ca,useRef as Wr,useState as $r}from"react";import{Box as Fe,Tooltip as Rs}from"@mui/material";import Gg from"@ehfuse/overlay-scrollbar";import Yg from"@mui/icons-material/CheckCircle";import jg from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as Xg,PointerSensor as Qg,closestCenter as Jg,useSensor as Zg,useSensors as eb}from"@dnd-kit/core";import{SortableContext as ob,arrayMove as tb,useSortable as nb,verticalListSortingStrategy as rb}from"@dnd-kit/sortable";import ib from"@mui/icons-material/DragIndicator";import{jsx as qe,jsxs as At}from"react/jsx-runtime";var ma=36,ab=48,Es=40,lb=24,sb=4,cb=14,Ps=36,mb=12.5,yn=220,ub={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function Jt(e){let o=String(e??"").trim();if(!o)return null;let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?null:t}function Hr(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function ua(e,o){return Math.round((o.getTime()-e.getTime())/864e5)}function db({task:e,dragHandle:o,onPointerDown:t,onClick:n}){let r=se(),i=Wr(null),[a,l]=$r("");return qe(Rs,{title:a,arrow:!0,enterDelay:300,children:At(Fe,{onPointerDown:t,onClick:d=>n(e,d),onMouseEnter:()=>{let d=i.current;l(d&&d.scrollWidth>d.clientWidth?e.title:"")},sx:{width:yn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:r.mode==="dark"||e.completed?400:500,color:e.completed?r.colors.textMuted:r.mode==="dark"?r.colors.textStrong:r.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:r.colors.surfaceHover}},children:[o,qe(Fe,{ref:i,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function pb({id:e,showIndicator:o,children:t}){let n=se(),{attributes:r,listeners:i,setNodeRef:a}=nb({id:e});return At(Fe,{ref:a,sx:{position:"relative"},children:[o?qe(Fe,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:n.colors.accentOnSurface,zIndex:5}}):null,t({...r,...i})]})}function zs({tasks:e,todayStr:o,onOpenDetail:t,onToggleChecklist:n,onReorderTasks:r,onTaskContextMenu:i}){let a=se(),l=ca(()=>[...e].sort((k,H)=>{let $=(k.timeline_sort_no??0)>0,K=(H.timeline_sort_no??0)>0;if($&&K)return(k.timeline_sort_no??0)-(H.timeline_sort_no??0);if($!==K)return $?-1:1;let M=k.due_date||k.start_date,ae=H.due_date||H.start_date;return M!==ae?M<ae?-1:1:k.seq-H.seq}),[e]),[d,m]=$r(null),[s,p]=$r(null),u=eb(Zg(Qg,{activationConstraint:{distance:4}})),c=Os(k=>{m(k.over?Number(k.over.id):null)},[]),f=Os(k=>{m(null),p(null);let{active:H,over:$}=k;if(!$||H.id===$.id)return;let K=l.map(ie=>ie.seq),M=K.indexOf(Number(H.id)),ae=K.indexOf(Number($.id));M===-1||ae===-1||r(tb(K,M,ae))},[l,r]),_=ca(()=>{let k=Jt(o)??new Date,H=k,$=Hr(k,21);for(let ae of l){let ie=Jt(ae.start_date)??Jt(ae.due_date),Oe=Jt(ae.due_date)??ie;ie&&ie<H&&(H=ie),Oe&&Oe>$&&($=Oe)}let K=Hr(H,-3),M=ua(K,Hr($,3))+1;return Array.from({length:M},(ae,ie)=>Hr(K,ie))},[l,o]),x=_[0],h=_.findIndex(k=>Le(k)===o),{dayWidths:g,dayOffsets:v,gridWidth:b}=ca(()=>{let k=_.map((K,M)=>K.getDate()===1||M===0?ab:ma),H=[],$=0;for(let K of k)H.push($),$+=K;return{dayWidths:k,dayOffsets:H,gridWidth:$}},[_]),I=yn+b,O=Wr(null),P=k=>{O.current={x:k.clientX,y:k.clientY}},S=(k,H)=>{let $=O.current;O.current=null,!($&&(Math.abs(H.clientX-$.x)>5||Math.abs(H.clientY-$.y)>5))&&t(k)},q=Wr(null),[B,oe]=$r(!1);Ms(()=>{let k=q.current?.getScrollContainer();if(!k)return;let H=()=>oe(k.scrollHeight>k.clientHeight);H();let $=new ResizeObserver(H);return $.observe(k),()=>$.disconnect()},[l.length]);let y=Wr(!1);return Ms(()=>{if(l.length===0||y.current)return;y.current=!0;let k=window.requestAnimationFrame(()=>{let H=q.current?.getScrollContainer();!H||h<0||(H.scrollLeft=Math.max(0,v[h]-ma*3))});return()=>window.cancelAnimationFrame(k)},[l.length]),qe(Fe,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${a.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:a.timeline.headerBg},children:qe(Fe,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:qe(Gg,{ref:q,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:At(Fe,{sx:{width:I,position:"relative",bgcolor:a.timeline.bg},children:[At(Fe,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:a.timeline.headerBg,borderBottom:`1px solid ${a.timeline.gridColor}`},children:[qe(Fe,{sx:{width:yn,height:Ps,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:a.timeline.headerBg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:a.colors.textSecondary},children:"\uC81C\uBAA9"}),_.map((k,H)=>{let $=k.getDay(),K=H===h,M=k.getDate()===1||H===0;return qe(Fe,{sx:{width:g[H],height:Ps,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:mb,fontWeight:K&&a.mode!=="dark"?700:400,color:K?a.timeline.bg:$===0?a.colors.danger:$===6?a.colors.accentOnSurface:a.colors.textSecondary,bgcolor:K?a.colors.danger:"transparent",borderRight:`1px solid ${a.timeline.gridColor}`,whiteSpace:"nowrap"},children:M?`${k.getMonth()+1}/${k.getDate()}`:k.getDate()},Le(k))})]}),qe(Xg,{sensors:u,collisionDetection:Jg,onDragStart:k=>p(Number(k.active.id)),onDragOver:c,onDragEnd:f,onDragCancel:()=>{m(null),p(null)},children:qe(ob,{items:l.map(k=>String(k.seq)),strategy:rb,children:At(Fe,{sx:{position:"relative"},children:[_.map((k,H)=>{let $=k.getDay(),K=H===h;return!K&&$!==0&&$!==6?null:qe(Fe,{sx:{position:"absolute",top:0,bottom:0,left:yn+v[H],width:g[H],bgcolor:K?"rgba(229,72,77,0.07)":a.colors.surfaceSubtle,zIndex:0}},`stripe-${Le(k)}`)}),l.map((k,H)=>{let $=Jt(k.start_date)??Jt(k.due_date),K=Jt(k.due_date)??$,M=$?Math.min(_.length-1,Math.max(0,ua(x,$))):0,ae=K?Math.min(_.length-1,Math.max(M,ua(x,K))):M,ie=ub[k.priority],Oe=yn+v[M]+2,N=v[ae]+g[ae]-v[M]-4,U=k.checklist??[];return qe(pb,{id:String(k.seq),showIndicator:d===k.seq&&s!==k.seq,children:F=>At(Fe,{sx:{borderBottom:H===l.length-1&&B?"none":`1px solid ${a.timeline.gridColor}`,position:"relative",zIndex:1,opacity:s===k.seq?.45:1},children:[At(Fe,{onContextMenu:V=>i(k,V),sx:{display:"flex",height:Es,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[qe(db,{task:k,dragHandle:qe(Fe,{component:"span",className:"taskbox-timeline-handle",...F,onClick:V=>V.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:a.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:a.colors.accentOnSurface}},children:(()=>{let V=Pe(k.icon||we)??ib;return qe(V,{sx:{fontSize:17}})})()}),onPointerDown:P,onClick:S}),qe(Rs,{title:`${k.title} (${k.start_date||"?"} ~ ${k.due_date||"?"})`,arrow:!0,enterDelay:300,children:qe(Fe,{onPointerDown:P,onClick:V=>S(k,V),sx:{position:"absolute",top:(Es-20)/2,left:Oe,width:Math.max(ma-4,N),height:20,borderRadius:1,bgcolor:ie.bg,border:`1px solid ${ie.border}`,opacity:k.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),U.map((V,E)=>qe(Fe,{sx:{display:"flex",height:lb,position:"relative",mt:E===0?`${sb}px`:0,mb:E===U.length-1?`${cb}px`:0},children:qe(Fe,{sx:{width:yn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:a.timeline.bg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:V.checked?a.colors.textMuted:a.colors.textPrimary},children:At(Fe,{onClick:()=>n(k.seq,E,!V.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[V.checked?qe(Yg,{sx:{fontSize:17,color:a.colors.accentOnSurface,flexShrink:0}}):qe(jg,{sx:{fontSize:17,color:a.colors.textMuted,flexShrink:0}}),qe(Fe,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:V.checked?"line-through":"none"},children:V.label})]})})},`${k.seq}-check-${E}`))]})},k.seq)}),l.length===0?qe(Fe,{sx:{py:8,textAlign:"center",color:a.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as Zt}from"react/jsx-runtime";function Xw(e){switch(e.view){case"card":case"kanban":{let{view:o,...t}=e;return Zt(ta,{...t,columnAxis:o==="kanban"?"status":"project"})}case"sprint":{let{view:o,...t}=e;return Zt(ta,{...t,columnAxis:"sprint"})}case"calendar":{let{view:o,...t}=e;return Zt(gs,{...t})}case"month":{let{view:o,...t}=e;return Zt(Cs,{...t})}case"agenda":{let{view:o,...t}=e;return Zt(Ds,{...t})}case"timeline":{let{view:o,...t}=e;return Zt(zs,{...t})}default:{let{view:o,...t}=e;return Zt(Xl,{...t})}}}var Qw=["list","card","kanban","calendar","month","timeline"];import{Box as ho}from"@mui/material";function fb(e){let o=String(e??"").trim();if(!o)return 0;let t=0,n=!1;for(let r of o.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let i=parseFloat(r[1]),a=r[2].toLowerCase();n=!0,a==="m"||a==="\uBD84"?t+=i/60:a==="d"||a==="\uC77C"?t+=i*8:t+=i}if(!n){let r=parseFloat(o);Number.isFinite(r)&&(t+=r)}return t}function qs(e){let o=Math.round(e*10)/10;return`${o%1===0?o.toFixed(0):o.toFixed(1)}\uC2DC\uAC04`}function As(e,o,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return 0;let n=new Date(`${e}T00:00:00`),r=new Date(`${o}T00:00:00`);if(r<n||r.getTime()-n.getTime()>3660*864e5)return 0;let i=0;for(let a=new Date(n);a<=r;a.setDate(a.getDate()+1)){let l=a.getDay();if(l===0||l===6)continue;let d=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;t.has(d)||(i+=1)}return i}function Ls(e){return e.reduce((o,t)=>t.completed?o:o+fb(t.estimated_time),0)}import{Fragment as xb,jsx as Lt,jsxs as No}from"react/jsx-runtime";function Ns(e,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return null;let t=new Date(`${e}T00:00:00`),n=new Date(`${o}T00:00:00`);return Math.round((t.getTime()-n.getTime())/864e5)}function Fs({tasks:e,todayStr:o,showProgress:t=!0,dday:n=null,workdaysLeft:r=null,showPoints:i=!0,showHours:a=!0,showOverdue:l=!0,showInfo:d=!0,inline:m=!1}){let s=se(),p=e.filter(S=>!S.archived),u=p.filter(S=>S.completed).length,c=p.length>0?Math.round(u/p.length*100):0,f=p.filter(S=>!S.completed&&!S.is_event&&!!S.due_date&&S.due_date.slice(0,10)<o).length,_=p.reduce((S,q)=>q.completed?S:S+(q.story_points??0),0),x=Ls(p),h=t?Lt(ho,{sx:{flex:m?"0 0 110px":"1 1 auto",minWidth:0,height:s.summary.gaugeHeight,borderRadius:3,bgcolor:s.summary.gaugeTrackColor},children:Lt(ho,{sx:{height:"100%",borderRadius:3,width:`${c}%`,bgcolor:c>=100?s.summary.gaugeCompleteColor:s.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,g=t?No(ho,{component:"span",sx:{flexShrink:0,fontSize:m?14:13,color:s.summary.textColor},children:[c,"%"]}):null,v={color:s.summary.numberColor,fontWeight:700,fontSize:m?15:14},b=p.length-u,I=No(xb,{children:[m?null:No("span",{children:["\uB0A8\uC740 ",Lt(ho,{component:"span",sx:v,children:b}),"\uAC74"]}),l&&f>0?No(ho,{component:"span",sx:{color:s.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",Lt(ho,{component:"span",sx:{fontWeight:700,fontSize:m?15:14},children:f}),"\uAC74"]}):null,i&&_>0?No("span",{children:[Lt(ho,{component:"span",sx:v,children:_}),"SP"]}):null,a&&x>0?No("span",{children:["\uC57D ",Lt(ho,{component:"span",sx:v,children:qs(x).replace("\uC2DC\uAC04","")}),"\uC2DC\uAC04"]}):null]}),O=typeof r=="number"&&Number.isFinite(r)?No("span",{children:["\uADFC\uBB34\uC77C ",Lt(ho,{component:"span",sx:v,children:r}),"\uC77C"]}):null,P=typeof n=="number"&&Number.isFinite(n)?Lt(ho,{component:"span",sx:{ml:m?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:s.summary.overdueColor,color:s.colors.textInverse,lineHeight:1.6},children:n===0?"D-day":n>0?`D-${n}`:`D+${-n}`}):null;return m?No(ho,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:s.summary.textColor,whiteSpace:"nowrap",...s.summary.sx},children:[d?I:null,d?O:null,d?P:null,h,g]}):No(ho,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[t?No(ho,{sx:{display:"flex",alignItems:"center",gap:1},children:[h,g]}):null,No(ho,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:s.summary.textColor},children:[I,O,P]})]})}import{useMemo as gb}from"react";import{jsx as bb}from"react/jsx-runtime";function mD({sprint:e,tasks:o,todayStr:t,...n}){let r=e.status==="closed"?null:Ns(e.end_date,t),i=r!==null&&r>=0,a=gb(()=>{if(!i)return[];let m=Number(t.slice(0,4)),s=Number(e.end_date.slice(0,4))||m,p=[];for(let u=m;u<=Math.max(m,s);u+=1)p.push(u);return p},[i,t,e.end_date]),l=zt(a),d=i?As(t,e.end_date,new Set(l.keys())):null;return bb(Fs,{tasks:o,todayStr:t,dday:r,workdaysLeft:d,...n})}import{useEffect as _b,useRef as wb,useState as Db}from"react";import{Box as pa}from"@mui/material";import{Children as hb}from"react";import{Box as da,CircularProgress as kb}from"@mui/material";import{jsx as Kr}from"react/jsx-runtime";var Hs={xs:2,md:3};function Ws(){return Kr(da,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:Kr(kb,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function $s({children:e}){return Kr(da,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:Hs,pb:Hs},children:hb.map(e,o=>o==null||o===!1?null:Kr(da,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:o}))})}import{Box as bt,Button as Bb,Checkbox as Cb,Typography as Nt}from"@mui/material";import Us from"@mui/icons-material/CheckCircle";import vb from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as Sb,jsx as Ks}from"react/jsx-runtime";var Tb="taskbox-search-highlight";function yb(e,o){let t=o?.keyPrefix??"hl";return e.map((n,r)=>Ks("span",{className:n.highlight?o?.highlightClassName??Tb:o?.className,style:n.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:n.text},`${t}-${n.text}-${r}`))}function Ur({text:e,keyword:o,fallback:t="-",className:n,highlightClassName:r,keyPrefix:i}){let a=String(e??"").trim()||t,l=Br(a,o);return Ks(Sb,{children:yb(l,{className:n,highlightClassName:r,keyPrefix:i})})}import{jsx as fe,jsxs as Sn}from"react/jsx-runtime";var Ib={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:po(12.5),fontWeight:500,lineHeight:1.4},gt={fontSize:po(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function Qo({label:e,children:o}){return Sn(bt,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[fe(bt,{sx:Ib,children:e}),fe(bt,{sx:{...gt,flex:1,pt:.2},children:o})]})}function Vs({task:e,statusOptions:o,projectLabel:t,searchText:n,todayStr:r,onRequestToggleCompleted:i,onOpenDetail:a,onTaskContextMenu:l,targetSummary:d="",ackInfo:m,completeLocked:s=!1,unread:p=!1,noticeReadOnly:u=!1,onAckConfirm:c,onAckListClick:f,myManaged:_=!1}){let x=e.is_event?Hn(e):fo(e),h=Yo(e.start_date),g=Yo(e.due_date),v=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<r,b=(e.receiver_names??[]).filter(Boolean);return Sn(bt,{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),a(e))},onContextMenu:I=>l(e,I),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",position:"relative"},children:[_?fe(bt,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,Sn(bt,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[!u&&!s?fe(Cb,{checked:e.completed,icon:fe(vb,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:fe(Us,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:I=>I.stopPropagation(),onChange:(I,O)=>i({anchorEl:I.currentTarget,taskSeq:e.seq,nextCompleted:O}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{let I=Pe(e.icon||(e.is_notice?zo:we));if(!I)return null;let O=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return fe(I,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:O}})})(),fe(Nt,{sx:{fontSize:po(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":"#111827",textDecoration:e.completed?"line-through":"none"},children:fe(Ur,{text:e.title,keyword:n})}),p?fe(bt,{component:"span",sx:{flexShrink:0,px:.55,fontSize:po(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),Sn(bt,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[fe(Qo,{label:x?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:Sn(bt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:[x?fe(Me,{option:x,small:!0}):null,fe(qo,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?fe(Qo,{label:"\uB77C\uBCA8",children:fe(Ot,{labelKeys:e.label_keys,labelOptions:o})}):null,t?fe(Qo,{label:"\uD504\uB85C\uC81D\uD2B8",children:fe(Nt,{sx:gt,children:t})}):null,h?fe(Qo,{label:"\uC2DC\uC791",children:fe(Nt,{sx:gt,children:h})}):null,g?fe(Qo,{label:"\uB9C8\uAC10",children:Sn(Nt,{sx:{...gt,color:v?"#e5484d":gt.color,fontWeight:v?600:400},children:[g,v?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?fe(Qo,{label:"\uB300\uC0C1\uC790",children:fe(Nt,{sx:gt,children:d||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&m?fe(Qo,{label:"\uD655\uC778",children:fe(Bb,{size:"small",variant:m.canAck?"contained":"outlined",color:"inherit",startIcon:m.acked?fe(Us,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:I=>{I.stopPropagation(),m.canAck?c?.(e):f?.(e,I.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:po(13),...m.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:m.canAck?"\uD655\uC778":`${m.count}/${m.total}`})}):null,!e.is_notice&&e.manager_name?fe(Qo,{label:"\uCC45\uC784\uC790",children:fe(Nt,{sx:gt,children:fe(Ur,{text:e.manager_name,keyword:n})})}):null,!e.is_notice&&b.length>0?fe(Qo,{label:"\uCC38\uC870\uC790",children:fe(Nt,{sx:gt,children:b.join(", ")})}):null,e.note?fe(Qo,{label:"\uBE44\uACE0",children:fe(Nt,{sx:gt,children:fe(Ur,{text:e.note,keyword:n})})}):null]})]})}import{jsx as Bn,jsxs as Ob}from"react/jsx-runtime";function AD({tasks:e,statusOptions:o,customTabs:t,loading:n,searchText:r,todayStr:i,onToggleCompleted:a,onOpenDetail:l,onTaskContextMenu:d,getTargetSummary:m,getAckInfo:s,getNoticeReadOnly:p,isTaskUnread:u,getCompleteLocked:c,onAckConfirm:f,onAckListClick:_,onEndReached:x,myAccountSeq:h=0}){let g=new Map(t.map(O=>[O.key,O.label])),[v,b]=Db(null),I=wb(null);return _b(()=>{let O=I.current;if(!x||!O)return;let P=new IntersectionObserver(S=>{S[0]?.isIntersecting&&x()});return P.observe(O),()=>P.disconnect()},[x,e.length]),e.length===0?n?Bn(Ws,{}):Bn(pa,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Ob(pa,{sx:{minWidth:0},children:[Bn($s,{children:e.map(O=>Bn(Vs,{myManaged:h>0&&!O.is_notice&&!O.is_event&&(O.manager_account_seq??0)===h,task:O,statusOptions:o,projectLabel:O.tab_key?g.get(O.tab_key)??"":"",searchText:r,todayStr:i,onRequestToggleCompleted:b,onOpenDetail:l,onTaskContextMenu:d,targetSummary:O.is_notice?m?.(O):void 0,ackInfo:O.is_notice?s?.(O):void 0,noticeReadOnly:O.is_notice?p?.(O):!1,unread:u?.(O)??!1,completeLocked:c?.(O)??!1,onAckConfirm:f,onAckListClick:_},O.seq))}),x?Bn(pa,{ref:I,sx:{height:"1px"}}):null,Bn(Ge,{open:!!v,anchorEl:v?.anchorEl??null,title:v?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:v?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>b(null),onConfirm:()=>{v&&a(v.taskSeq,v.nextCompleted),b(null)}})]})}import{useEffect as yk,useRef as Sk,useState as Bc}from"react";import{Box as or,Button as Cc,Divider as Bk,Drawer as Ck,IconButton as _a,Tooltip as vk}from"@mui/material";import Ik from"@mui/icons-material/Close";import _k from"@mui/icons-material/ArrowBack";import wk from"@ehfuse/overlay-scrollbar";import{Box as fa,ButtonBase as Mb,Divider as Eb,Popover as Pb}from"@mui/material";import Rb from"@mui/icons-material/Check";import zb from"@ehfuse/overlay-scrollbar";import{jsx as en,jsxs as Ys}from"react/jsx-runtime";var Gs=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function Vr({anchorEl:e,value:o,color:t="",onSelect:n,onSelectColor:r,onClose:i}){return en(Pb,{transitionDuration:0,open:!!e,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:Ys(fa,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[en(zb,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:en(wr,{value:o||we,onChange:a=>{n(a),i()}})}),r?Ys(fa,{sx:{px:1.25,pb:1.25},children:[en(Eb,{sx:{mb:1,borderColor:"#efefed"}}),en(fa,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:Gs.map(a=>{let l=(t||Gs[0])===a;return en(Mb,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${a}`,onClick:()=>r(a),sx:{width:26,height:26,borderRadius:"50%",bgcolor:a,display:"flex",alignItems:"center",justifyContent:"center"},children:l?en(Rb,{sx:{fontSize:15,color:"#ffffff"}}):null},a)})})]}):null]})})}import{useState as Tc}from"react";import{Box as Jn,ButtonBase as uk,Divider as Zn,Menu as dk,MenuItem as pk}from"@mui/material";import fk from"@mui/icons-material/SubjectOutlined";import xk from"@mui/icons-material/StickyNote2Outlined";import gk from"@mui/icons-material/LabelOutlined";import bk from"@mui/icons-material/DirectionsRunOutlined";import hk from"@mui/icons-material/SpeedOutlined";import{TextField as kk}from"@ehfuse/mui-form-controls";import{InfoAlert as Tk}from"@ehfuse/alerts";import{useState as Ft}from"react";import{Box as nc,Divider as eh,ListItemIcon as oh,Menu as ba,MenuItem as jn}from"@mui/material";import th from"@mui/icons-material/Add";import Yr from"@mui/icons-material/Check";import nh from"@mui/icons-material/ViewKanbanOutlined";import rh from"@mui/icons-material/CalendarTodayOutlined";import ih from"@mui/icons-material/EventOutlined";import ah from"@mui/icons-material/PersonOutlineOutlined";import Zs from"@mui/icons-material/PeopleAltOutlined";import lh from"@mui/icons-material/FlagOutlined";import ec from"@mui/icons-material/TimerOutlined";import sh from"@mui/icons-material/NotificationsNoneOutlined";import ch from"@mui/icons-material/InboxOutlined";import mh from"@mui/icons-material/PlaceOutlined";import uh from"@mui/icons-material/MapOutlined";import{DatePicker as dh,TimePicker as oc}from"@ehfuse/mui-datetime-picker";var Jo="@media (max-width: 719.95px)";function co(e){return{[Jo]:{order:e}}}import{useEffect as qb,useState as Ab}from"react";import{Box as Lb}from"@mui/material";import{jsx as Nb}from"react/jsx-runtime";function ht({value:e,placeholder:o,readOnly:t,onCommit:n}){let r=se(),[i,a]=Ab(e);return qb(()=>a(e),[e]),Nb(Lb,{component:"input",spellCheck:!1,value:i,readOnly:t,placeholder:o,onChange:l=>a(l.target.value),onBlur:()=>{i.trim()!==e&&n(i.trim())},onKeyDown:l=>{l.key==="Enter"&&l.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:r.colors.textPrimary,caretColor:r.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as xa}from"@mui/material";import{jsx as Fb,jsxs as js}from"react/jsx-runtime";function ue({icon:e,label:o,onClick:t,sx:n,children:r}){return js(xa,{sx:[{display:"flex",alignItems:"center",minHeight:26,[Jo]:{minHeight:25}},...Array.isArray(n)?n:[n]],children:[js(xa,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,o]}),Fb(xa,{onClick:t?i=>t(i.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:t?"pointer":"default","&:hover":t?{bgcolor:"#f2f2f0"}:void 0,[Jo]:{py:.25}},children:r})]})}import{Suspense as Hb,lazy as Wb,useEffect as $b,useState as Xs}from"react";import{Box as ga,Dialog as Kb,DialogContent as Ub,DialogTitle as Vb,IconButton as Qs,Tooltip as Gb}from"@mui/material";import Yb from"@mui/icons-material/Close";import jb from"@mui/icons-material/Search";import{Fragment as Zb,jsx as Fo,jsxs as Gr}from"react/jsx-runtime";function Xb(e){return Fo(ga,{sx:{p:3,fontSize:14,color:"#9a9a97"},children:"\uC8FC\uC18C \uAC80\uC0C9 \uBAA8\uB4C8(react-daum-postcode)\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC785\uB825\uD574 \uC8FC\uC138\uC694."})}var Qb=Wb(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:Xb})));function Jb(e){if(e.addressType!=="R")return e.address;let o="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(o+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(o+=o!==""?`, ${e.buildingName}`:e.buildingName),o!==""?`${e.address} (${o})`:e.address}function Js({value:e,placeholder:o="\uC8FC\uC18C \uC785\uB825",readOnly:t,onCommit:n}){let[r,i]=Xs(e),[a,l]=Xs(!1),d=Co().slots?.addressSearch;$b(()=>i(e),[e]);let m=p=>{i(p),l(!1),p!==e&&n(p)};return Gr(Zb,{children:[Gr(ga,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[Fo(ga,{component:"input",spellCheck:!1,value:r,readOnly:t,placeholder:o,onChange:p=>i(p.target.value),onBlur:()=>{a||r.trim()!==e&&n(r.trim())},onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),!t&&l(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),t?null:Fo(Gb,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:Fo(Qs,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>l(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:Fo(jb,{sx:{fontSize:17}})})})]}),d?Fo(d,{open:a,onComplete:m,onClose:()=>l(!1)}):Gr(Kb,{open:a,onClose:()=>l(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[Gr(Vb,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",Fo(Qs,{onClick:()=>l(!1),size:"small",children:Fo(Yb,{})})]}),Fo(Ub,{style:{padding:0},dividers:!0,children:a?Fo(Hb,{fallback:null,children:Fo(Qb,{onComplete:p=>{m(Jb(p))},onClose:()=>l(!1),defaultQuery:r,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as jr,jsx as Y,jsxs as Ho}from"react/jsx-runtime";function ph(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function tc(e){let[o="00",t="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(o)?o:"00",minute:/^\d{2}$/.test(t)?t:"00"}}function on({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Y(nc,{component:"span",sx:{color:"#9a9a97"},children:e})}function Xr({values:e,customTabs:o,avatarSrcByName:t,showEstimatedTime:n=!1,managerLocked:r=!1,notice:i=!1,event:a=!1,readOnly:l=!1,targetSummary:d="",narrowCollapsedSx:m,reminderLocked:s=!1,managerAction:p,hideProject:u=!1,leading:c,trailing:f,onChangeProject:_,onChangeStartDate:x,onChangeDueDate:h,onChangeReminder:g,onChangePriority:v,onChangeEstimatedTime:b,onChangeEventTime:I,onChangeEventPlace:O,onChangeEventAddress:P,onMemberEdit:S,onAddProject:q}){let[B,oe]=Ft(null),[y,k]=Ft(!1),[H,$]=Ft(null),[K,M]=Ft(null),[ae,ie]=Ft(null),[Oe,N]=Ft(null),[U,F]=Ft(null),[V,E]=Ft(null),z=$e(),ne=Go(),te=R=>[co(R),...m?Array.isArray(m)?m:[m]:[]],Z=o.find(R=>R.key===e.tabKey),ye=o.filter(R=>!R.archived);return Ho(jr,{children:[Ho(nc,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",columnGap:3,rowGap:.25,px:2,[Jo]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[c,u?null:Y(ue,{icon:Y(nh,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:l?void 0:R=>oe(R),sx:te(1),children:Z?(()=>{let R=Pe(Z.icon);return Ho(jr,{children:[R?Y(R,{sx:{fontSize:16,color:"#1e3a8a"}}):null,Z.label]})})():"\uAE30\uBCF8"}),i?Y(ue,{icon:Y(Zs,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:l?void 0:()=>S("targets"),sx:co(7),children:d||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!i&&!a?Y(ue,{icon:Y(ah,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:r||l||!e.managerName&&p?void 0:()=>S("manager"),sx:co(7),children:e.managerName?Ho(jr,{children:[Y(xo,{names:[e.managerName],size:20,avatarSrcByName:t}),e.managerName]}):p??Y(on,{})}):null,a?null:Y(ue,{icon:Y(rh,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC790",onClick:l?void 0:R=>ie(R),sx:co(2),children:e.startDate?Yo(e.startDate):Y(on,{})}),i?null:Y(ue,{icon:Y(Zs,{sx:{fontSize:17}}),label:a?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:l?void 0:()=>S("receivers"),sx:co(a?7:8),children:e.receiverNames.length>0?Ho(jr,{children:[Y(xo,{names:e.receiverNames,size:20,avatarSrcByName:t}),e.receiverNames.length===1?e.receiverNames[0]:null]}):Y(on,{})}),Y(ue,{icon:Y(ih,{sx:{fontSize:17}}),label:a?"\uB0A0\uC9DC":"\uB9C8\uAC10\uAE30\uD55C",onClick:l?void 0:R=>N(R),sx:co(3),children:e.dueDate?Yo(e.dueDate):Y(on,{})}),a?Y(ue,{icon:Y(ec,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:l?void 0:R=>E(R),sx:co(4),children:e.eventTime?e.eventTime:Y(on,{label:"\uC885\uC77C"})}):null,a?Y(ue,{icon:Y(mh,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:co(5),children:Y(ht,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:l,onCommit:R=>O?.(R)})}):null,n?Y(ue,{icon:Y(ec,{sx:{fontSize:17}}),label:"\uC608\uC0C1\uC2DC\uAC04",onClick:l?void 0:R=>F(R),sx:te(4),children:e.estimatedTime?e.estimatedTime:Y(on,{})}):null,Y(ue,{icon:Y(sh,{sx:{fontSize:17}}),label:"\uB9AC\uB9C8\uC778\uB354",onClick:l||s?void 0:R=>M(R),sx:te(a?8:5),children:e.reminder==="none"?Y(on,{label:"\uC5C6\uC74C"}):Vi(e.reminder)}),a?Y(ue,{icon:Y(uh,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},co(6)],children:Y(Js,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:l,onCommit:R=>P?.(R)})}):null,a?null:Y(ue,{icon:Y(lh,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:l?void 0:R=>$(R),sx:te(6),children:Y(qo,{priority:e.priority,small:!0})}),f]}),Ho(ba,{transitionDuration:0,anchorEl:B,open:!!B,onClose:()=>oe(null),...ne,children:[Ho(jn,{selected:!e.tabKey,onClick:()=>{_(""),oe(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Y(ch,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:Y(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),ye.map(R=>{let j=Pe(R.icon),ke=e.tabKey===R.key;return Ho(jn,{selected:ke,onClick:()=>{_(R.key),oe(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[j?Y(j,{sx:{fontSize:17,color:"#1e3a8a"}}):null,R.label,ke?Y(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.key)}),q?[Y(eh,{},"add-project-divider"),Ho(jn,{onClick:()=>k(!0),sx:{fontSize:14,color:"#787774"},children:[Y(oh,{children:Y(th,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),q?Y(Dr,{open:y,onClose:()=>k(!1),onSubmit:(R,j,ke)=>{(async()=>{let w=await q(R,j,ke);w&&_(w)})(),oe(null)}}):null,Y(ba,{transitionDuration:0,anchorEl:H,open:!!H,onClose:()=>$(null),...ne,children:["high","medium","low"].map(R=>Ho(jn,{selected:e.priority===R,onClick:()=>{v(R),$(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[Y(qo,{priority:R,small:!0}),e.priority===R?Y(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R))}),Y(ba,{transitionDuration:0,anchorEl:K,open:!!K,onClose:()=>M(null),...ne,children:Ui(a&&!!e.eventTime).map(R=>Ho(jn,{selected:e.reminder===R.value,onClick:()=>{g(R.value),M(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[R.label,e.reminder===R.value?Y(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.value))}),n?Y(oc,{anchorEl:U,open:!!U,onClose:()=>F(null),value:tc(e.estimatedTime),format:"HH:mm",minuteStep:5,autoApply:!0,centered:z,locale:"ko",onChange:(R,j)=>{b?.(`${R}:${j}`),F(null)}}):null,a?Y(oc,{anchorEl:V,open:!!V,onClose:()=>E(null),value:tc(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:z,locale:"ko",onChange:(R,j)=>{I?.(`${R}:${j}`),E(null)}}):null,Y(dh,{anchorEl:ae,open:!!ae,onClose:()=>ie(null),selectedDate:ph(e.startDate),centered:z,onDateChange:R=>{x(Le(R)),ie(null)}}),Y(Et,{anchorEl:Oe,open:!!Oe,date:e.dueDate,reminder:e.reminder,hideReminder:s,centered:z,onClose:()=>N(null),onDateChange:h,onReminderChange:g})]})}import{useState as fh}from"react";import{Box as xh,Menu as gh,MenuItem as bh}from"@mui/material";import hh from"@mui/icons-material/RepeatOutlined";import kh from"@mui/icons-material/DevicesOutlined";import Th from"@mui/icons-material/ScreenSearchDesktopOutlined";import yh from"@mui/icons-material/SellOutlined";import Sh from"@mui/icons-material/TaskAltOutlined";import{Fragment as rc,jsx as Xe,jsxs as ic}from"react/jsx-runtime";function ha({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Xe(xh,{component:"span",sx:{color:"#9a9a97"},children:e})}function Qr({values:e,readOnly:o=!1,showResolution:t=!1,onChangeRepro:n,onChangeDevice:r,onChangeWhere:i,onChangeVersion:a,onChangeResolution:l}){let[d,m]=fh(null),s=d?.field==="repro"?vi:d?.field==="device"?Ii:_i,p=u=>{d?.field==="repro"?n(u):d?.field==="device"?r(u):d?.field==="resolution"&&l?.(u),m(null)};return ic(rc,{children:[ic(rc,{children:[Xe(ue,{icon:Xe(hh,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:o?void 0:u=>m({field:"repro",el:u}),children:yl(e.repro)||Xe(ha,{label:"\uC120\uD0DD"})}),Xe(ue,{icon:Xe(kh,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:o?void 0:u=>m({field:"device",el:u}),children:Sl(e.device)||Xe(ha,{label:"\uC120\uD0DD"})}),Xe(ue,{icon:Xe(Th,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:Xe(ht,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:o,onCommit:i})}),Xe(ue,{icon:Xe(yh,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:Xe(ht,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:o,onCommit:a})}),t?Xe(ue,{icon:Xe(Sh,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:o?void 0:u=>m({field:"resolution",el:u}),children:pr(e.resolution)||Xe(ha,{label:"\uC120\uD0DD"})}):null]}),Xe(gh,{open:!!d,anchorEl:d?.el??null,onClose:()=>m(null),transitionDuration:0,children:s.map(u=>Xe(bh,{onClick:()=>p(u.key),sx:{fontSize:14},children:u.name},u.key))})]})}import{Box as ac}from"@mui/material";import{jsxs as lc}from"react/jsx-runtime";function Mo({icon:e,title:o,titleExtra:t,children:n}){return lc(ac,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[lc(ac,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:14.5,fontWeight:500,color:"#37352f"},children:[e,o,t]}),n]})}import{useEffect as Bh,useRef as ka,useState as Ch}from"react";import{Box as Ta,IconButton as vh,Tooltip as Ih}from"@mui/material";import _h from"@mui/icons-material/ContentCopyOutlined";import wh from"@mui/icons-material/Check";import{EhfuseEditor as Dh,minimalToolbarOptions as Oh}from"@ehfuse/editor";import{jsx as tn,jsxs as Eh}from"react/jsx-runtime";function ya(e){let o=e.trim();return o?o.startsWith("<")?e:`<p>${o}</p>`:"<p></p>"}function Mh(e){let o=e.replace(/<br\s*\/?>/gi,`
1
+ var An="waiting",fr="replied";import{createContext as Em,useContext as Pm,useMemo as bl}from"react";import{Box as Rm}from"@mui/material";var Bi="--app-mobile-font-offset";function uo(e,o=0){return`calc(${e}px + max(0px, var(${Bi}, 0px) - ${o}px))`}import{jsx as gl}from"react/jsx-runtime";var hl=Em({});function zm({config:e,children:o}){let t=bl(()=>e??{},[e]),n=t.mobileFontOffsetPx;return gl(hl.Provider,{value:t,children:n===void 0?o:gl(Rm,{sx:{display:"contents",[Bi]:`${n}px`},children:o})})}function So(){return Pm(hl)}function Ci(){let{buildFileUrl:e}=So();return bl(()=>e||((o,t)=>{let n=[];return t?.thumb&&n.push(`thumb=${t.thumb}`),t?.download&&n.push("download=1"),`/api/v1/files/${o}${n.length?`?${n.join("&")}`:""}`}),[e])}function Ln(){let{uploadMaxMb:e}=So();return e??50}import{useGlobalForm as kp}from"@ehfuse/forma";import kl from"@mui/icons-material/DoNotDisturbAltOutlined";import Tl from"@mui/icons-material/BookmarkBorderOutlined";import qm from"@mui/icons-material/LabelOutlined";import Am from"@mui/icons-material/FlagOutlined";import Lm from"@mui/icons-material/StarBorderOutlined";import Nm from"@mui/icons-material/FolderOutlined";import Fm from"@mui/icons-material/EventOutlined";import Hm from"@mui/icons-material/BuildOutlined";import Wm from"@mui/icons-material/LocalShippingOutlined";import $m from"@mui/icons-material/StorefrontOutlined";import Km from"@mui/icons-material/GroupsOutlined";import Um from"@mui/icons-material/LightbulbOutlined";import Vm from"@mui/icons-material/FavoriteBorderOutlined";import Gm from"@mui/icons-material/AssignmentOutlined";import Ym from"@mui/icons-material/HomeOutlined";import jm from"@mui/icons-material/WorkOutline";import Xm from"@mui/icons-material/SchoolOutlined";import Qm from"@mui/icons-material/LocalHospitalOutlined";import Jm from"@mui/icons-material/RestaurantOutlined";import Zm from"@mui/icons-material/LocalFloristOutlined";import eu from"@mui/icons-material/DirectionsCarOutlined";import ou from"@mui/icons-material/CampaignOutlined";import tu from"@mui/icons-material/SavingsOutlined";import nu from"@mui/icons-material/Inventory2Outlined";import ru from"@mui/icons-material/CleaningServicesOutlined";import yl from"@mui/icons-material/HandymanOutlined";import iu from"@mui/icons-material/LocalPhoneOutlined";import au from"@mui/icons-material/EmailOutlined";import lu from"@mui/icons-material/ShoppingCartOutlined";import su from"@mui/icons-material/BarChartOutlined";import cu from"@mui/icons-material/PrintOutlined";import mu from"@mui/icons-material/SecurityOutlined";import uu from"@mui/icons-material/AlarmOutlined";import du from"@mui/icons-material/AttachFileOutlined";import pu from"@mui/icons-material/PhotoCameraOutlined";import fu from"@mui/icons-material/ImageOutlined";import xu from"@mui/icons-material/MenuBookOutlined";import gu from"@mui/icons-material/EditOutlined";import bu from"@mui/icons-material/KeyOutlined";import hu from"@mui/icons-material/LockOutlined";import ku from"@mui/icons-material/LockOpenOutlined";import Tu from"@mui/icons-material/SettingsOutlined";import yu from"@mui/icons-material/CloudOutlined";import Su from"@mui/icons-material/WifiOutlined";import Bu from"@mui/icons-material/ComputerOutlined";import Cu from"@mui/icons-material/SmartphoneOutlined";import vu from"@mui/icons-material/TvOutlined";import Iu from"@mui/icons-material/AccessTimeOutlined";import _u from"@mui/icons-material/TimerOutlined";import wu from"@mui/icons-material/MapOutlined";import Du from"@mui/icons-material/PlaceOutlined";import Ou from"@mui/icons-material/NavigationOutlined";import Mu from"@mui/icons-material/FlightOutlined";import Eu from"@mui/icons-material/TrainOutlined";import Pu from"@mui/icons-material/DirectionsBusOutlined";import Ru from"@mui/icons-material/DirectionsBikeOutlined";import zu from"@mui/icons-material/DirectionsWalkOutlined";import qu from"@mui/icons-material/DirectionsRunOutlined";import Au from"@mui/icons-material/FitnessCenterOutlined";import Lu from"@mui/icons-material/SportsSoccerOutlined";import Nu from"@mui/icons-material/EmojiEventsOutlined";import Fu from"@mui/icons-material/CardGiftcardOutlined";import Hu from"@mui/icons-material/CakeOutlined";import Sl from"@mui/icons-material/CoffeeOutlined";import Wu from"@mui/icons-material/LocalPizzaOutlined";import $u from"@mui/icons-material/ShoppingBagOutlined";import Bl from"@mui/icons-material/CreditCardOutlined";import Ku from"@mui/icons-material/AccountBalanceOutlined";import Uu from"@mui/icons-material/AccountBalanceWalletOutlined";import Vu from"@mui/icons-material/AttachMoneyOutlined";import Gu from"@mui/icons-material/ReceiptLongOutlined";import Yu from"@mui/icons-material/CalculateOutlined";import ju from"@mui/icons-material/TrendingUpOutlined";import Xu from"@mui/icons-material/ListAltOutlined";import Qu from"@mui/icons-material/TaskAltOutlined";import Ju from"@mui/icons-material/DoneAllOutlined";import Zu from"@mui/icons-material/WarningAmberOutlined";import ed from"@mui/icons-material/InfoOutlined";import od from"@mui/icons-material/HelpOutlined";import td from"@mui/icons-material/SupportAgentOutlined";import nd from"@mui/icons-material/PersonOutlined";import rd from"@mui/icons-material/PersonAddOutlined";import id from"@mui/icons-material/BadgeOutlined";import ad from"@mui/icons-material/WbSunnyOutlined";import ld from"@mui/icons-material/DarkModeOutlined";import sd from"@mui/icons-material/LocalFireDepartmentOutlined";import cd from"@mui/icons-material/WaterDropOutlined";import md from"@mui/icons-material/BoltOutlined";import ud from"@mui/icons-material/AutorenewOutlined";import dd from"@mui/icons-material/ScienceOutlined";import pd from"@mui/icons-material/MedicalServicesOutlined";import fd from"@mui/icons-material/NotificationsOutlined";import xd from"@mui/icons-material/SendOutlined";import gd from"@mui/icons-material/LinkOutlined";import bd from"@mui/icons-material/PublicOutlined";import Cl from"@mui/icons-material/ApartmentOutlined";import hd from"@mui/icons-material/PlumbingOutlined";import kd from"@mui/icons-material/ElectricalServicesOutlined";import Td from"@mui/icons-material/ChatOutlined";import yd from"@mui/icons-material/DescriptionOutlined";import Sd from"@mui/icons-material/FactCheckOutlined";import Bd from"@mui/icons-material/RocketLaunchOutlined";import Cd from"@mui/icons-material/PaletteOutlined";import vd from"@mui/icons-material/MusicNoteOutlined";import Id from"@mui/icons-material/VideocamOutlined";import _d from"@mui/icons-material/ThumbUpOutlined";import wd from"@mui/icons-material/PushPinOutlined";import Dd from"@mui/icons-material/SearchOutlined";import Od from"@mui/icons-material/VisibilityOutlined";import Md from"@mui/icons-material/VerifiedOutlined";import Ed from"@mui/icons-material/TrackChangesOutlined";import Pd from"@mui/icons-material/ExtensionOutlined";import Rd from"@mui/icons-material/CodeOutlined";import zd from"@mui/icons-material/BugReportOutlined";import qd from"@mui/icons-material/SmartToyOutlined";import Ad from"@mui/icons-material/StorageOutlined";import Ld from"@mui/icons-material/QrCode2Outlined";import Nd from"@mui/icons-material/FileDownloadOutlined";import Fd from"@mui/icons-material/FileUploadOutlined";import Hd from"@mui/icons-material/MicOutlined";import Wd from"@mui/icons-material/HeadphonesOutlined";import $d from"@mui/icons-material/MovieOutlined";import Kd from"@mui/icons-material/SportsEsportsOutlined";import Ud from"@mui/icons-material/BrushOutlined";import Vd from"@mui/icons-material/ArchitectureOutlined";import Gd from"@mui/icons-material/EngineeringOutlined";import Yd from"@mui/icons-material/FactoryOutlined";import jd from"@mui/icons-material/AgricultureOutlined";import Xd from"@mui/icons-material/DirectionsBoatOutlined";import Qd from"@mui/icons-material/TwoWheelerOutlined";import Jd from"@mui/icons-material/HandshakeOutlined";import Zd from"@mui/icons-material/GavelOutlined";import ep from"@mui/icons-material/BalanceOutlined";import op from"@mui/icons-material/TranslateOutlined";import tp from"@mui/icons-material/PsychologyOutlined";import np from"@mui/icons-material/PetsOutlined";import rp from"@mui/icons-material/CelebrationOutlined";import ip from"@mui/icons-material/BeachAccessOutlined";import ap from"@mui/icons-material/AcUnitOutlined";import lp from"@mui/icons-material/ForestOutlined";import sp from"@mui/icons-material/LandscapeOutlined";import cp from"@mui/icons-material/HotelOutlined";import mp from"@mui/icons-material/LocalLaundryServiceOutlined";import up from"@mui/icons-material/ChairOutlined";import dp from"@mui/icons-material/LocalBarOutlined";import pp from"@mui/icons-material/LunchDiningOutlined";import fp from"@mui/icons-material/IcecreamOutlined";import xp from"@mui/icons-material/WorkspacePremiumOutlined";import gp from"@mui/icons-material/DiamondOutlined";import bp from"@mui/icons-material/VaccinesOutlined";var vi="bookmark",De="label",Ro="notifications",Nn="warning",Fn="#e53e3e",vl="none",Ii=[{key:vl,Icon:kl},{key:"label",Icon:qm},{key:"bookmark",Icon:Tl},{key:"flag",Icon:Am},{key:"star",Icon:Lm},{key:"folder",Icon:Nm},{key:"event",Icon:Fm},{key:"build",Icon:Hm},{key:"shipping",Icon:Wm},{key:"store",Icon:$m},{key:"groups",Icon:Km},{key:"idea",Icon:Um},{key:"heart",Icon:Vm},{key:"assignment",Icon:Gm},{key:"home",Icon:Ym},{key:"work",Icon:jm},{key:"school",Icon:Xm},{key:"hospital",Icon:Qm},{key:"restaurant",Icon:Jm},{key:"flower",Icon:Zm},{key:"car",Icon:eu},{key:"campaign",Icon:ou},{key:"savings",Icon:tu},{key:"inventory",Icon:nu},{key:"cleaning",Icon:ru},{key:"handyman",Icon:yl},{key:"phone",Icon:iu},{key:"email",Icon:au},{key:"cart",Icon:lu},{key:"chart",Icon:su},{key:"print",Icon:cu},{key:"security",Icon:mu},{key:"alarm",Icon:uu},{key:"attach",Icon:du},{key:"camera",Icon:pu},{key:"image",Icon:fu},{key:"book",Icon:xu},{key:"edit",Icon:gu},{key:"key",Icon:bu},{key:"lock",Icon:hu},{key:"unlock",Icon:ku},{key:"settings",Icon:Tu},{key:"cloud",Icon:yu},{key:"wifi",Icon:Su},{key:"computer",Icon:Bu},{key:"smartphone",Icon:Cu},{key:"tv",Icon:vu},{key:"clock",Icon:Iu},{key:"timer",Icon:_u},{key:"map",Icon:wu},{key:"place",Icon:Du},{key:"navigation",Icon:Ou},{key:"flight",Icon:Mu},{key:"train",Icon:Eu},{key:"bus",Icon:Pu},{key:"bike",Icon:Ru},{key:"walk",Icon:zu},{key:"run",Icon:qu},{key:"fitness",Icon:Au},{key:"soccer",Icon:Lu},{key:"trophy",Icon:Nu},{key:"gift",Icon:Fu},{key:"cake",Icon:Hu},{key:"coffee",Icon:Sl},{key:"pizza",Icon:Wu},{key:"bag",Icon:$u},{key:"card",Icon:Bl},{key:"bank",Icon:Ku},{key:"wallet",Icon:Uu},{key:"money",Icon:Vu},{key:"receipt",Icon:Gu},{key:"calculate",Icon:Yu},{key:"trending",Icon:ju},{key:"listalt",Icon:Xu},{key:"task",Icon:Qu},{key:"doneall",Icon:Ju},{key:"warning",Icon:Zu},{key:"info",Icon:ed},{key:"help",Icon:od},{key:"support",Icon:td},{key:"person",Icon:nd},{key:"personadd",Icon:rd},{key:"badge",Icon:id},{key:"sun",Icon:ad},{key:"moon",Icon:ld},{key:"fire",Icon:sd},{key:"water",Icon:cd},{key:"bolt",Icon:md},{key:"renew",Icon:ud},{key:"science",Icon:dd},{key:"medical",Icon:pd},{key:"notifications",Icon:fd},{key:"send",Icon:xd},{key:"link",Icon:gd},{key:"public",Icon:bd},{key:"apartment",Icon:Cl},{key:"plumbing",Icon:hd},{key:"electrical",Icon:kd},{key:"chat",Icon:Td},{key:"description",Icon:yd},{key:"factcheck",Icon:Sd},{key:"rocket",Icon:Bd},{key:"palette",Icon:Cd},{key:"music",Icon:vd},{key:"video",Icon:Id},{key:"thumbup",Icon:_d},{key:"pin",Icon:wd},{key:"search",Icon:Dd},{key:"eye",Icon:Od},{key:"verified",Icon:Md},{key:"target",Icon:Ed},{key:"extension",Icon:Pd},{key:"code",Icon:Rd},{key:"bug",Icon:zd},{key:"robot",Icon:qd},{key:"storage",Icon:Ad},{key:"qrcode",Icon:Ld},{key:"download",Icon:Nd},{key:"upload",Icon:Fd},{key:"mic",Icon:Hd},{key:"headphones",Icon:Wd},{key:"movie",Icon:$d},{key:"game",Icon:Kd},{key:"brush",Icon:Ud},{key:"architecture",Icon:Vd},{key:"engineering",Icon:Gd},{key:"factory",Icon:Yd},{key:"agriculture",Icon:jd},{key:"boat",Icon:Xd},{key:"motorcycle",Icon:Qd},{key:"handshake",Icon:Jd},{key:"gavel",Icon:Zd},{key:"balance",Icon:ep},{key:"translate",Icon:op},{key:"psychology",Icon:tp},{key:"pets",Icon:np},{key:"celebration",Icon:rp},{key:"beach",Icon:ip},{key:"snow",Icon:ap},{key:"forest",Icon:lp},{key:"mountain",Icon:sp},{key:"hotel",Icon:cp},{key:"laundry",Icon:mp},{key:"chair",Icon:up},{key:"bar",Icon:dp},{key:"burger",Icon:pp},{key:"icecream",Icon:fp},{key:"medal",Icon:xp},{key:"diamond",Icon:gp},{key:"vaccine",Icon:bp}],hp={cafe:Sl,payment:Bl,business:Cl,construction:yl};function ze(e){return e===vl?null:Ii.find(o=>o.key===e)?.Icon??hp[String(e??"")]??Tl}function xr(e){return ze(e)??kl}var _i={title:"",icon:De,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,is_open:!1,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",sprint_seq:0,story_points:0,event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:"",reminder:"none",priority:"medium",label_keys:[],note:"",content:"",checklist:[],tab_key:""},wi={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function Tp(e){let{formId:o="taskbox-create-form",initialValues:t,onValidate:n,onSubmit:r}=e;return kp({formId:o,initialValues:{..._i,...t},onValidate:n,onSubmit:r})}import{useGlobalFormaState as yp}from"@ehfuse/forma";var Il="taskbox-ui-state";function rt(){return yp({stateId:Il,initialValues:wi})}import{useMemo as Sp}from"react";import{useTheme as Bp}from"@mui/material";function fn(e,o){let t=Math.max(0,Math.min(1,o));if(t<=0)return"transparent";let n=e.trim().replace("#",""),r=n.length===3?n.split("").map(u=>u+u).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=Number.parseInt(r.slice(0,2),16),a=Number.parseInt(r.slice(2,4),16),s=Number.parseInt(r.slice(4,6),16);return`rgba(${i}, ${a}, ${s}, ${t})`}function _l(e,o){let t=Math.max(0,Math.min(1,o)),n=e.trim().replace("#",""),r=n.length===3?n.split("").map(m=>m+m).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=m=>Math.round(m+(255-m)*t),a=i(Number.parseInt(r.slice(0,2),16)),s=i(Number.parseInt(r.slice(2,4),16)),u=i(Number.parseInt(r.slice(4,6),16));return`#${[a,s,u].map(m=>m.toString(16).padStart(2,"0")).join("")}`}function Di(e,o,t){return t==="dark"?{accent:e,accentContrast:o,accentSoft:"#1d2b45",accentOnSurface:"#b3d1ff",danger:"#f87171",dangerSoft:"#3a1f22",success:"#4ade80",warning:"#fbbf24",textStrong:"#ffffff",textPrimary:"#e2e8f0",textSecondary:"#a3adbb",textMuted:"#77808d",textInverse:"#0f1216",surface:"#161a1f",surfaceSubtle:"#1e232a",surfaceHover:"#272d36",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:o,accentSoft:"#eef4ff",accentOnSurface:e,danger:"#e5484d",dangerSoft:"#fdebec",success:"#16a34a",warning:"#e8a33d",textStrong:"#000000",textPrimary:"#37352f",textSecondary:"#787774",textMuted:"#9a9a97",textInverse:"#ffffff",surface:"#ffffff",surfaceSubtle:"#fafaf9",surfaceHover:"#f4f4f2",border:"#e6e6e3",borderStrong:"#dedddb"}}function Cp(e,o){let t=o==="dark";return{bg:t?_l(e.accent,.45):e.accent,color:t?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function wl(e,o){return{...e,...o??{}}}function gr(e,o="light"){let t=o==="dark",n=Cp(e,o),r=e.accentOnSurface;return{mode:o,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:r,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:o==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHover,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:o==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:o==="dark"?400:700,minHeight:48,badge:{...n,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...n,borderRadius:4,width:34}},summary:{gaugeTrackColor:o==="dark"?e.borderStrong:"#ececea",gaugeBarColor:r,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:r,overdueColor:e.danger,textColor:e.textStrong},actionButton:{bg:"#2f80ed",color:"#ffffff",hoverBg:"#2470dd",bgImage:"linear-gradient(180deg, #5ba1f5 0%, #2f80ed 100%)",hoverBgImage:"linear-gradient(180deg, #4d95ee 0%, #2470dd 100%)"},tabs:{bg:o==="dark"?e.surfaceSubtle:e.surface,color:o==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:o==="dark"?e.border:e.borderStrong,selectedBg:o==="dark"?e.surfaceHover:e.textStrong,selectedColor:o==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:t?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:t?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:t?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:t?"#232a33":e.surface,borderColor:t?"#333c47":e.border,hoverBg:t?"#2b3441":e.surfaceHover,titleColor:e.textPrimary,subColor:e.textSecondary},timeline:{bg:e.surface,gridColor:e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,todayLineColor:e.accentOnSurface,barColor:e.accentOnSurface,overdueBarColor:e.danger},avatar:{ringColor:o==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:o==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function Oi(e,o){if(!o)return e;let t=o.mode??e.mode,r={...t===e.mode?e.colors:Di(e.colors.accent,e.colors.accentContrast,t),...o.colors??{}},i=gr(r,t),{groupHeader:a,...s}=o.table??{},{badge:u,...m}=o.board??{},{badge:d,...p}=a??{};return{mode:t,colors:r,table:{...i.table,...s,groupHeader:{...i.table.groupHeader,...p,badge:wl(i.table.groupHeader.badge,d)}},board:{...i.board,...m,badge:wl(i.board.badge,u)},summary:{...i.summary,...o.summary??{}},chip:{...i.chip,...o.chip??{}},actionButton:{...i.actionButton,...o.actionButton??{}},tabs:{...i.tabs,...o.tabs??{}},avatar:{...i.avatar,...o.avatar??{}},calendar:{...i.calendar,...o.calendar??{}},card:{...i.card,...o.card??{}},timeline:{...i.timeline,...o.timeline??{}}}}function vp(e={}){let{mode:o="light",accent:t="#2563eb",accentContrast:n="#ffffff",input:r}=e;return Oi(gr(Di(t,n,o),o),r)}function oe(){let e=Bp(),{theme:o}=So(),t=e.palette.primary.main,n=e.palette.primary.contrastText,r=e.palette.mode==="dark"?"dark":"light";return Sp(()=>Oi(gr(Di(t,n,r),r),o),[t,n,r,o])}import{useCallback as st,useEffect as os,useMemo as Gt,useRef as ex,useState as ct}from"react";import{Box as qo,Divider as ox,IconButton as tx,ListItemIcon as nx,Menu as ts,MenuItem as Rr}from"@mui/material";import ns from"@mui/icons-material/Add";import rx from"@mui/icons-material/ArrowUpward";import ix from"@mui/icons-material/ArrowDownward";import ax from"@mui/icons-material/KeyboardArrowDown";import lx from"@mui/icons-material/KeyboardArrowRight";import ta from"@mui/icons-material/Check";import sx from"@mui/icons-material/FilterList";import cx from"@mui/icons-material/InboxOutlined";import{Virtuoso as rs}from"react-virtuoso";import mx from"@ehfuse/overlay-scrollbar";import{DatePicker as ux}from"@ehfuse/mui-datetime-picker";function Ip(e){let o=String(e??"").trim().replace("T"," "),t=o.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(o)}function qe(e,o="YYYY-MM-DD"){let t=typeof e=="string"?Ip(e):e;if(!e||e===""||isNaN(t.getTime()))return"";let n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),a=n.toString().slice(-2);switch(o){case"YYYY-MM-DD":return`${n}-${r}-${i}`;case"YY.MM.DD":return`${a}.${r}.${i}`;case"MM/DD/YYYY":return`${r}/${i}/${n}`;case"DD.MM.YYYY":return`${i}.${r}.${n}`;case"YYYYMMDD":return`${n}${r}${i}`;default:return o.replace(/YYYY/g,n.toString()).replace(/YY/g,a).replace(/MM/g,r).replace(/DD/g,i)}}import{Box as Dl}from"@mui/material";import{jsx as wp,jsxs as Dp}from"react/jsx-runtime";var _p={high:{label:"\uB192\uC74C",dot:"#e5484d",bgcolor:"#fdebec",color:"#c4554d"},medium:{label:"\uC911\uAC04",dot:"#2f80ed",bgcolor:"#e3eefb",color:"#1d4f91"},low:{label:"\uB0AE\uC74C",dot:"#9a9a97",bgcolor:"#efefed",color:"#57564f"}};function zo({priority:e,small:o=!1,plain:t=!1}){let n=_p[e],r=oe(),i=r.mode==="dark",a=t||e==="low";return Dp(Dl,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:a?0:o?.9:1.25,py:a?0:o?.25:.5,borderRadius:.75,fontSize:o?11.5:13,fontWeight:500,bgcolor:a?"transparent":i?fn(n.dot,r.chip.darkBgAlpha):n.bgcolor,color:a?i?r.chip.plainColor:n.color:i?r.chip.darkTextSource==="fg"?n.color:n.dot:n.color,whiteSpace:"nowrap"},children:[wp(Dl,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:n.dot}}),n.label]})}import{Menu as Rp,MenuItem as zp}from"@mui/material";import qp from"@mui/icons-material/Check";function Uo(){return{}}var Mi=[{key:"always",name:"\uD56D\uC0C1"},{key:"often",name:"\uC790\uC8FC"},{key:"sometimes",name:"\uAC00\uB054"},{key:"once",name:"1\uD68C"},{key:"unable",name:"\uC7AC\uD604\uBD88\uAC00"}],Ei=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],Pi=[{key:"fixed",name:"\uC218\uC815\uC644\uB8CC"},{key:"duplicate",name:"\uC911\uBCF5"},{key:"cannot_reproduce",name:"\uC7AC\uD604\uBD88\uAC00"},{key:"by_design",name:"\uC0AC\uC591\uB300\uB85C"},{key:"wont_fix",name:"\uC548 \uACE0\uCE68"}];function Ol(e){return Mi.find(o=>o.key===e)?.name??""}function Ml(e){return Ei.find(o=>o.key===e)?.name??""}function br(e){return Pi.find(o=>o.key===e)?.name??""}function Ri(e,o=new Date){if(!e.is_event)return!1;let t=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;let n=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(n)){let i=new Date(`${t}T${n}:00`);return!Number.isNaN(i.getTime())&&i.getTime()<=o.getTime()}let r=new Date(`${t}T00:00:00`);return Number.isNaN(r.getTime())?!1:(r.setDate(r.getDate()+1),r.getTime()<=o.getTime())}function hr(e,o=new Date){return e.is_event?Ri(e,o):!!e.completed}var $t=[{key:"not_started",name:"\uC2DC\uC791\uC804",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"},{key:"in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"hold",name:"\uBCF4\uB958",bg:"#fbeee0",fg:"#8a5a2b",dot:"#d9730d"},{key:An,name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:fr,name:"\uD655\uC778\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"}],Wn=$t.filter(e=>e.key!==An&&e.key!==fr);function kr(e){return $t.find(o=>o.key===e)??$t[0]}var zi={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function po(e){if(e.is_notice)return El(e.status);if(e.is_bug&&e.completed){let o=br(e.resolution)||"\uC644\uB8CC";return{...zi,name:o}}return e.completed?zi:e.is_bug?Mp(e.status):kr(e.status)}var Op={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function $n(e){return Ri(e)?Op:null}var Hn=[{key:"notice_scheduled",name:"\uAC8C\uC2DC\uC608\uC815",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"notice_active",name:"\uAC8C\uC2DC\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"notice_closed",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}];function El(e){return Hn.find(o=>o.key===e)??Hn[1]}var qi="__closed__",Kt=[{key:"bug_received",name:"\uC811\uC218",bg:"#fdeaea",fg:"#9b2c2c",dot:"#e53e3e"},{key:"bug_confirmed",name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"bug_in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"bug_hold",name:"\uBCF4\uB958",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}],XC=[...Kt.filter(e=>e.key!=="bug_hold"),{key:qi,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...Kt.filter(e=>e.key==="bug_hold")];function Mp(e){return Kt.find(o=>o.key===e)??Kt[0]}function Pl(e){return e.is_notice?Hn:e.is_bug?Kt:Wn}function Ai(e){return e.status===An}var Ep={in_progress:0,[An]:1,not_started:2,hold:3,[fr]:4};function QC(e){return e.completed?9:Ep[String(e.status??"")]??2}function xn(e,o){let t=new Map(o.map(r=>[r.key,r])),n=(e.label_keys??[]).map(r=>t.get(r)).filter(r=>!!r);if(e.is_event){let r=$n({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return r?[r,...n]:n}return e.is_notice?String(e.status??"")==="notice_active"?n:[El(e.status),...n]:e.is_bug?[po({...e,is_notice:!1}),...n]:e.completed?[zi,...n]:[kr(e.status),...n]}function Rl(e){return{bg:`${e}1f`,fg:e,dot:e}}function Tr(e,o){return e.includes(o)?e.filter(t=>t!==o):[...e,o]}import{Box as yr}from"@mui/material";import{jsx as Kn,jsxs as Pp}from"react/jsx-runtime";function _e({option:e,small:o=!1}){let t=oe(),n=t.mode==="dark",r=e.key==="not_started";return Pp(yr,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:r?0:o?.9:1.25,py:r?0:o?.25:.5,borderRadius:1.25,fontSize:o?11.5:13,fontWeight:500,bgcolor:r?"transparent":n?fn(e.dot,t.chip.darkBgAlpha):e.bg,color:r?n?t.chip.plainColor:e.fg:n?t.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[Kn(yr,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function nv({task:e,statusOptions:o,small:t=!1}){let n=xn(e,o);return n.length===0?null:Kn(yr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Kn(_e,{option:r,small:t},r.key))})}function Mt({labelKeys:e,labelOptions:o}){let t=new Map(o.map(r=>[r.key,r])),n=e.map(r=>t.get(r)).filter(r=>!!r);return n.length===0?null:Kn(yr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Kn(_e,{option:r,small:!0},r.key))})}import{jsx as Li,jsxs as Ap}from"react/jsx-runtime";function Sr({anchorEl:e,value:o,options:t=$t,onSelect:n,onClose:r}){let i=Uo();return Li(Rp,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,...i,children:t.map(a=>Ap(zp,{onClick:()=>{n(a.key),r()},sx:{fontSize:14,minWidth:150,gap:1},children:[Li(_e,{option:a}),o===a.key?Li(qp,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},a.key))})}function Br(e,o){if(o<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===o)return!0;let t=(e.target_account_seqs??[]).filter(n=>n>0);return t.length===0||t.includes(o)}return Ni(e)?!0:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}function Ni(e){return e.is_notice||!e.is_open||e.completed||e.archived?!1:(e.manager_account_seq??0)===0}function Cr(e,o){return o<=0?!1:Ni(e)}function vr(e,o){return o<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||Ni(e)?!1:(e.receiver_account_seqs??[]).includes(o)||(e.author_account_seq??0)===o}function zl(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function it(e,o){return o<=0?!1:e.is_notice?(e.author_account_seq??0)===o:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}var pv=[119,121,141,143];var Fi=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uAE30\uD55C"},{value:"status",label:"\uADF8\uB8F9 : \uC0C1\uD0DC"},{value:"manager",label:"\uADF8\uB8F9 : \uCC45\uC784\uC790"},{value:"tab",label:"\uADF8\uB8F9 : \uD504\uB85C\uC81D\uD2B8"},{value:"none",label:"\uADF8\uB8F9 \uC5C6\uC74C"}];function Lp(e){let o=new Date(`${e}T00:00:00`);return o.setDate(o.getDate()+(6-o.getDay())),qe(o)}var Np=[{key:"overdue",label:"\uC9C0\uB0A8"},{key:"today",label:"\uC624\uB298"},{key:"this_week",label:"\uC774\uBC88 \uC8FC"},{key:"later",label:"\uC774\uD6C4"},{key:"no_due",label:"\uB9C8\uAC10 \uC5C6\uC74C"}];function Fp(e,o,t){let n=e.due_date.slice(0,10);return n?n<o?"overdue":n===o?"today":n<=t?"this_week":"later":"no_due"}function Hi(e,o,t,n=[],r=[],i="",a){let s=e.filter(l=>l.is_notice);if(s.length>0){let l=Hi(e.filter(c=>!c.is_notice),o,t,n,r,i,a);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:s},...l]}let u=new Map,m=(l,c)=>{let f=u.get(l);f?f.push(c):u.set(l,[c])},d;if(o==="due"){let l=Lp(t);for(let c of e)m(Fp(c,t,l),c);d=Np}else if(o==="status"){for(let l of e)m(kr(l.status).key,l);d=$t.map(l=>({key:l.key,label:l.name}))}else if(o==="tab"){for(let l of e)m(l.tab_key?.trim()||"__none__",l);d=[...n.filter(l=>!l.archived).map(l=>({key:l.key,label:l.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...n.filter(l=>l.archived).map(l=>({key:l.key,label:`${l.label} (\uBCF4\uAD00\uB428)`}))]}else if(a?.enabled){let l=Number(a.myAccountSeq??0),c=i.trim();for(let f of e){if(!(Number(f.manager_account_seq??0)>0||String(f.manager_name??"").trim()!=="")){m("__none__",f);continue}let h=l>0&&Number(f.manager_account_seq??0)===l||!!c&&String(f.manager_name??"").trim()===c;m(h?"__manager__":"__reference__",f)}d=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let h of e)m(String(h.manager_name??"").trim()||"__none__",h);let l=i.trim(),c=[...u.keys()].filter(h=>h!=="__none__").sort((h,x)=>{if(l){if(h===l)return-1;if(x===l)return 1}return h.localeCompare(x)}),f=!!l&&c.includes(l),w=c.filter(h=>h!==l);d=[...f?[{key:l,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...w.map(h=>({key:h,label:h}))]}let p=[];for(let l of d){let c=u.get(l.key);!c||c.length===0||p.push({key:l.key,label:l.label,tasks:c})}return p}import Hp from"@mui/icons-material/NotesOutlined";import Wp from"@mui/icons-material/AutorenewOutlined";import $p from"@mui/icons-material/CalendarTodayOutlined";import Kp from"@mui/icons-material/EventOutlined";import Up from"@mui/icons-material/PersonOutlineOutlined";import Al from"@mui/icons-material/PeopleAltOutlined";import Ki from"@mui/icons-material/CheckCircleOutlineOutlined";import Vp from"@mui/icons-material/FlagOutlined";import Gp from"@mui/icons-material/AccessTimeOutlined";import Yp from"@mui/icons-material/StickyNote2Outlined";import jp from"@mui/icons-material/ViewKanbanOutlined";import Xp from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as ao}from"react/jsx-runtime";var Qp={role_mark:"11px",completed:"44px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"120px",manager_name:"110px",receiver_names:"170px",targets:"170px",priority:"84px",ack:"104px",confirm:"100px",project:"150px",request:"100px",completed_time:"150px",note:"minmax(200px, 1.2fr)"};function Ir(e){return Ui(e).map(o=>Qp[o.id]).join(" ")}var Jp={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:ao(Gp,{sx:{fontSize:15}}),align:"center",sortable:!0},Zp={id:"ticket_no",label:"\uD2F0\uCF13",icon:ao(Xp,{sx:{fontSize:15}}),align:"center"},ef={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:ao(jp,{sx:{fontSize:15}}),projectFilter:!0},of={id:"targets",label:"\uB300\uC0C1\uC790",icon:ao(Al,{sx:{fontSize:15}})},ql={id:"priority",label:"\uC911\uC694\uB3C4",icon:ao(Vp,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},tf={id:"ack",label:"\uD655\uC778",icon:ao(Ki,{sx:{fontSize:15}}),align:"center",ackFilter:!0},nf={id:"confirm",label:"\uD655\uC778",icon:ao(Ki,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function Wi(e){let o=e.findIndex(n=>n.id==="receiver_names"||n.id==="targets"),t=o>=0?o+1:e.findIndex(n=>n.id==="note");return t<0?[...e,ql]:[...e.slice(0,t),ql,...e.slice(t)]}function Ui(e){let{showProject:o=!1,showManager:t=!0,showActions:n=!0,showRequest:r=!0,notice:i=!1,bug:a=!1,confirmMode:s="none"}=e??{},u=p=>{if(!a)return p;let l=p.filter(w=>w.id!=="note"),c=l.findIndex(w=>w.id==="completed"),f=c>=0?c+1:0;return[...l.slice(0,f),Zp,...l.slice(f)]};if(i)return u(Wi($i.filter(p=>!["manager_name","receiver_names","request"].includes(p.id)).flatMap(p=>p.id==="due_date"?[p,of]:p.id==="note"?[tf,p]:[p])));let m=t?$i:$i.filter(p=>p.id!=="manager_name");if(n)r||(m=m.filter(p=>p.id!=="request"));else{m=m.filter(l=>l.id!=="request");let p=m.findIndex(l=>l.id==="note");m=[...m.slice(0,p),Jp,...m.slice(p)]}if(s==="action"){let p=m.findIndex(l=>l.id==="note");m=[...m.slice(0,p),nf,...m.slice(p)]}if(!o)return u(Wi(m));let d=m.findIndex(p=>p.id==="receiver_names");return u(Wi([...m.slice(0,d+1),ef,...m.slice(d+1)]))}var $i=[{id:"role_mark",label:"",icon:null},{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:ao(Hp,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:ao(Wp,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC790",icon:ao($p,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uAE30\uD55C",icon:ao(Kp,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:ao(Up,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:ao(Al,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:ao(Ki,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:ao(Yp,{sx:{fontSize:15}})}];import{Button as Ll,ClickAwayListener as lf,Dialog as sf,Paper as cf,Popper as mf,Typography as uf,Box as df}from"@mui/material";import{useMediaQuery as rf,useTheme as af}from"@mui/material";function He(){let{isMobile:e}=So(),o=af(),t=rf(o.breakpoints.up("lg"));return e!==void 0?e:!t}import{Fragment as ff,jsx as Et,jsxs as Nl}from"react/jsx-runtime";function pf({title:e,content:o,confirmText:t,cancelText:n,titleFontSize:r,actionFontSize:i,actionMinHeight:a,onCancel:s,onConfirm:u}){return Nl(ff,{children:[Et(uf,{component:"div",sx:{fontSize:r,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),o,Nl(df,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[Et(Ll,{size:"medium",variant:"outlined",color:"inherit",onClick:s,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:n}),Et(Ll,{size:"medium",variant:"contained",color:"primary",onClick:u,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:t})]})]})}function Ue({open:e,anchorEl:o,title:t="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:n,confirmText:r="\uD655\uC778",cancelText:i="\uCDE8\uC18C",placement:a="top",minWidth:s=160,minHeight:u,titleFontSize:m=17,actionFontSize:d=16,actionMinHeight:p=44,zIndex:l=1300,onCancel:c,onConfirm:f}){let w=He(),h=Et(pf,{title:t,content:n,confirmText:r,cancelText:i,titleFontSize:m,actionFontSize:d,actionMinHeight:p,onCancel:c,onConfirm:f});return w?Et(sf,{open:e,onClose:c,sx:{zIndex:l},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:h}):Et(mf,{open:e,anchorEl:o,placement:a,sx:{zIndex:l},children:Et(lf,{onClickAway:c,children:Et(cf,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:s,minHeight:u,justifyContent:u?"space-between":"flex-start"},onClick:x=>x.stopPropagation(),onMouseDown:x=>x.stopPropagation(),children:h})})})}import{useEffect as If,useRef as _f,useState as Gl}from"react";import{Box as be,Button as wf,Checkbox as Df,Tooltip as Yi}from"@mui/material";import Of from"@mui/icons-material/AlarmOutlined";import Mf from"@mui/icons-material/CheckCircle";import Ef from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as xf,useState as Fl}from"react";import{Avatar as Hl}from"@mui/material";import gf from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Gi}from"react/jsx-runtime";var Vi=new Set,Wl=e=>e.startsWith("data:")||e.startsWith("blob:");function Vo({src:e,avatarSx:o,iconFontSize:t=40}){let[n,r]=Fl(()=>e?Wl(e)||Vi.has(e):!1),[i,a]=Fl(!1),s={position:"relative",overflow:"hidden",borderRadius:"15px"},u=o?[s,...Array.isArray(o)?o:[o]]:s;return xf(()=>{a(!1),r(e?Wl(e)||Vi.has(e):!1)},[e]),!e||i?Gi(Hl,{sx:u,children:Gi(gf,{sx:{fontSize:t}})}):Gi(Hl,{src:e,imgProps:{onLoad:()=>{Vi.add(e),r(!0)},onError:()=>a(!0),style:n?void 0:{opacity:0}},sx:u})}var bf=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),_r=(e,o)=>{if(!o||!o.trim())return[{text:e,highlight:!1}];try{let t=bf(o.trim()),n=new RegExp(`(${t})`,"gi");return e.split(n).map(i=>i.toLowerCase()===o.trim().toLowerCase()?{text:i,highlight:!0}:{text:i,highlight:!1}).filter(i=>i.text)}catch{return[{text:e,highlight:!1}]}};var hf=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Go(e){let o=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(o))return"";let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?"":`${o.slice(2).replaceAll("-",".")} (${hf[t.getDay()]})`}function at(e){let o=String(e??"").trim(),[t,n=""]=o.split(" "),r=Go(t);return r?n?`${r} ${n.slice(0,5)}`:r:""}import{Box as $l,Tooltip as kf}from"@mui/material";import{jsx as wr}from"react/jsx-runtime";var gn=[{bgcolor:"#dbe7ff",color:"#24408e"},{bgcolor:"#ffe4d6",color:"#8a4b21"},{bgcolor:"#dcf2e3",color:"#1f6b3a"},{bgcolor:"#f3e3f7",color:"#6d2f80"},{bgcolor:"#fdf0cf",color:"#8a6d1d"},{bgcolor:"#e0f0f6",color:"#1d5f78"},{bgcolor:"#efe6dc",color:"#6b4a2b"}];function fo({names:e,size:o=22,ringFirst:t=!1,avatarSrcByName:n}){let r=oe();return wr($l,{sx:{display:"flex",alignItems:"center"},children:e.map((i,a)=>{let s=t&&a===0;return wr(kf,{title:s?`\uCC45\uC784\uC790 \xB7 ${i}`:i,arrow:!0,children:wr($l,{sx:{ml:a===0?0:"-7px",zIndex:a,borderRadius:"50%",border:`2px solid ${s?r.avatar.ringColor:r.avatar.separatorColor}`,display:"inline-flex",...r.avatar.sx},children:wr(Vo,{src:n?.get(i)??"",avatarSx:{width:o,height:o,fontSize:Math.round(o/2),borderRadius:"50%",...gn[a%gn.length]},iconFontSize:Math.round(o*.6)})})},`${i}-${a}`)})})}import{Box as Kl,Button as Vl}from"@mui/material";import Tf from"@mui/icons-material/CheckCircle";import{Fragment as Bf,jsx as Un,jsxs as Ul}from"react/jsx-runtime";function yf(e){let o=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:o?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:o?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function Sf(e){return{minWidth:0,px:1.25,py:.25,fontSize:13,whiteSpace:"nowrap",color:e.actionButton.color,backgroundColor:e.actionButton.bg,backgroundImage:e.actionButton.bgImage,boxShadow:"none","&:hover":{backgroundColor:e.actionButton.hoverBg,backgroundImage:e.actionButton.hoverBgImage,boxShadow:"none"},...e.actionButton.sx}}function bn({onClick:e,children:o,fullWidth:t=!1,sx:n}){let r=oe();return Un(Vl,{size:"small",variant:"contained",color:"inherit",fullWidth:t,sx:[Sf(r),...Array.isArray(n)?n:n?[n]:[]],onClick:i=>{i.stopPropagation(),e(i)},children:o})}function hn({canConfirm:e,count:o,total:t,myConfirmed:n=!1,onConfirm:r,onShowList:i}){let a=oe(),s=yf(a);return e?Un(bn,{onClick:()=>r(),children:"\uD655\uC778"}):Ul(Vl,{size:"small",variant:"outlined",color:"inherit",sx:s,onClick:u=>{u.stopPropagation(),i(u.currentTarget)},children:[n?Un(Tf,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,Un(Kl,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:t>0&&o>=t?"\uC644\uB8CC":Ul(Bf,{children:[o,Un(Kl,{component:"span",sx:{mx:.15},children:"/"}),t]})})]})}import{SvgIcon as Cf}from"@mui/material";import{jsx as Dr,jsxs as vf}from"react/jsx-runtime";function Or({sx:e,...o}){return vf(Cf,{viewBox:"0 0 48 48",...o,sx:{fill:"none",...e},children:[Dr("path",{d:"M24,6C13.23,6,4.5,12.93,4.5,21.46c0,5.39,3.5,10.13,8.79,12.89l-1.76,7.06a.46.46,0,0,0,.68.51L21,36.7a24,24,0,0,0,3,.2c10.77,0,19.5-6.91,19.5-15.44S34.77,6,24,6Z",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Dr("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Dr("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Dr("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as Xi,jsx as U,jsxs as kn}from"react/jsx-runtime";function Yl(e){let o=String(e??"").trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function ji(e,o){let t=String(e??"").trim()||"-";return _r(t,o).map((n,r)=>U("span",{className:n.highlight?"font-semibold text-blue-600":void 0,children:n.text},`${n.text}-${r}`))}function Mr({names:e,searchText:o,avatarSrcByName:t,emphasize:n=!1}){let r=e.filter(i=>i.trim());if(r.length===0)return null;if(r.length===1){let i=r[0]??"";return kn(Xi,{children:[U(Vo,{src:t?.get(i)??"",avatarSx:{width:24,height:24,borderRadius:"50%",...gn[0]},iconFontSize:15}),U(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{fontWeight:500,color:"#2f80ed"}:{}},children:ji(i,o)})]})}return U(fo,{names:r,size:22,avatarSrcByName:t})}function jl({display:e,summary:o,searchText:t,avatarSrcByName:n}){if(!e||e.kind==="everyone")return U(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:r,individualNames:i}=e;if(r.length===0)return U(Mr,{names:i,searchText:t,avatarSrcByName:n});let a=[...r,...i],s=a.join(", ");return a.length>2?U(Yi,{title:s,arrow:!0,children:U(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${a[0]}, ${a[1]} \uC678 ${a.length-2}\uBA85`})}):U(Yi,{title:s,arrow:!0,children:kn(be,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[U(be,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.join(", ")+(i.length>0?",":"")}),i.length>0?U(Mr,{names:i,searchText:t,avatarSrcByName:n}):null]})})}function Xl({task:e,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:r=0,todayStr:i,showProject:a=!1,showManager:s=!0,showActions:u=!0,showRequest:m=!0,confirmMode:d="none",bugMode:p=!1,confirmInfo:l,onConfirmTask:c,projectLabel:f="",projectIcon:w="",onProjectClick:h,onRequestToggleCompleted:x,onDateClick:g,onChangeNote:I,onMemberClick:b,onClaimClick:O,onVolunteerClick:_,onStatusClick:P,onOpenDetail:C,onTaskContextMenu:F,hideBottomBorder:D=!1,completeLocked:Z=!1,unread:S=!1,notice:k=!1,noticeReadOnly:H=!1,noteLocked:K=!1,targetSummary:G="",targetDisplay:R,onArchiveTask:te,ackInfo:ne,onAckConfirm:fe,onAckListClick:Ie,onPriorityClick:Re}){let[re,le]=Gl(!1),[y,B]=Gl(""),q=_f(null);If(()=>{if(!re)return;let $=j=>{let Me=q.current;Me&&(j.target instanceof Node&&Me.contains(j.target)||Me.blur())};return document.addEventListener("mousedown",$,!0),document.addEventListener("touchstart",$,!0),()=>{document.removeEventListener("mousedown",$,!0),document.removeEventListener("touchstart",$,!0)}},[re]);let N=[e.manager_account_seq??0,...e.receiver_account_seqs??[]].some($=>$>0&&$!==(e.author_account_seq??0)),W=H,se=r>0&&!e.is_notice&&!e.is_event&&(e.manager_account_seq??0)===r,z=W||!!e.is_notice,Y=oe(),ke=!!O&&Cr(e,r),M=!!_&&vr(e,r),ie=z&&!zl(e),xe=e.is_notice?U(hn,{canConfirm:!!ne?.canAck,count:ne?.count??0,total:ne?.total??0,myConfirmed:!!ne?.acked,onConfirm:()=>fe?.(e),onShowList:$=>Ie?.(e,$)}):null,je=!e.is_notice&&!!e.due_date&&e.due_date.slice(0,10)<=i?"#e5484d":"#2f80ed";return kn(be,{onContextMenu:$=>F(e,$),sx:{display:"grid",gridTemplateColumns:Ir({showProject:a,showManager:s,showActions:u,showRequest:m,notice:k,confirmMode:d,bug:p}),minHeight:48,fontSize:15,bgcolor:Y.table.rowBg,color:Y.table.rowColor,borderBottom:D?"none":`1px solid ${Y.table.rowBorderColor}`,"&:hover":{bgcolor:Y.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${Y.table.rowBorderColor}`},"& > .cell:first-of-type":{px:0,borderRight:"none"},"& > .cell:nth-of-type(2)":{pl:1.5,pr:2},"& > .cell:last-child":{borderRight:"none",pr:2}},children:[U(be,{className:"cell",children:se?U(be,{sx:{width:3,alignSelf:"stretch",my:.5,ml:.5,bgcolor:"#2f80ed",borderRadius:1.5}}):null}),U(be,{className:"cell",sx:{justifyContent:"center"},children:!W&&!Z?U(Yi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${at(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:U(Df,{checked:e.completed,icon:U(Ef,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:U(Mf,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:$=>$.stopPropagation(),onChange:($,j)=>x({anchorEl:$.currentTarget,task:e,nextCompleted:j}),sx:{p:.5}})}):null}),p?U(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:e.ticket_no||"-"}):null,kn(be,{className:"cell",onClick:()=>C(e),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}},children:[(()=>{let $=ze(e.icon||(e.is_notice?Ro:De));if(!$)return null;let j=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return U($,{sx:{fontSize:18,flexShrink:0,color:j}})})(),U(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:e.completed?400:Y.table.rowTitleFontWeight,color:e.completed?Y.colors.textMuted:Y.table.rowTitleColor,textDecoration:e.completed?"line-through":"none"},children:ji(e.title,n)}),(e.comment_count??e.comments?.length??0)>0?U(Or,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,U(be,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:U(Mt,{labelKeys:e.label_keys??[],labelOptions:o})}),S?U(be,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,hr(e)&&!e.archived&&!W&&te?U(wf,{size:"small",variant:"outlined",color:"inherit",sx:{ml:"auto",flexShrink:0,minWidth:0,px:1.25,py:.25,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},onClick:$=>{$.stopPropagation(),te(e)},children:"\uBCF4\uAD00"}):null]}),(()=>{let $=W||!!e.is_event||!!e.completed;return U(be,{className:"cell",onClick:$?void 0:j=>P(e,j.currentTarget),sx:{py:.5,justifyContent:"center",...$?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:e.is_event?(()=>{let j=$n(e);return j?U(_e,{option:j}):null})():U(_e,{option:po(e)})})})(),U(be,{className:"cell",onClick:W?void 0:$=>g(e,"start_date",$.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...W?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:Yl(e.start_date)}),U(be,{className:"cell",onClick:W?void 0:$=>g(e,"due_date",$.currentTarget),sx:{justifyContent:"center",gap:.5,color:je,fontWeight:500,whiteSpace:"nowrap",...W?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:e.due_date?kn(Xi,{children:[Yl(e.due_date),U(Of,{sx:{fontSize:15}})]}):null}),k?U(be,{className:"cell",onClick:W?void 0:()=>b(e,"targets"),sx:{gap:.75,...W?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:U(jl,{display:R,summary:G,searchText:n,avatarSrcByName:t})}):null,!k&&e.is_notice?U(be,{className:"cell",onClick:W?void 0:()=>b(e,"targets"),sx:{gridColumn:s?"span 2":"auto",gap:.75,...W?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:U(jl,{display:R,summary:G,searchText:n,avatarSrcByName:t})}):null,!k&&!e.is_notice&&!e.is_event&&s?U(be,{className:"cell",onClick:ie?void 0:()=>b(e,"manager"),sx:{gap:.75,...ke||M?{justifyContent:"center"}:{},...ie?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:ke?U(bn,{onClick:$=>O?.(e,$.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):M?U(bn,{onClick:$=>_?.(e,$.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):U(Mr,{names:e.manager_name?[e.manager_name]:[],searchText:n,avatarSrcByName:t,emphasize:se})}):null,!k&&!e.is_notice?U(be,{className:"cell",onClick:z?void 0:()=>b(e,"receivers"),sx:{gridColumn:e.is_event&&s?"span 2":"auto",gap:.75,...z?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:U(Mr,{names:e.receiver_names,searchText:n,avatarSrcByName:t})}):null,U(be,{className:"cell",onClick:W?void 0:$=>Re?.(e,$.currentTarget),sx:{py:.5,justifyContent:"center",...W?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:U(zo,{priority:e.priority,plain:!0})}),a?U(be,{className:"cell",onClick:W?void 0:$=>h?.(e,$.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...W?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:f?kn(Xi,{children:[(()=>{let $=ze(w);return $?U($,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),U(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f})]}):null}):null,k?U(be,{className:"cell",sx:{justifyContent:"center"},children:xe}):null,!k&&u&&m?U(be,{className:"cell",sx:{justifyContent:"center"},children:e.is_notice?xe:N?U(hn,{canConfirm:!!l?.canConfirm,count:l?.count??0,total:l?.total??0,myConfirmed:!!l?.myTime,onConfirm:()=>c?.(e),onShowList:$=>Ie?.(e,$)}):null}):null,!k&&d==="action"?U(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:Y.table.rowSubColor},children:e.is_notice?xe:l&&l.total>0?U(hn,{canConfirm:!!l.canConfirm,count:l.count,total:l.total,myConfirmed:!!l.myTime,onConfirm:()=>c?.(e),onShowList:$=>Ie?.(e,$)}):"-"}):null,!k&&!u?U(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:Y.table.rowSubColor},children:e.completed_time||"-"}):null,p?null:U(be,{className:"cell",onClick:()=>{!K&&!re&&(B(e.note),le(!0))},sx:{color:"#6f6f6c",cursor:K?"default":"text"},children:re?U(be,{component:"input",ref:q,autoFocus:!0,spellCheck:!1,value:y,onChange:$=>B($.target.value),onBlur:()=>{le(!1),y.trim()!==e.note&&I(e.seq,y)},onKeyDown:$=>{$.key==="Enter"&&$.target.blur(),$.key==="Escape"&&(B(e.note),le(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:Y.table.rowTitleColor,caretColor:Y.table.rowTitleColor,p:0,m:0}}):U(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.note?ji(e.note,n):""})})]})}import{useState as Pf}from"react";import{Box as Vn,Button as Ql,ButtonBase as Rf,Dialog as zf,Divider as Jl,Menu as qf,MenuItem as Af,Popover as Lf}from"@mui/material";import Nf from"@mui/icons-material/ChevronRight";import Ff from"@mui/icons-material/Check";import Hf from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as Wf}from"@ehfuse/mui-datetime-picker";import{Fragment as Uf,jsx as _o,jsxs as Ut}from"react/jsx-runtime";var $f=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],Zl=[{value:"day_before",label:"1\uC77C \uC804"},{value:"two_days_before",label:"2\uC77C \uC804"},{value:"three_days_before",label:"3\uC77C \uC804"},{value:"week_before",label:"1\uC8FC\uC77C \uC804"}],es=[{value:"none",label:"\uC5C6\uC74C"},...$f,...Zl];function Qi(e){return e?es:[{value:"none",label:"\uC5C6\uC74C"},...Zl]}function Ji(e){return e==="same_day"?"\uB2F9\uC77C":es.find(o=>o.value===e)?.label??"\uC5C6\uC74C"}function Kf(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function Pt({anchorEl:e,open:o,date:t,reminder:n,hideReminder:r=!1,centered:i=!1,onClose:a,onDateChange:s,onReminderChange:u}){let[m,d]=Pf(null),p=Uo(),l=Ut(Vn,{sx:{width:300,maxWidth:"100%"},children:[_o(Vn,{sx:{height:320},children:_o(Wf,{selectedDate:Kf(t),onSelect:c=>{s(qe(c)),a()},onClose:a,showFooter:!1,autoApply:!0})}),r?null:Ut(Uf,{children:[_o(Jl,{sx:{borderColor:"#e6e6e3"}}),Ut(Rf,{onClick:c=>d(c.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Ut(Vn,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[_o(Hf,{sx:{fontSize:17,color:"#9a9a97"}}),"\uB9AC\uB9C8\uC778\uB354"]}),Ut(Vn,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[Ji(n),_o(Nf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),_o(qf,{transitionDuration:0,anchorEl:m,open:!!m,onClose:()=>d(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...p,children:Qi(!1).map(c=>Ut(Af,{selected:c.value===n,onClick:()=>{u(c.value),d(null)},sx:{fontSize:14,minWidth:120,justifyContent:"space-between",gap:1},children:[c.label,c.value===n?_o(Ff,{sx:{fontSize:16,color:"#2f80ed"}}):null]},c.value))})]}),_o(Jl,{sx:{borderColor:"#e6e6e3"}}),Ut(Vn,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[_o(Ql,{size:"small",onClick:()=>{s(qe(new Date)),a()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),_o(Ql,{size:"small",onClick:a,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return i?_o(zf,{open:o,onClose:a,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:l}):_o(Lf,{transitionDuration:0,open:o,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{borderRadius:2,boxShadow:"0 8px 24px rgba(0,0,0,0.14)"}}},children:l})}import{useEffect as Yf,useState as ea}from"react";import{Box as Vt,Button as jf,Switch as Xf}from"@mui/material";import{FormDialog as Qf}from"@ehfuse/mui-form-dialog";import{ClearTextField as Jf}from"@ehfuse/mui-form-controls";import{ErrorAlert as Zf}from"@ehfuse/alerts";import{Box as Vf,ButtonBase as Gf}from"@mui/material";import{jsx as Zi}from"react/jsx-runtime";function Er({value:e,onChange:o}){return Zi(Vf,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:Ii.map(({key:t,Icon:n})=>{let r=t===e;return Zi(Gf,{onClick:()=>o(t),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:r?"2px solid #2563eb":"1px solid #dedddb",bgcolor:r?"#eef4ff":"#fff",color:r?"#1e3a8a":"#787774","&:hover":{bgcolor:r?"#eef4ff":"#f4f4f2"}},children:Zi(n,{sx:{fontSize:20}})},t)})})}import{jsx as lt,jsxs as oa}from"react/jsx-runtime";function Pr({open:e,title:o="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:t="",initialIcon:n=vi,confirmText:r="\uCD94\uAC00",initialUseSprints:i=!1,onClose:a,onSubmit:s}){let[u,m]=ea(""),[d,p]=ea(vi),[l,c]=ea(!1);Yf(()=>{e&&(m(t),p(n),c(i))},[e]);let f=()=>{let h=u.trim();if(!h){Zf("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}s(h,d,l),a()};return lt(Qf,{open:e,onClose:a,maxWidth:"xs",title:o,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:oa(Vt,{children:[lt(Jf,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:u,onChange:h=>m(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),f())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),lt(Vt,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),lt(Vt,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:lt(Er,{value:d,onChange:p})}),oa(Vt,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[oa(Vt,{children:[lt(Vt,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),lt(Vt,{sx:{fontSize:12.5,color:"#9a9a97"},children:"\uBAA9\uD45C \uBC30\uC815\uC73C\uB85C \uBC18\uBCF5 \uC8FC\uAE30\uB97C \uAD00\uB9AC\uD569\uB2C8\uB2E4(\uAC1C\uBC1C\uD300\uC6A9)"})]}),lt(Xf,{checked:l,onChange:(h,x)=>c(x)})]})]})}],actions:{showCancelButton:!0,right:lt(jf,{variant:"contained",onClick:f,children:r})}})}import{jsx as de,jsxs as Yo}from"react/jsx-runtime";function dx(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function is({tasks:e,statusOptions:o,avatarSrcByName:t,searchText:n,todayStr:r,sortBy:i,sortDirection:a,onSort:s,onRequestReply:u,onToggleCompleted:m,onChangeTaskDate:d,onChangeTaskReminder:p,groupBy:l,collapsedGroupKeys:c,customTabs:f,onToggleGroup:w,hideCompleted:h=!1,onAddInGroup:x,canAddInGroup:g,renderGroupSummary:I,renderGroupTitleSummary:b,onChangeTaskProject:O,onAddProject:_,onChangeNote:P,onMemberClick:C,onClaimTask:F,onChangeTaskStatus:D,onOpenDetail:Z,onTaskContextMenu:S,onMemberFilterClick:k,activeMemberFilters:H=[],onStatusFilterClick:K,statusFilterActive:G=!1,onAckFilterClick:R,ackFilterActive:te=!1,onProjectFilterClick:ne,projectFilterActive:fe=!1,onPriorityFilterClick:Ie,priorityFilterActive:Re=!1,columns:re,getConfirmInfo:le,onConfirmTask:y,myAccountSeq:B=0,currentUserName:q="",groupManagerByMyRole:N=!1,allowManagerVolunteer:W=!0,noticeAdmin:se=!1,getTargetSummary:z,getTargetDisplay:Y,onArchiveTask:ke,isTaskUnread:M,getAckInfo:ie,onAckConfirm:xe,onAckListClick:Ae,onChangeTaskPriority:je,onEndReached:$}){let j=oe(),Me=Gt(()=>({showManager:!0,showActions:!0,showRequest:!0,...re}),[re]),vo=Me.showManager??!0,Ct=Me.showActions??!0,ot=Me.showRequest??!0,vt=Me.confirmMode??"none",It=Me.notice??!1,Po=Me.bug??!1,_t=l!=="none",tt=Gt(()=>_t?Hi(e,l,r,f,o,q,{enabled:N,myAccountSeq:B}):[],[_t,e,l,r,f,o,q,N,B]),io=Gt(()=>h?tt.map(T=>({section:T,visibleTasks:T.tasks.filter(J=>!J.completed)})).filter(T=>T.visibleTasks.length>0):tt.map(T=>({section:T,visibleTasks:T.tasks})),[tt,h]),Qe=Gt(()=>h?e.filter(T=>!T.completed):e,[e,h]),Ko=Gt(()=>new Set(c),[c]),To=Me.showProject??(!It&&l!=="tab"),Rn=Gt(()=>Ui({...Me,showProject:To}),[Me,To]),Ce=Ir({...Me,showProject:To}),v=Gt(()=>{let T=new Map;for(let J of f)T.set(J.key,{label:J.archived?`${J.label} (\uBCF4\uAD00\uB428)`:J.label,icon:J.icon});return T},[f]),L=ex(null),[X,ae]=ct(null),ge=e.length>0;os(()=>{if(!ge){ae(null);return}let T=window.requestAnimationFrame(()=>{ae(L.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(T)},[ge]);let[E,mo]=ct(!1);os(()=>{if(!X)return;let T=()=>mo(X.scrollHeight>X.clientHeight);T();let J=new ResizeObserver(T);return J.observe(X),X.firstElementChild&&J.observe(X.firstElementChild),()=>J.disconnect()},[X]);let[ue,Xe]=ct(null),[Ke,Je]=ct(null),[wt,Dt]=ct(null),[yo,Ot]=ct(null),[Ti,cl]=ct(!1),[yi,ml]=ct(null),zn=yi?e.find(T=>T.seq===yi.taskSeq)??null:null,[ur,Si]=ct(null),dr=ur?e.find(T=>T.seq===ur.taskSeq)??null:null,ul=st((T,J)=>{Si({anchorEl:J,taskSeq:T.seq})},[]),dl=st((T,J)=>{ml({anchorEl:J,taskSeq:T.seq})},[]),_m=st((T,J)=>{if(!J)return;s(T,i===T&&a==="asc"?"desc":"asc")},[s,i,a]),pl=st((T,J,ye)=>{Xe({anchorEl:ye,taskSeq:T.seq,field:J,date:T[J],reminder:T.reminder,completed:T.completed})},[]),fl=st((T,J)=>{Ot({anchorEl:J,task:T})},[]),wm=st(T=>{ue&&(d(ue.taskSeq,ue.field,qe(T)),Xe(null))},[ue,d]),Dm=st(T=>{ue&&(d(ue.taskSeq,ue.field,T),Xe(J=>J&&{...J,date:T}))},[ue,d]),Om=st(T=>{ue&&(p(ue.taskSeq,T),Xe(J=>J&&{...J,reminder:T}))},[ue,p]),xl=st((T,J=!1)=>de(Xl,{hideBottomBorder:J,task:T,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:B,todayStr:r,showProject:To,showManager:vo,showActions:Ct,showRequest:ot,confirmMode:vt,confirmInfo:T.is_notice?void 0:le?.(T),onConfirmTask:y,projectLabel:v.get(T.tab_key??"")?.label??"",projectIcon:v.get(T.tab_key??"")?.icon??"",onProjectClick:fl,onRequestReply:u,onRequestToggleCompleted:Je,onDateClick:pl,onChangeNote:P,onMemberClick:C,onClaimClick:F?(ye,Io)=>Dt({anchorEl:Io,taskSeq:ye.seq,title:ye.title,kind:"claim"}):void 0,onVolunteerClick:W?(ye,Io)=>Dt({anchorEl:Io,taskSeq:ye.seq,title:ye.title,kind:"volunteer"}):void 0,onStatusClick:dl,onOpenDetail:Z,onTaskContextMenu:S,notice:It,bugMode:Po,noticeReadOnly:!it(T,B),noteLocked:T.is_notice?!Br(T,B):!it(T,B),completeLocked:T.is_event?!0:T.is_notice?(T.author_account_seq??0)!==B:(T.author_account_seq??0)!==B&&(T.manager_account_seq??0)!==B,targetSummary:T.is_notice?z?.(T):void 0,targetDisplay:T.is_notice?Y?.(T):void 0,onArchiveTask:ke,unread:M?.(T)??!1,ackInfo:T.is_notice?ie?.(T):void 0,onAckConfirm:xe,onAckListClick:Ae,onPriorityClick:ul},T.seq),[n,o,t,r,To,vo,Ct,ot,vt,le,y,It,Po,B,se,z,Y,ke,M,ie,xe,Ae,ul,v,fl,u,pl,P,C,F,dl,Z,S]);return Yo(qo,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${j.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:j.table.bg,color:j.table.rowColor,...j.table.sx},children:[de(qo,{sx:{display:"grid",gridTemplateColumns:Ce,borderBottom:`1px solid ${j.table.borderColor}`,flexShrink:0,bgcolor:j.table.headerBg,"& > *":{borderRight:`1px solid ${j.table.rowBorderColor}`},"& > *:first-of-type":{px:0,borderRight:"none"},"& > *:nth-of-type(2)":{pl:1.5,pr:2},"& > *:last-child":{borderRight:"none",pr:2},...j.table.headerSx},children:Rn.map(T=>{let J=i===T.id,ye=!!T.memberFilter,Io=ye&&H.includes(T.memberFilter),qn=ye||!!T.statusFilter||!!T.ackFilter||!!T.projectFilter||!!T.priorityFilter,pr=Io||!!T.statusFilter&&G||!!T.ackFilter&&te||!!T.projectFilter&&fe||!!T.priorityFilter&&Re;return Yo(qo,{onClick:nt=>{T.memberFilter?k(T.memberFilter,nt.currentTarget):T.statusFilter?K(nt.currentTarget):T.ackFilter?R?.(nt.currentTarget):T.projectFilter?ne?.(nt.currentTarget):T.priorityFilter?Ie?.(nt.currentTarget):_m(T.id,T.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:T.align==="center"?"center":"flex-start",gap:.5,px:1,py:1,minWidth:0,fontSize:j.table.headerFontSize,color:T.sortable||qn?j.table.headerActiveColor:j.table.headerColor,whiteSpace:"nowrap",cursor:T.sortable||qn?"pointer":"default",userSelect:"none",...J?{color:j.table.headerFilteredColor}:{},...pr?{color:j.table.headerFilteredColor,fontWeight:600}:{}},children:[T.icon,T.label,pr?de(sx,{sx:{fontSize:14}}):null,J?a==="asc"?de(rx,{sx:{fontSize:13}}):de(ix,{sx:{fontSize:13}}):null]},T.id)})}),Qe.length===0?de(qo,{sx:{py:8,textAlign:"center",color:j.table.emptyColor,fontSize:14},children:Po?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":It?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):de(qo,{sx:{flex:1,minHeight:0},children:de(mx,{ref:L,style:{height:"100%"},thumb:{width:8},children:X?_t?de(rs,{customScrollParent:X,data:io,computeItemKey:(T,J)=>J.section.key,itemContent:(T,J)=>{let{section:ye,visibleTasks:Io}=J,qn=Ko.has(ye.key),pr=T===io.length-1;return Yo(qo,{children:[Yo(qo,{onClick:()=>w(ye.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:j.table.groupHeader.minHeight,bgcolor:j.table.groupHeader.bg,borderBottom:`1px solid ${j.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:j.table.groupHeader.hoverBg},...j.table.groupHeader.sx},children:[qn?de(lx,{sx:{fontSize:20,color:j.colors.textMuted}}):de(ax,{sx:{fontSize:20,color:j.colors.textMuted}}),de(qo,{component:"span",sx:{fontSize:j.table.groupHeader.labelFontSize,fontWeight:j.table.groupHeader.labelFontWeight,color:j.table.groupHeader.labelColor},children:ye.label}),b?de(qo,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:b(ye.key,ye.tasks)}):null,x&&(!g||g(ye.key))?de(tx,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:nt=>{nt.stopPropagation(),x(ye.key,ye.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:j.colors.textSecondary,"&:hover":{bgcolor:j.colors.surfaceHover,color:j.colors.accentOnSurface}},children:de(ns,{sx:{fontSize:21}})}):null,Yo(qo,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[I?I(ye.key,ye.tasks):null,de(qo,{component:"span",sx:{flexShrink:0,width:j.table.groupHeader.badge.width,py:j.table.groupHeader.badge.paddingY,borderRadius:`${j.table.groupHeader.badge.borderRadius}px`,bgcolor:j.table.groupHeader.badge.bg,border:j.table.groupHeader.badge.border,color:j.table.groupHeader.badge.color,fontSize:j.table.groupHeader.badge.fontSize,fontWeight:j.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:Io.length})]})]}),qn?null:Io.map((nt,Mm)=>xl(nt,pr&&Mm===Io.length-1&&E))]})}}):de(rs,{customScrollParent:X,data:Qe,computeItemKey:(T,J)=>J.seq,endReached:$,itemContent:(T,J)=>xl(J,T===Qe.length-1&&E)}):null})}),de(Sr,{anchorEl:yi?.anchorEl??null,value:zn?.status??"",options:zn?Pl(zn):Wn,onSelect:T=>{zn&&D(zn.seq,T)},onClose:()=>ml(null)}),de(ts,{transitionDuration:0,anchorEl:ur?.anchorEl??null,open:!!ur,onClose:()=>Si(null),children:["high","medium","low"].map(T=>Yo(Rr,{selected:dr?.priority===T,onClick:()=>{dr&&je?.(dr.seq,T),Si(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[de(zo,{priority:T,small:!0}),dr?.priority===T?de(ta,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},T))}),Yo(ts,{anchorEl:yo?.anchorEl??null,open:!!yo,onClose:()=>Ot(null),transitionDuration:0,children:[Yo(Rr,{selected:!yo?.task.tab_key,onClick:()=>{yo&&O(yo.task.seq,""),Ot(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[de(cx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",yo?.task.tab_key?null:de(ta,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),f.filter(T=>!T.archived).map(T=>{let J=ze(T.icon),ye=yo?.task.tab_key===T.key;return Yo(Rr,{selected:ye,onClick:()=>{yo&&O(yo.task.seq,T.key),Ot(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[J?de(J,{sx:{fontSize:17,color:"#1e3a8a"}}):null,T.label,ye?de(ta,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},T.key)}),_?[de(ox,{},"add-project-divider"),Yo(Rr,{onClick:()=>cl(!0),sx:{fontSize:14,color:"#787774"},children:[de(nx,{children:de(ns,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),_?de(Pr,{open:Ti,onClose:()=>cl(!1),onSubmit:(T,J)=>{let ye=yo?.task.seq??0;(async()=>{let Io=await _(T,J);Io&&ye&&O(ye,Io)})(),Ot(null)}}):null,de(ux,{anchorEl:ue?.anchorEl??null,open:!!ue&&ue?.field==="start_date",onClose:()=>Xe(null),selectedDate:dx(ue?.date??""),onDateChange:wm}),de(Pt,{anchorEl:ue?.anchorEl??null,open:!!ue&&ue?.field==="due_date",date:ue?.date??"",reminder:ue?.reminder??"none",hideReminder:!!ue?.completed,onClose:()=>Xe(null),onDateChange:Dm,onReminderChange:Om}),de(Ue,{open:!!wt,anchorEl:wt?.anchorEl??null,title:wt?.kind==="claim"?"\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:()=>Dt(null),onConfirm:()=>{wt&&F?.(wt.taskSeq),Dt(null)}}),de(Ue,{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:()=>Je(null),onConfirm:()=>{Ke&&m(Ke.task,Ke.nextCompleted),Je(null)}})]})}import{useCallback as jo,useMemo as ut,useRef as Ex,useState as dt}from"react";import{Box as Se,ButtonBase as ks,Divider as cs,IconButton as ms,Menu as us,MenuItem as zt}from"@mui/material";import aa from"@mui/icons-material/Add";import ds from"@mui/icons-material/MoreVert";import ps from"@mui/icons-material/EditOutlined";import fs from"@mui/icons-material/ArchiveOutlined";import xs from"@mui/icons-material/UnarchiveOutlined";import Px from"@mui/icons-material/NotificationsOutlined";import Rx from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as px}from"@mui/material";import{jsx as as}from"react/jsx-runtime";function mt({sx:e,...o}){return as(px,{viewBox:"0 0 24 24",...o,sx:{fill:"none",...e},children:as("path",{d:"M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6M14 10V17M10 10V17",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{DndContext as zx,DragOverlay as qx,PointerSensor as Ax,pointerWithin as Lx,rectIntersection as Nx,useDroppable as Fx,useSensor as Hx,useSensors as Wx}from"@dnd-kit/core";import{SortableContext as Ts,arrayMove as gs,horizontalListSortingStrategy as $x,useSortable as Kx,verticalListSortingStrategy as Ux}from"@dnd-kit/sortable";import{CSS as Vx}from"@dnd-kit/utilities";import la from"@ehfuse/overlay-scrollbar";import{useState as hx}from"react";import{Box as Rt,ButtonBase as kx,Checkbox as Tx,Tooltip as yx}from"@mui/material";import Sx from"@mui/icons-material/AlarmOutlined";import Bx from"@mui/icons-material/TimerOutlined";import{Box as Yt,Button as fx,Popover as xx}from"@mui/material";import gx from"@mui/icons-material/CheckCircle";import{jsx as jt,jsxs as zr}from"react/jsx-runtime";function qr({anchorEl:e,open:o,acks:t,total:n,avatarSrcByName:r,onRequestConfirm:i,onClose:a}){let s=He();return jt(xx,{open:o&&(s||!!e),anchorEl:e,onClose:a,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...s?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:zr(Yt,{sx:{minWidth:240,maxWidth:320,py:1},children:[zr(Yt,{sx:{px:2,pb:.75,fontSize:uo(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",t.length,"/",n]}),t.length===0?jt(Yt,{sx:{px:2,py:1.5,fontSize:uo(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(u=>zr(Yt,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[jt(fo,{names:[u.name],size:22,avatarSrcByName:r}),jt(Yt,{component:"span",sx:{fontSize:uo(14),color:"#37352f",whiteSpace:"nowrap"},children:u.name}),jt(Yt,{component:"span",sx:{ml:"auto",fontSize:uo(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:at(u.time)}),jt(gx,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},u.account_seq)),i?jt(Yt,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:zr(fx,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{i(),a()},sx:{fontSize:uo(13)},children:["\uD655\uC778 \uC694\uCCAD (",n-t.length,"\uBA85 \uBBF8\uD655\uC778)"]})}):null]})})}function bx(e){let o=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(t=>t>0&&t!==o))]}function ls(e,o){let t=bx(e),n=e.acks??[],r=o>0?n.find(i=>i.account_seq===o):void 0;return{myTime:r?.time??"",canConfirm:o>0&&t.includes(o)&&!r,count:n.filter(i=>t.includes(i.account_seq)).length,total:t.length}}function z1(e){let o=String(e??"").trim();return o?o.slice(5,16).replaceAll("-","."):""}import{Fragment as Ix,jsx as xo,jsxs as Xt}from"react/jsx-runtime";function Tn(e){return{border:`1px solid ${e.borderColor}`,borderRadius:1,p:1,bgcolor:e.bg,display:"flex",flexDirection:"column",gap:.75,boxShadow:"0 1px 2px rgba(0,0,0,0.04)",...e.sx}}function Cx(e){let o=e.trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function vx(){let e=new Date,o=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${o}-${t}`}function Qt({task:e,statusOptions:o,showDueDate:t=!1,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,titleFontSize:a=13}){let s=oe(),m=!!e.due_date&&e.due_date.slice(0,10)<=vx()?s.colors.danger:s.colors.accentOnSurface,d=ls(e,0),[p,l]=hx(null),c=xn(e,o),f=new Set(e.label_keys??[]),w=c.filter(x=>!f.has(x.key)),h=c.filter(x=>f.has(x.key));return Xt(Ix,{children:[Xt(Rt,{sx:{display:"flex",alignItems:"center",gap:.5},children:[xo(Tx,{size:"small",checked:e.completed,onPointerDown:x=>x.stopPropagation(),onClick:x=>x.stopPropagation(),onChange:(x,g)=>n?.({anchorEl:x.currentTarget,taskSeq:e.seq,nextCompleted:g}),sx:{p:0}}),xo(yx,{title:e.title,arrow:!0,enterDelay:300,children:Xt(Rt,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:a,fontWeight:s.mode==="dark"||e.completed?400:500,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary,lineHeight:1.35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:e.completed?"line-through":"none"},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})}),(e.comment_count??e.comments?.length??0)>0?xo(Or,{sx:{fontSize:15,flexShrink:0,color:s.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?xo(Rt,{sx:{pl:3,mt:-.5,fontSize:12.5,color:s.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,Xt(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[Xt(Rt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[w.map(x=>xo(_e,{option:x,small:!0},x.key)),xo(zo,{priority:e.priority,small:!0}),h.map(x=>xo(_e,{option:x,small:!0},x.key))]}),t&&String(e.due_date??"").trim()?Xt(kx,{disabled:!i,onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),i?.(e,x.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:m,whiteSpace:"nowrap","&:hover":i?{bgcolor:s.colors.border}:void 0},children:[Cx(e.due_date),xo(Sx,{sx:{fontSize:15}})]}):null]}),t&&e.estimated_time?Xt(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:s.colors.textSecondary},children:[xo(Bx,{sx:{fontSize:14}}),e.estimated_time]}):null,xo(fo,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),d.total>0?xo(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:xo(Rt,{sx:{flexShrink:0,width:64},onPointerDown:x=>x.stopPropagation(),onClick:x=>x.stopPropagation(),children:xo(hn,{canConfirm:!1,count:d.count,total:d.total,onConfirm:()=>{},onShowList:x=>l(x)})})}):null,xo(qr,{anchorEl:p,open:!!p,acks:e.acks??[],total:d.total,onRequestConfirm:r&&d.count<d.total?()=>{r(e),l(null)}:void 0,onClose:()=>l(null)})]})}import{Box as _x}from"@mui/material";import{useSortable as wx}from"@dnd-kit/sortable";import{CSS as Dx}from"@dnd-kit/utilities";import{jsx as ss}from"react/jsx-runtime";function Ox(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function Ar({task:e,statusOptions:o,variant:t="card",showDueDate:n=!1,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,onCardClick:s,onCardContextMenu:u,titleFontSize:m}){let d=oe(),{attributes:p,listeners:l,setNodeRef:c,transform:f,transition:w,isDragging:h}=wx({id:String(e.seq)}),x=t==="list";return ss(_x,{ref:c,...p,...l,onClick:s?()=>s(e):void 0,onContextMenu:u?g=>u(e,g):void 0,sx:{...x?Ox(d.card):Tn(d.card),opacity:h?.35:e.completed?.55:1,transform:Dx.Translate.toString(f),transition:w,position:"relative",cursor:"default",touchAction:"none","&:hover":x?{bgcolor:d.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:ss(Qt,{task:e,statusOptions:o,showDueDate:n,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,titleFontSize:m})})}function Mx(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function wo(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let o=Mx(e.end_date);return o?`${e.name} (~${o})`:e.name}import{jsx as Q,jsxs as Oe}from"react/jsx-runtime";var bs=2,Lr="group-",Do="colmove-",na="__default__",ra=qi,ia="__other__",Nr="sprint-",hs=`${Nr}0`,Gx={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function ys(e){return{flexShrink:0,width:e.width,py:e.paddingY,borderRadius:`${e.borderRadius}px`,bgcolor:e.bg,border:e.border,color:e.color,fontSize:e.fontSize,fontWeight:e.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums",...e.sx}}function Yx({column:e,tasks:o,statusOptions:t,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onAddTask:a,canAdd:s,onOpenMenu:u,onCardClick:m,onCardContextMenu:d,grow:p,summary:l,onOpenSprintMenu:c}){let f=oe(),{setNodeRef:w,isOver:h}=Fx({id:`${Lr}${e.key}`}),{attributes:x,listeners:g,setNodeRef:I,transform:b,transition:O,isDragging:_}=Kx({id:`${Do}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return Oe(Se,{ref:P=>{w(P),I(P)},sx:{flex:p?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:P=>P.shadows[1],bgcolor:h?f.colors.accentSoft:f.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:Vx.Translate.toString(b),...O?{transition:`${O}, background-color 0.15s`}:{},opacity:_?.6:1},children:[Oe(Se,{...x,...g,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${f.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?Q(Se,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let P=ze(e.icon);return P?Q(P,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Q(Se,{component:"span",sx:{fontSize:f.board.columnHeaderFontSize,fontWeight:700,color:f.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),Q(Se,{component:"span",sx:{...ys(f.board.badge),ml:"auto"},children:o.length}),e.sprint&&c?Q(ms,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>c(P.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:Q(ds,{sx:{fontSize:18}})}):e.locked?null:Q(ms,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>u({anchorEl:P.currentTarget,column:e}),sx:{color:"#9a9a97"},children:Q(ds,{sx:{fontSize:18}})})]}),l?Q(Se,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${f.card.borderColor}`,flexShrink:0},children:l}):null,Q(Se,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Q(la,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Oe(Se,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[Q(Ts,{items:o.map(P=>String(P.seq)),strategy:Ux,children:o.map(P=>Q(Ar,{task:P,statusOptions:t,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onCardClick:m,onCardContextMenu:d},P.seq))}),o.length===0&&!s?Q(Se,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,o.length===0&&s?Q(Se,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:Oe(ks,{className:"taskbox-board-add",onClick:()=>a(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.card.borderColor}`,bgcolor:f.card.bg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.card.hoverBg}},children:[Q(aa,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function sa({tasks:e,statusOptions:o,customTabs:t,mode:n="active",onToggleCompleted:r,onRequestReply:i,onChangeDueDate:a,onChangeReminder:s,onMoveTask:u,columnAxis:m="project",statusColumns:d=[],onMoveTaskStatus:p,sprintColumns:l=[],onMoveTaskSprint:c,onAddGroup:f,onAddTask:w,canAdd:h=!0,onRequestRename:x,onArchiveProject:g,onDeleteProject:I,onReorderProjects:b,onOpenDetail:O,onTaskContextMenu:_,hideCompleted:P=!1,renderColumnSummary:C,onEditSprint:F,onChangeSprintStatus:D,onRemoveSprint:Z}){let S=oe(),[k,H]=dt(null),[K,G]=dt(null),[R,te]=dt(null),[ne,fe]=dt(null),[Ie,Re]=dt(null),[re,le]=dt(null),[y,B]=dt(null),[q,N]=dt(null),[W,se]=dt(null),z=Ex(!1),Y=ut(()=>new Map(e.map(v=>[v.seq,v])),[e]),ke=ut(()=>{let v=e.filter(L=>L.is_notice);return v.sort((L,X)=>L.completed!==X.completed?L.completed?1:-1:X.seq-L.seq),v},[e]),M=ut(()=>t.filter(v=>!v.archived),[t]),ie=ut(()=>t.filter(v=>v.archived),[t]),xe=v=>({key:v.key,label:v.label,icon:v.icon,isDefault:!1,isArchived:v.archived}),Ae=ut(()=>new Set(d.map(v=>v.key)),[d]),je=ut(()=>new Set(l.map(v=>v.seq)),[l]),$=ut(()=>{if(m==="sprint")return[{key:hs,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...l.map(v=>({key:`${Nr}${v.seq}`,label:wo(v),icon:"",isDefault:!1,isArchived:!1,dot:Gx[v.status],locked:!0,sprint:v}))];if(m==="status"){let v=d.map(L=>({key:L.key,label:L.name,icon:"",isDefault:!1,isArchived:!1,dot:L.dot,locked:!0}));return v.some(L=>L.key===ra)?v:[...v,{key:ra,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return n==="archived"?ie.map(xe):[{key:na,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...M.map(xe)]},[m,d,l,n,M,ie]),j=Wx(Hx(Ax,{activationConstraint:{distance:5}})),Me=jo(v=>{let L=String(v.active.id).startsWith(Do),X=Lx(v),ae=X.length>0?X:Nx(v);if(L)return ae.filter(mo=>String(mo.id).startsWith(Do));let ge=ae.filter(mo=>!String(mo.id).startsWith(Do)),E=ge.filter(mo=>!String(mo.id).startsWith(Lr));return E.length>0?E:ge},[]),vo=ut(()=>{let v=new Map;for(let L of e){if(L.is_notice)continue;let X;if(m==="sprint"){let ge=L.sprint_seq??0;X=je.has(ge)?`${Nr}${ge}`:hs}else X=m==="status"?L.completed?ra:Ae.has(String(L.status??""))?String(L.status??""):ia:L.tab_key?.trim()||na;let ae=v.get(X);ae?ae.push(L):v.set(X,[L])}for(let L of v.values())L.sort((X,ae)=>{if(X.completed!==ae.completed)return X.completed?1:-1;let ge=(X.group_sort_no??0)>0,E=(ae.group_sort_no??0)>0;return ge&&E?(X.group_sort_no??0)-(ae.group_sort_no??0):ge!==E?ge?-1:1:X.due_date!==ae.due_date?X.due_date<ae.due_date?-1:1:X.seq-ae.seq});return v},[e,m,Ae,je]),Ct=ut(()=>m!=="status"||(vo.get(ia)??[]).length===0?$:[...$,{key:ia,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[m,$,vo]),ot=jo(v=>y?(y.get(v)??[]).map(L=>Y.get(L)).filter(L=>!!L):vo.get(v)??[],[y,Y,vo]),vt=jo(v=>{let L=ot(v);return P?L.filter(X=>!X.completed):L},[ot,P]),It=jo(v=>{let L=String(v.active.id);if(L.startsWith(Do)){se(L.slice(Do.length));return}N(Number(L)),B(new Map($.map(X=>[X.key,(vo.get(X.key)??[]).map(ae=>ae.seq)])))},[$,vo]),Po=jo((v,L)=>{if(v.startsWith(Lr))return{key:v.slice(Lr.length),overSeq:null};let X=Number(v);for(let[ae,ge]of L)if(ge.includes(X))return{key:ae,overSeq:X};return null},[]),_t=jo(v=>{let{active:L,over:X}=v;!X||String(L.id).startsWith(Do)||B(ae=>{if(!ae)return ae;let ge=Number(L.id),E=Po(String(X.id),ae);if(!E)return ae;let mo=[...ae.entries()].find(([,Je])=>Je.includes(ge))?.[0];if(!mo||mo===E.key)return ae;let ue=new Map(ae);ue.set(mo,(ue.get(mo)??[]).filter(Je=>Je!==ge));let Xe=[...ue.get(E.key)??[]],Ke=Xe.length;if(E.overSeq!==null){let Je=Xe.indexOf(E.overSeq);Je!==-1&&(Ke=Je)}return Xe.splice(Ke,0,ge),ue.set(E.key,Xe),ue})},[Po]),tt=jo(v=>{let L=String(v.active.id);if(L.startsWith(Do)){se(null);let Ke=String(v.over?.id??"");if(!Ke.startsWith(Do))return;let Je=L.slice(Do.length),wt=Ke.slice(Do.length);if(Je===wt)return;let Dt=t.map(Ti=>Ti.key),yo=Dt.indexOf(Je),Ot=Dt.indexOf(wt);if(yo===-1||Ot===-1)return;b(gs(Dt,yo,Ot));return}let X=y;if(B(null),N(null),z.current=!0,!X||!v.over)return;let ae=Number(L),ge=[...X.entries()].find(([,Ke])=>Ke.includes(ae));if(!ge)return;let[E,mo]=ge,ue=[...mo],Xe=Po(String(v.over.id),X);if(Xe&&Xe.key===E&&Xe.overSeq!==null&&Xe.overSeq!==ae){let Ke=ue.indexOf(ae),Je=ue.indexOf(Xe.overSeq);Ke!==-1&&Je!==-1&&(ue=gs(ue,Ke,Je))}if(m==="status"){p?.(ae,E);return}if(m==="sprint"){c?.(ae,Number(E.slice(Nr.length))||0);return}u(ae,E===na?"":E,ue)},[t,y,Po,u,b,m,p,c]),io=jo(()=>{B(null),N(null),se(null),z.current=!0},[]),Qe=jo(v=>{if(z.current){z.current=!1;return}O(v)},[O]),Ko=q!==null?Y.get(q)??null:null,To=W!==null?$.find(v=>v.key===W)??null:null,Rn=jo((v,L)=>{le({anchorEl:L,taskSeq:v.seq,date:v.due_date,reminder:v.reminder})},[]),Ce=K?.column??null;return Oe(Se,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${S.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:bs,bgcolor:S.colors.surfaceSubtle},children:[Oe(zx,{sensors:j,collisionDetection:Me,onDragStart:It,onDragOver:_t,onDragEnd:tt,onDragCancel:io,children:[Q(Se,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:n==="archived"&&$.length===0?Q(Se,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Q(la,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:Oe(Se,{sx:{display:"flex",alignItems:"flex-start",gap:bs,height:"100%",minWidth:"min-content",pb:.5},children:[n==="active"&&ke.length>0?Oe(Se,{sx:{flex:m!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:v=>v.shadows[1],bgcolor:S.card.bg,overflow:"hidden"},children:[Oe(Se,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${S.card.borderColor}`,flexShrink:0,minHeight:48},children:[Q(Px,{sx:{fontSize:17,color:"#e8763a"}}),Q(Se,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:S.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),Oe(Se,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",ke.length,")"]})]}),Q(Se,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Q(la,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Q(Se,{sx:{display:"flex",flexDirection:"column"},children:ke.map(v=>Oe(Se,{onClick:()=>Qe(v),onContextMenu:L=>_(v,L),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${S.card.borderColor}`,bgcolor:S.card.bg,cursor:"pointer","&:hover":{bgcolor:S.card.hoverBg}},children:[Q(Qt,{task:v,statusOptions:o,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:H}),(()=>{let L=(v.target_names??[]).filter(ae=>ae.trim());if(L.length===0)return null;let X=L.length>2?`${L[0]}, ${L[1]} \uC678 ${L.length-2}`:L.join(", ");return Oe(Se,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[Q(Rx,{sx:{fontSize:14,flexShrink:0}}),Q(Se,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:X})]})})()]},v.seq))})})})]}):null,Q(Ts,{items:M.map(v=>`${Do}${v.key}`),strategy:$x,children:Ct.map(v=>Q(Yx,{column:v,tasks:vt(v.key),summary:C?.(v.key,ot(v.key)),onOpenSprintMenu:F||D||Z?(L,X)=>te({anchorEl:L,sprint:X}):void 0,statusOptions:o,onRequestArchiveToggle:H,onRequestReply:i,onDueDateClick:Rn,onAddTask:w,canAdd:h&&m==="project",onOpenMenu:G,onCardClick:Qe,onCardContextMenu:_,grow:m!=="project"},v.key))}),n==="active"&&m==="project"?Oe(ks,{onClick:f,sx:{flex:"0 0 270px",minWidth:270,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:2,border:"1.5px dashed #cfcfcc",borderRadius:1.5,color:"#787774",fontSize:14,"&:hover":{bgcolor:"#eef2f6",borderColor:"#9a9a97"}},children:[Q(aa,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,n==="active"&&Ct.length===0&&ke.length===0?Q(Se,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:m==="project"?"\uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0C8 \uD504\uB85C\uC81D\uD2B8\uB97C \uCD94\uAC00\uD574 \uC5C5\uBB34\uB97C \uC815\uB9AC\uD558\uC138\uC694.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})}),Q(qx,{children:Ko?Q(Se,{sx:{...Tn,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Q(Qt,{task:Ko,statusOptions:o,showDueDate:!0,titleFontSize:15})}):To?Oe(Se,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:S.card.bg,border:`1px solid ${S.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let v=ze(To.icon);return v?Q(v,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Q(Se,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:S.board.columnHeaderColor},children:To.label}),Q(Se,{component:"span",sx:ys(S.board.badge),children:(vo.get(To.key)??[]).length})]}):null})]}),Oe(us,{transitionDuration:0,anchorEl:K?.anchorEl??null,open:!!K,onClose:()=>G(null),children:[Ce&&!Ce.isArchived&&h?Oe(zt,{onClick:()=>{Ce&&w(Ce.isDefault?"":Ce.key),G(null)},sx:{fontSize:14,gap:1},children:[Q(aa,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,Ce&&!Ce.isDefault&&!Ce.isArchived?Oe(zt,{onClick:()=>{x(Ce.key,Ce.label,Ce.icon),G(null)},sx:{fontSize:14,gap:1},children:[Q(ps,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,Ce&&!Ce.isDefault&&!Ce.isArchived?Oe(zt,{onClick:()=>{g(Ce.key,!0),G(null)},sx:{fontSize:14,gap:1},children:[Q(fs,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,Ce&&Ce.isArchived?Oe(zt,{onClick:()=>{g(Ce.key,!1),G(null)},sx:{fontSize:14,gap:1},children:[Q(xs,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,Ce&&!Ce.isDefault?Q(cs,{}):null,Ce&&!Ce.isDefault?Oe(zt,{onClick:()=>{K&&Re(K),G(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Q(mt,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),Oe(us,{transitionDuration:0,anchorEl:R?.anchorEl??null,open:!!R,onClose:()=>te(null),children:[F?Oe(zt,{onClick:()=>{R&&F(R.sprint.seq),te(null)},sx:{fontSize:14,gap:1},children:[Q(ps,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,D?Oe(zt,{onClick:()=>{R&&D(R.sprint.seq,R.sprint.status==="closed"?"active":"closed"),te(null)},sx:{fontSize:14,gap:1},children:[R?.sprint.status==="closed"?Q(xs,{sx:{fontSize:18,color:"#787774"}}):Q(fs,{sx:{fontSize:18,color:"#787774"}}),R?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,Z?Q(cs,{}):null,Z?Oe(zt,{onClick:()=>{R&&fe(R),te(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Q(mt,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),Q(Ue,{open:!!ne,anchorEl:ne?.anchorEl??null,title:`"${ne?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>fe(null),onConfirm:()=>{ne&&Z?.(ne.sprint.seq),fe(null)}}),Q(Pt,{anchorEl:re?.anchorEl??null,open:!!re,date:re?.date??"",reminder:re?.reminder??"none",onClose:()=>le(null),onDateChange:v=>{re&&(a(re.taskSeq,v),le(L=>L&&{...L,date:v}))},onReminderChange:v=>{re&&(s(re.taskSeq,v),le(L=>L&&{...L,reminder:v}))}}),Q(Ue,{open:!!Ie,anchorEl:Ie?.anchorEl??null,title:`"${Ie?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
2
+ \uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>Re(null),onConfirm:()=>{Ie&&I(Ie.column.key),Re(null)}}),Q(Ue,{open:!!k,anchorEl:k?.anchorEl??null,title:k?.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:k?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>H(null),onConfirm:()=>{k&&r(k.taskSeq,k.nextCompleted),H(null)}})]})}import{useCallback as At,useMemo as Gn,useRef as eg,useState as Yn}from"react";import{Box as Ve,Button as og,ButtonBase as Bs,IconButton as Ss}from"@mui/material";import tg from"@mui/icons-material/Add";import ng from"@mui/icons-material/ChevronLeft";import rg from"@mui/icons-material/ChevronRight";import ig from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as ag}from"@ehfuse/mui-datetime-picker";import{DndContext as lg,DragOverlay as sg,PointerSensor as cg,pointerWithin as mg,rectIntersection as ug,useDroppable as dg,useSensor as pg,useSensors as fg}from"@dnd-kit/core";import{SortableContext as xg,arrayMove as gg,verticalListSortingStrategy as bg}from"@dnd-kit/sortable";import hg from"@ehfuse/overlay-scrollbar";import{useEffect as jx,useState as Xx}from"react";function qt(e){let{loadHolidays:o}=So(),[t,n]=Xx(()=>new Map),r=e.join(",");return jx(()=>{if(!o||!r){n(new Map);return}let i=!1;return o(r.split(",").map(Number)).then(a=>{if(i)return;let s=new Map;for(let u of a)s.has(u.date)||s.set(u.date,u.name);n(s)}).catch(()=>{}),()=>{i=!0}},[o,r]),t}function Qx(e){let[o,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(o,t-1,n+1)),i=a=>String(a).padStart(2,"0");return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`}function yn(e){let o=new Map;for(let t of e){let n=t.start_date;for(let r=0;r<62&&n<=t.end_date;r+=1){let i=o.get(n);i?i.push(t):o.set(n,[t]),n=Qx(n)}}for(let t of o.values())t.sort((n,r)=>(n.time||"99:99").localeCompare(r.time||"99:99")||n.title.localeCompare(r.title));return o}import{Box as ca,Tooltip as Jx}from"@mui/material";import{jsx as ma,jsxs as Zx}from"react/jsx-runtime";function Sn({event:e,small:o=!1}){let t=e.time?`${e.time} ${e.title}`:e.title,n=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",r=i=>{i.stopPropagation();let[a,s,u]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${a}/${s}/${u}`,"_blank")};return ma(Jx,{title:`(${n}) ${t}`,arrow:!0,enterDelay:300,children:Zx(ca,{onClick:r,onPointerDown:i=>i.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:o?.6:.8,borderRadius:.75,bgcolor:"#f1f1ef",color:"#37352f",fontSize:15,fontWeight:500,overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,minWidth:0,maxWidth:"100%",cursor:"pointer","&:hover":{bgcolor:"#ececea"}},children:[ma(ca,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),ma(ca,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t})]})})}import{jsx as Be,jsxs as pt}from"react/jsx-runtime";var Cs=36,kg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Fr="day-";function ua(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function da(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function Tg(e){let o=e[0],t=e[e.length-1];return o.getMonth()===t.getMonth()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4`:o.getFullYear()===t.getFullYear()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getMonth()+1}\uC6D4`:`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getFullYear()}\uB144 ${t.getMonth()+1}\uC6D4`}function yg(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function Sg({dayKey:e,isToday:o,dayLabel:t,holidayName:n,tasks:r,googleEvents:i,statusOptions:a,onRequestArchiveToggle:s,onRequestReply:u,onAddSchedule:m,canAdd:d,onCardClick:p,onCardContextMenu:l,summary:c}){let f=oe(),{setNodeRef:w}=dg({id:`${Fr}${e}`});return pt(Ve,{ref:w,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:o?f.calendar.todayBg:f.calendar.cellBg},children:[pt(Ve,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:Cs,bgcolor:o?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:r.length>0?`1px solid ${f.calendar.borderColor}`:"none",flexShrink:0},children:[n?Be(Ve,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}):null,o?Be(Ve,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Be(Ve,{component:"span",sx:{fontSize:13.5,fontWeight:o?700:400,color:n?f.colors.danger:f.mode==="dark"?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:t})]}),c?Be(Ve,{sx:{px:1,py:1,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0},children:c}):null,Be(Ve,{sx:{flex:1,minHeight:0,bgcolor:o?f.calendar.todayBg:f.colors.surfaceSubtle},children:Be(hg,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:pt(Ve,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[i.length>0?Be(Ve,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:i.map(h=>Be(Sn,{event:h},h.uid))}):null,Be(xg,{items:r.map(h=>String(h.seq)),strategy:bg,children:r.map(h=>Be(Ar,{titleFontSize:15,task:h,statusOptions:a,variant:"list",onRequestArchiveToggle:s,onRequestReply:u,onCardClick:p,onCardContextMenu:l},h.seq))}),Be(Ve,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...d?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:pt(Bs,{className:"taskbox-add-schedule",onClick:()=>m(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[Be(tg,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function vs({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,todayStr:r,onToggleCompleted:i,onMoveTask:a,onRequestReply:s,onAddSchedule:u,canAdd:m=!0,onOpenDetail:d,onTaskContextMenu:p,renderColumnSummary:l}){let c=oe(),[f,w]=Yn(()=>ua(new Date)),[h,x]=Yn(null),[g,I]=Yn(null),[b,O]=Yn(null),[_,P]=Yn(null),C=eg(!1),F=Gn(()=>Array.from({length:7},(y,B)=>da(f,B)),[f]),D=Gn(()=>new Map(e.map(y=>[y.seq,y])),[e]),Z=Gn(()=>[...new Set(F.map(y=>y.getFullYear()))],[F]),S=qt(Z),k=fg(pg(cg,{activationConstraint:{distance:5}})),H=At(y=>{let B=mg(y),q=B.length>0?B:ug(y),N=q.filter(W=>!String(W.id).startsWith(Fr));return N.length>0?N:q},[]),K=Gn(()=>yn(o),[o]),G=Gn(()=>{let y=new Map;for(let B of e){let q=B.due_date.slice(0,10)||(n?B.start_date.slice(0,10):"");if(!q)continue;let N=y.get(q);N?N.push(B):y.set(q,[B])}for(let B of y.values())B.sort((q,N)=>{let W=q.sort_no>0,se=N.sort_no>0;if(W&&se)return q.sort_no-N.sort_no;if(W!==se)return W?-1:1;if(q.completed!==N.completed)return q.completed?1:-1;let z=Ai(q),Y=Ai(N);return z!==Y?z?-1:1:q.seq-N.seq});return y},[e,n]),R=At(y=>b?(b.get(y)??[]).map(B=>D.get(B)).filter(B=>!!B):G.get(y)??[],[b,D,G]),te=At(y=>{P(Number(y.active.id)),O(new Map(F.map(B=>{let q=qe(B);return[q,(G.get(q)??[]).map(N=>N.seq)]})))},[F,G]),ne=At((y,B)=>{if(y.startsWith(Fr))return{day:y.slice(Fr.length),overSeq:null};let q=Number(y);for(let[N,W]of B)if(W.includes(q))return{day:N,overSeq:q};return null},[]),fe=At(y=>{let{active:B,over:q}=y;q&&O(N=>{if(!N)return N;let W=Number(B.id),se=ne(String(q.id),N);if(!se)return N;let z=[...N.entries()].find(([,ie])=>ie.includes(W))?.[0];if(!z||z===se.day)return N;let Y=new Map(N);Y.set(z,(Y.get(z)??[]).filter(ie=>ie!==W));let ke=[...Y.get(se.day)??[]],M=ke.length;if(se.overSeq!==null){let ie=ke.indexOf(se.overSeq);ie!==-1&&(M=ie)}return ke.splice(M,0,W),Y.set(se.day,ke),Y})},[ne]),Ie=At(y=>{let{active:B,over:q}=y,N=b;if(O(null),P(null),C.current=!0,!N||!q)return;let W=Number(B.id),se=[...N.entries()].find(([,ie])=>ie.includes(W));if(!se)return;let[z,Y]=se,ke=[...Y],M=ne(String(q.id),N);if(M&&M.day===z&&M.overSeq!==null&&M.overSeq!==W){let ie=ke.indexOf(W),xe=ke.indexOf(M.overSeq);ie!==-1&&xe!==-1&&(ke=gg(ke,ie,xe))}a(W,z,ke)},[b,a,ne]),Re=At(()=>{O(null),P(null),C.current=!0},[]),re=At(y=>{if(C.current){C.current=!1;return}d(y)},[d]),le=_!==null?D.get(_)??null:null;return pt(Ve,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${c.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[pt(Ve,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0},children:[pt(Ve,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Be(Ss,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>w(da(f,-7)),children:Be(ng,{sx:{fontSize:20,color:c.colors.textSecondary}})}),Be(og,{size:"small",color:"inherit",onClick:()=>w(ua(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:c.mode==="dark"?400:500,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),Be(Ss,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>w(da(f,7)),children:Be(rg,{sx:{fontSize:20,color:c.colors.textSecondary}})})]}),pt(Bs,{onClick:y=>I(y.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,"&:hover":{bgcolor:c.colors.surfaceHover}},children:[Tg(F),Be(ig,{sx:{fontSize:18,color:c.colors.textMuted}})]})]}),Be(Ve,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:F.map(y=>{let B=y.getDay(),q=S.has(qe(y));return Be(Ve,{sx:{height:Cs,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:B===0||q?c.colors.danger:B===6?c.colors.accentOnSurface:c.colors.textSecondary},children:kg[B]},qe(y))})}),Be(Ve,{sx:{flex:1,minHeight:0},children:pt(lg,{sensors:k,collisionDetection:H,onDragStart:te,onDragOver:fe,onDragEnd:Ie,onDragCancel:Re,children:[Be(Ve,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:F.map(y=>{let B=qe(y);return Be(Sg,{dayKey:B,isToday:B===r,dayLabel:yg(y),holidayName:S.get(B)??"",summary:l?.(B,R(B)),tasks:R(B),googleEvents:K.get(B)??[],statusOptions:t,onRequestArchiveToggle:x,onRequestReply:s,onAddSchedule:u,canAdd:m,onCardClick:re,onCardContextMenu:p},B)})}),Be(sg,{children:le?Be(Ve,{sx:{...Tn,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Be(Qt,{task:le,statusOptions:t})}):null})]})}),Be(ag,{anchorEl:g,open:!!g,onClose:()=>I(null),selectedDate:f,onDateChange:y=>{w(ua(y)),I(null)}}),Be(Ue,{open:!!h,anchorEl:h?.anchorEl??null,title:h?.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:h?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>x(null),onConfirm:()=>{h&&i(h.taskSeq,h.nextCompleted),x(null)}})]})}import{useCallback as Xn,useMemo as Jt,useState as Qn}from"react";import{Box as lo,Button as vg,ButtonBase as Ds,IconButton as _s,Tooltip as Ig}from"@mui/material";import _g from"@mui/icons-material/Add";import wg from"@mui/icons-material/ChevronLeft";import Dg from"@mui/icons-material/ChevronRight";import Og from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Mg}from"@ehfuse/mui-datetime-picker";import{DndContext as Eg,DragOverlay as Pg,PointerSensor as Rg,pointerWithin as zg,rectIntersection as qg,useDraggable as Ag,useDroppable as Os,useSensor as Lg,useSensors as Ng}from"@dnd-kit/core";import Fg from"@ehfuse/overlay-scrollbar";import{Box as Hr}from"@mui/material";import{jsx as Wr,jsxs as Is}from"react/jsx-runtime";var pa={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"},fa=15;function jn({task:e,statusOptions:o,onOpenDetail:t,onContextMenu:n,isPreview:r=!1,isDragging:i=!1,isMine:a=!1,avatarSrcByName:s,onOpenMembers:u,setNodeRef:m,dragProps:d,trailing:p}){let l=oe(),c=l.mode==="dark",[f]=xn(e,o),w=String(e.manager_name??"").trim(),h=ze(e.icon||(e.is_notice?Ro:De)),x=!!u&&!a&&!!w;return Is(Hr,{ref:m,...d??{},onClick:g=>{g.stopPropagation(),t(e)},onContextMenu:n?g=>n(e,g):void 0,sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:1,flexShrink:0,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:f?c?fn(f.dot,l.chip.darkBgAlpha):f.bg:c?l.card.bg:l.colors.surfaceHover,color:f?c?l.chip.darkTextSource==="fg"?f.fg:f.dot:f.fg:l.colors.textPrimary,fontSize:fa,fontWeight:c||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:r?.5:i?.35:e.completed?.6:1,border:r?`1px dashed ${l.colors.accent}`:"1px solid transparent",pointerEvents:r?"none":"auto",cursor:"pointer",touchAction:"none",overflow:"hidden","&:hover":{filter:"brightness(0.96)"},...a?{borderLeft:`3px solid ${l.colors.accentOnSurface}`,pl:.75}:{}},children:[Wr(Hr,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:pa[e.priority]??l.colors.accentOnSurface}}),h?Wr(h,{sx:{fontSize:15,flexShrink:0,opacity:.75}}):null,Is(Hr,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:c?l.colors.textStrong:l.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]}),p??null,!p&&x?Wr(Hr,{component:"span",onClick:g=>{g.stopPropagation(),u?.(e)},sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:Wr(Vo,{src:s?.get(w)??"",avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}import{Box as ft,Button as Bg,Dialog as Cg}from"@mui/material";import{jsx as xt,jsxs as xa}from"react/jsx-runtime";function $r({task:e,avatarSrcByName:o,onClose:t}){let n=oe(),r=e?[{label:"\uCC45\uC784\uC790",names:[String(e.manager_name??"").trim()]},{label:"\uCC38\uC870\uC790",names:e.receiver_names??[]},{label:"\uC791\uC131\uC790",names:[String(e.created_by??"").trim()]}]:[];return xt(Cg,{open:!!e,onClose:t,maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:e?xa(ft,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:n.colors.surface},children:[xt(ft,{sx:{fontSize:15.5,fontWeight:600,color:n.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),r.map(i=>{let a=i.names.filter(s=>!!s);return xa(ft,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[xt(ft,{sx:{width:56,flexShrink:0,fontSize:13.5,color:n.colors.textSecondary,pt:.5},children:i.label}),xt(ft,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:a.length===0?xt(ft,{sx:{fontSize:14,color:n.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):a.map(s=>xa(ft,{sx:{display:"flex",alignItems:"center",gap:.75},children:[xt(Vo,{src:o?.get(s)??"",avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),xt(ft,{sx:{fontSize:14.5,color:n.colors.textPrimary},children:s})]},`${i.label}-${s}`))})]},i.label)}),xt(ft,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:xt(Bg,{size:"small",color:"inherit",onClick:t,children:"\uB2EB\uAE30"})})]}):null})}import{jsx as we,jsxs as gt}from"react/jsx-runtime";var Hg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Kr="mday-",Ur="mchip-",Ms=36;function Wg(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Vr(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function $g(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function ws(e,o){let t=Vr(e);return t.setMonth(t.getMonth()+o),t}function Kg({task:e,statusOptions:o,isPreview:t=!1,isMine:n=!1,avatarSrcByName:r,onOpenMembers:i,onOpenDetail:a,onContextMenu:s}){let{attributes:u,listeners:m,setNodeRef:d,isDragging:p}=Ag({id:String(e.seq),disabled:t}),{setNodeRef:l}=Os({id:`${Ur}${e.seq}`,disabled:t});return we(Ig,{title:e.title,arrow:!0,enterDelay:400,children:we(jn,{task:e,statusOptions:o,onOpenDetail:a,onContextMenu:s,isPreview:t,isDragging:p,isMine:n,avatarSrcByName:r,onOpenMembers:i,setNodeRef:c=>{d(c),l(c)},dragProps:{...u,...m}})})}function Ug({dayKey:e,dayNumber:o,isToday:t,isOtherMonth:n,weekday:r,holidayName:i,tasks:a,googleEvents:s,statusOptions:u,previewSeq:m,myAccountSeq:d,avatarSrcByName:p,onOpenMembers:l,onOpenDetail:c,onTaskContextMenu:f,onAddSchedule:w,canAdd:h}){let x=oe(),g=x.mode==="dark",{setNodeRef:I,isOver:b}=Os({id:`${Kr}${e}`}),O=a,_=!!i||r===0;return gt(lo,{ref:I,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:b?x.colors.accentSoft:t?x.calendar.todayBg:n?x.calendar.otherMonthBg:x.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...h?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[gt(lo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:Ms,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:t?x.calendar.todayBg:x.calendar.dateBandBg,borderBottom:`1px solid ${x.calendar.borderColor}`},children:[i?we(lo,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:x.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}):null,t?we(lo,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:x.colors.danger,color:x.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,we(lo,{component:"span",sx:{fontSize:13.5,fontWeight:t?700:400,color:n?x.colors.textMuted:_?x.colors.danger:r===6?x.colors.accentOnSurface:g?x.colors.textStrong:x.colors.textPrimary,flexShrink:0},children:o})]}),s.map(P=>we(Sn,{event:P,small:!0},P.uid)),O.map(P=>we(Kg,{task:P,statusOptions:u,isPreview:P.seq===m,isMine:d>0&&Number(P.manager_account_seq??0)===d,avatarSrcByName:p,onOpenMembers:l,onOpenDetail:c,onContextMenu:f},P.seq)),we(lo,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:gt(Ds,{className:"taskbox-month-add",onClick:()=>w(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${x.calendar.borderColor}`,bgcolor:x.calendar.cellBg,color:x.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:x.calendar.hoverBg}},children:[we(_g,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function Es({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,myAccountSeq:r=0,avatarSrcByName:i,todayStr:a,onMoveTask:s,onAddSchedule:u,canAdd:m=!0,onOpenDetail:d,onTaskContextMenu:p}){let l=oe(),c=l.mode==="dark",[f,w]=Qn(()=>Vr(new Date)),[h,x]=Qn(null),[g,I]=Qn(null),[b,O]=Qn(null),[_,P]=Qn(null),C=Jt(()=>{let y=Wg(f);return Array.from({length:42},(B,q)=>$g(y,q))},[f]),F=Jt(()=>new Map(e.map(y=>[y.seq,y])),[e]),D=Jt(()=>yn(o),[o]),Z=Jt(()=>[...new Set(C.map(y=>y.getFullYear()))],[C]),S=qt(Z),k=Jt(()=>{let y=new Map;for(let B of e){let q=B.due_date.slice(0,10)||(n?B.start_date.slice(0,10):"");if(!q)continue;let N=y.get(q);N?N.push(B):y.set(q,[B])}for(let B of y.values())B.sort((q,N)=>{let W=q.sort_no>0,se=N.sort_no>0;return W&&se?q.sort_no-N.sort_no:W!==se?W?-1:1:q.completed!==N.completed?q.completed?1:-1:q.seq-N.seq});return y},[e,n]),H=Ng(Lg(Rg,{activationConstraint:{distance:5}})),K=Xn(y=>{let B=zg(y),q=B.length>0?B:qg(y),N=q.filter(W=>String(W.id).startsWith(Ur));return N.length>0?N:q.filter(W=>String(W.id).startsWith(Kr))},[]),G=Xn(y=>{O(Number(y.active.id))},[]),R=Xn(y=>{P(y.over?String(y.over.id):null)},[]),te=Jt(()=>{let y=new Map;for(let[B,q]of k)for(let N of q)y.set(N.seq,B);return y},[k]),ne=b!==null?F.get(b)?.due_date.slice(0,10)??"":"",fe=Jt(()=>{if(b===null||!_)return null;if(_.startsWith(Ur)){let y=Number(_.slice(Ur.length)),B=te.get(y);if(!B)return null;let q=(k.get(B)??[]).filter(W=>W.seq!==b),N=q.findIndex(W=>W.seq===y);return{day:B,index:N===-1?q.length:N}}if(_.startsWith(Kr)){let y=_.slice(Kr.length),B=(k.get(y)??[]).filter(q=>q.seq!==b);return{day:y,index:B.length}}return null},[b,te,_,k]),Ie=Xn(y=>{let B=k.get(y)??[];if(b===null||!fe)return B;let q=F.get(b);if(!q)return B;let N=B.filter(W=>W.seq!==b);return y===fe.day?[...N.slice(0,fe.index),q,...N.slice(fe.index)]:y===ne?N:B},[b,ne,fe,F,k]),Re=Xn(y=>{let B=b,q=fe;if(O(null),P(null),B===null||!q)return;let N=(k.get(q.day)??[]).filter(se=>se.seq!==B),W=[...N.slice(0,q.index).map(se=>se.seq),B,...N.slice(q.index).map(se=>se.seq)];s(B,q.day,W)},[b,fe,s,k]),re=b!==null?F.get(b)??null:null,le=`${f.getFullYear()}\uB144 ${f.getMonth()+1}\uC6D4`;return gt(lo,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${l.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[gt(lo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:l.calendar.headerBg,borderBottom:`1px solid ${l.calendar.borderColor}`,flexShrink:0},children:[gt(lo,{sx:{display:"flex",alignItems:"center",gap:.25},children:[we(_s,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>w(ws(f,-1)),children:we(wg,{sx:{fontSize:20,color:l.colors.textSecondary}})}),we(vg,{size:"small",color:"inherit",onClick:()=>w(Vr(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:l.mode==="dark"?400:500,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary},children:"\uC624\uB298"}),we(_s,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>w(ws(f,1)),children:we(Dg,{sx:{fontSize:20,color:l.colors.textSecondary}})})]}),gt(Ds,{onClick:y=>x(y.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:l.mode==="dark"?400:700,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary,"&:hover":{bgcolor:l.colors.surfaceHover}},children:[le,we(Og,{sx:{fontSize:18,color:l.colors.textMuted}})]})]}),we(lo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:l.calendar.headerBg,borderBottom:`1px solid ${l.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${l.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Hg.map((y,B)=>we(lo,{sx:{height:Ms,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:B===0?l.colors.danger:B===6?l.colors.accentOnSurface:l.colors.textSecondary},children:y},y))}),we(lo,{sx:{flex:1,minHeight:0},children:gt(Eg,{sensors:H,collisionDetection:K,onDragStart:G,onDragOver:R,onDragEnd:Re,onDragCancel:()=>{O(null),P(null)},children:[we(Fg,{style:{height:"100%"},thumb:{width:8},children:we(lo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${l.calendar.borderColor}`,borderBottom:`1px solid ${l.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:C.map(y=>{let B=qe(y);return we(Ug,{dayKey:B,dayNumber:y.getDate(),isToday:B===a,isOtherMonth:y.getMonth()!==f.getMonth(),weekday:y.getDay(),holidayName:S.get(B)??"",tasks:Ie(B),googleEvents:D.get(B)??[],statusOptions:t,previewSeq:fe?.day===B?b:null,myAccountSeq:r,avatarSrcByName:i,onOpenMembers:I,onOpenDetail:d,onTaskContextMenu:p,onAddSchedule:u,canAdd:m},B)})})}),we(Pg,{children:re?gt(lo,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:l.calendar.cellBg,border:`1px solid ${l.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:fa,fontWeight:500,color:l.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[we(lo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:pa[re.priority]}}),re.title]}):null})]})}),we($r,{task:g,avatarSrcByName:i,onClose:()=>I(null)}),we(Mg,{anchorEl:h,open:!!h,onClose:()=>x(null),selectedDate:f,onDateChange:y=>{w(Vr(y)),x(null)}})]})}import{useEffect as Vg,useMemo as Jn,useRef as Gg,useState as ga}from"react";import{Box as Bo,Button as Yg,IconButton as Ps}from"@mui/material";import jg from"@mui/icons-material/ChevronLeft";import Xg from"@mui/icons-material/ChevronRight";import Qg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Jg}from"@ehfuse/mui-datetime-picker";import{jsx as Ze,jsxs as bt}from"react/jsx-runtime";var Zg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function ba(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Rs(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function zs({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onOpenDetail:r,onAddSchedule:i,myAccountSeq:a=0,avatarSrcByName:s,fallbackToStartDate:u=!1}){let m=oe(),[d,p]=ga(()=>ba(new Date)),[l,c]=ga(!1),f=Jn(()=>{let C=new Date(d.getFullYear(),d.getMonth()+1,0).getDate();return Array.from({length:C},(F,D)=>{let Z=new Date(d.getFullYear(),d.getMonth(),D+1);return{ymd:Rs(Z),dayNumber:D+1,weekday:Z.getDay()}})},[d]),w=Jn(()=>{let C=new Map;for(let F of e){let D=F.due_date.slice(0,10)||(u?F.start_date.slice(0,10):"");if(!D)continue;let Z=C.get(D);Z?Z.push(F):C.set(D,[F])}for(let F of C.values())F.sort((D,Z)=>D.completed!==Z.completed?D.completed?1:-1:D.seq-Z.seq);return C},[e,u]),h=Jn(()=>u?e.filter(C=>!C.due_date.slice(0,10)&&!C.start_date.slice(0,10)).sort((C,F)=>C.completed!==F.completed?C.completed?1:-1:C.seq-F.seq):[],[e,u]),[x,g]=ga(null),I=Jn(()=>yn(o),[o]),b=Jn(()=>[d.getFullYear()],[d]),O=qt(b),_=Gg(null),P=n.slice(0,7)===Rs(d).slice(0,7);return Vg(()=>{if(!P)return;let C=S=>{let k=S?.parentElement??null;for(;k;){let H=window.getComputedStyle(k);if(/(auto|scroll)/.test(H.overflowY)&&k.scrollHeight>k.clientHeight)return k;k=k.parentElement}return null},F=()=>{let S=_.current,k=C(S);if(!k||!S)return;let H=S.getBoundingClientRect().top-k.getBoundingClientRect().top+k.scrollTop;k.scrollTop=Math.max(0,H-k.clientHeight/2+S.clientHeight/2)},D=setTimeout(F,100),Z=setTimeout(F,400);return()=>{clearTimeout(D),clearTimeout(Z)}},[P,d]),bt(Bo,{sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:m.colors.surface},children:[bt(Bo,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[Ze(Ps,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>p(C=>new Date(C.getFullYear(),C.getMonth()-1,1)),children:Ze(jg,{sx:{fontSize:20,color:m.colors.textSecondary}})}),Ze(Yg,{size:"small",color:"inherit",onClick:()=>p(ba(new Date)),sx:{minWidth:0,px:1,fontSize:13.5,color:m.mode==="dark"?m.colors.textStrong:m.colors.textPrimary},children:"\uC624\uB298"}),Ze(Ps,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>p(C=>new Date(C.getFullYear(),C.getMonth()+1,1)),children:Ze(Xg,{sx:{fontSize:20,color:m.colors.textSecondary}})}),bt(Bo,{onClick:()=>c(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:m.mode==="dark"?400:700,color:m.mode==="dark"?m.colors.textStrong:m.colors.textPrimary,cursor:"pointer"},children:[d.getFullYear(),"\uB144 ",d.getMonth()+1,"\uC6D4",Ze(Qg,{sx:{fontSize:20,color:m.colors.textMuted}})]})]}),bt(Bo,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${m.calendar.borderColor}`},children:[h.length>0?bt(Bo,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${m.calendar.borderColor}`},children:[bt(Bo,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:m.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",Ze("br",{}),"\uC5C6\uC74C"]}),Ze(Bo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:h.map(C=>Ze(jn,{task:C,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(C.manager_account_seq??0)===a,avatarSrcByName:s,onOpenMembers:g},C.seq))})]}):null,f.map(({ymd:C,dayNumber:F,weekday:D})=>{let Z=O.get(C)??"",S=C===n,k=!!Z||D===0,H=w.get(C)??[],K=I.get(C)??[],G=H.length>0||K.length>0;return bt(Bo,{ref:S?_:void 0,onClick:i?()=>i(C):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:G?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${m.calendar.borderColor}`,...i?{cursor:"pointer"}:{}},children:[Ze(Bo,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:bt(Bo,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Ze(Bo,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:26,height:26,borderRadius:"50%",fontSize:15.5,fontWeight:S?700:500,color:S?m.colors.surface:k?m.colors.danger:D===6?m.colors.accentOnSurface:m.colors.textPrimary,bgcolor:S?m.colors.accentOnSurface:"transparent"},children:F}),Ze(Bo,{component:"span",sx:{fontSize:12.5,color:k?m.colors.danger:D===6?m.colors.accentOnSurface:m.colors.textSecondary},children:Zg[D]})]})}),bt(Bo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[K.map(R=>Ze(Sn,{event:R},R.uid)),H.map(R=>Ze(jn,{task:R,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(R.manager_account_seq??0)===a,avatarSrcByName:s,onOpenMembers:g},R.seq))]})]},C)})]}),Ze($r,{task:x,avatarSrcByName:s,onClose:()=>g(null)}),Ze(Jg,{open:l,centered:!0,monthOnly:!0,onClose:()=>c(!1),selectedDate:d,onDateChange:C=>{p(ba(C)),c(!1)}})]})}import{useCallback as qs,useEffect as As,useMemo as ha,useRef as Yr,useState as jr}from"react";import{Box as Le,Tooltip as Fs}from"@mui/material";import eb from"@ehfuse/overlay-scrollbar";import ob from"@mui/icons-material/CheckCircle";import tb from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as nb,PointerSensor as rb,closestCenter as ib,useSensor as ab,useSensors as lb}from"@dnd-kit/core";import{SortableContext as sb,arrayMove as cb,useSortable as mb,verticalListSortingStrategy as ub}from"@dnd-kit/sortable";import db from"@mui/icons-material/DragIndicator";import{jsx as Ee,jsxs as Lt}from"react/jsx-runtime";var ka=36,pb=48,Ls=40,fb=24,xb=4,gb=14,Ns=36,bb=12.5,Bn=220,hb={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function Zt(e){let o=String(e??"").trim();if(!o)return null;let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?null:t}function Gr(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function Ta(e,o){return Math.round((o.getTime()-e.getTime())/864e5)}function kb({task:e,dragHandle:o,onPointerDown:t,onClick:n}){let r=oe(),i=Yr(null),[a,s]=jr("");return Ee(Fs,{title:a,arrow:!0,enterDelay:300,children:Lt(Le,{onPointerDown:t,onClick:u=>n(e,u),onMouseEnter:()=>{let u=i.current;s(u&&u.scrollWidth>u.clientWidth?e.title:"")},sx:{width:Bn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:r.mode==="dark"||e.completed?400:500,color:e.completed?r.colors.textMuted:r.mode==="dark"?r.colors.textStrong:r.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:r.colors.surfaceHover}},children:[o,Ee(Le,{ref:i,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function Tb({id:e,showIndicator:o,children:t}){let n=oe(),{attributes:r,listeners:i,setNodeRef:a}=mb({id:e});return Lt(Le,{ref:a,sx:{position:"relative"},children:[o?Ee(Le,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:n.colors.accentOnSurface,zIndex:5}}):null,t({...r,...i})]})}function Hs({tasks:e,todayStr:o,onOpenDetail:t,onToggleChecklist:n,onReorderTasks:r,onTaskContextMenu:i}){let a=oe(),s=ha(()=>[...e].sort((k,H)=>{let K=(k.timeline_sort_no??0)>0,G=(H.timeline_sort_no??0)>0;if(K&&G)return(k.timeline_sort_no??0)-(H.timeline_sort_no??0);if(K!==G)return K?-1:1;let R=k.due_date||k.start_date,te=H.due_date||H.start_date;return R!==te?R<te?-1:1:k.seq-H.seq}),[e]),[u,m]=jr(null),[d,p]=jr(null),l=lb(ab(rb,{activationConstraint:{distance:4}})),c=qs(k=>{m(k.over?Number(k.over.id):null)},[]),f=qs(k=>{m(null),p(null);let{active:H,over:K}=k;if(!K||H.id===K.id)return;let G=s.map(ne=>ne.seq),R=G.indexOf(Number(H.id)),te=G.indexOf(Number(K.id));R===-1||te===-1||r(cb(G,R,te))},[s,r]),w=ha(()=>{let k=Zt(o)??new Date,H=k,K=Gr(k,21);for(let te of s){let ne=Zt(te.start_date)??Zt(te.due_date),fe=Zt(te.due_date)??ne;ne&&ne<H&&(H=ne),fe&&fe>K&&(K=fe)}let G=Gr(H,-3),R=Ta(G,Gr(K,3))+1;return Array.from({length:R},(te,ne)=>Gr(G,ne))},[s,o]),h=w[0],x=w.findIndex(k=>qe(k)===o),{dayWidths:g,dayOffsets:I,gridWidth:b}=ha(()=>{let k=w.map((G,R)=>G.getDate()===1||R===0?pb:ka),H=[],K=0;for(let G of k)H.push(K),K+=G;return{dayWidths:k,dayOffsets:H,gridWidth:K}},[w]),O=Bn+b,_=Yr(null),P=k=>{_.current={x:k.clientX,y:k.clientY}},C=(k,H)=>{let K=_.current;_.current=null,!(K&&(Math.abs(H.clientX-K.x)>5||Math.abs(H.clientY-K.y)>5))&&t(k)},F=Yr(null),[D,Z]=jr(!1);As(()=>{let k=F.current?.getScrollContainer();if(!k)return;let H=()=>Z(k.scrollHeight>k.clientHeight);H();let K=new ResizeObserver(H);return K.observe(k),()=>K.disconnect()},[s.length]);let S=Yr(!1);return As(()=>{if(s.length===0||S.current)return;S.current=!0;let k=window.requestAnimationFrame(()=>{let H=F.current?.getScrollContainer();!H||x<0||(H.scrollLeft=Math.max(0,I[x]-ka*3))});return()=>window.cancelAnimationFrame(k)},[s.length]),Ee(Le,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${a.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:a.timeline.headerBg},children:Ee(Le,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:Ee(eb,{ref:F,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:Lt(Le,{sx:{width:O,position:"relative",bgcolor:a.timeline.bg},children:[Lt(Le,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:a.timeline.headerBg,borderBottom:`1px solid ${a.timeline.gridColor}`},children:[Ee(Le,{sx:{width:Bn,height:Ns,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:a.timeline.headerBg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:a.colors.textSecondary},children:"\uC81C\uBAA9"}),w.map((k,H)=>{let K=k.getDay(),G=H===x,R=k.getDate()===1||H===0;return Ee(Le,{sx:{width:g[H],height:Ns,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:bb,fontWeight:G&&a.mode!=="dark"?700:400,color:G?a.timeline.bg:K===0?a.colors.danger:K===6?a.colors.accentOnSurface:a.colors.textSecondary,bgcolor:G?a.colors.danger:"transparent",borderRight:`1px solid ${a.timeline.gridColor}`,whiteSpace:"nowrap"},children:R?`${k.getMonth()+1}/${k.getDate()}`:k.getDate()},qe(k))})]}),Ee(nb,{sensors:l,collisionDetection:ib,onDragStart:k=>p(Number(k.active.id)),onDragOver:c,onDragEnd:f,onDragCancel:()=>{m(null),p(null)},children:Ee(sb,{items:s.map(k=>String(k.seq)),strategy:ub,children:Lt(Le,{sx:{position:"relative"},children:[w.map((k,H)=>{let K=k.getDay(),G=H===x;return!G&&K!==0&&K!==6?null:Ee(Le,{sx:{position:"absolute",top:0,bottom:0,left:Bn+I[H],width:g[H],bgcolor:G?"rgba(229,72,77,0.07)":a.colors.surfaceSubtle,zIndex:0}},`stripe-${qe(k)}`)}),s.map((k,H)=>{let K=Zt(k.start_date)??Zt(k.due_date),G=Zt(k.due_date)??K,R=K?Math.min(w.length-1,Math.max(0,Ta(h,K))):0,te=G?Math.min(w.length-1,Math.max(R,Ta(h,G))):R,ne=hb[k.priority],fe=Bn+I[R]+2,Ie=I[te]+g[te]-I[R]-4,Re=k.checklist??[];return Ee(Tb,{id:String(k.seq),showIndicator:u===k.seq&&d!==k.seq,children:re=>Lt(Le,{sx:{borderBottom:H===s.length-1&&D?"none":`1px solid ${a.timeline.gridColor}`,position:"relative",zIndex:1,opacity:d===k.seq?.45:1},children:[Lt(Le,{onContextMenu:le=>i(k,le),sx:{display:"flex",height:Ls,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[Ee(kb,{task:k,dragHandle:Ee(Le,{component:"span",className:"taskbox-timeline-handle",...re,onClick:le=>le.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:a.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:a.colors.accentOnSurface}},children:(()=>{let le=ze(k.icon||De)??db;return Ee(le,{sx:{fontSize:17}})})()}),onPointerDown:P,onClick:C}),Ee(Fs,{title:`${k.title} (${k.start_date||"?"} ~ ${k.due_date||"?"})`,arrow:!0,enterDelay:300,children:Ee(Le,{onPointerDown:P,onClick:le=>C(k,le),sx:{position:"absolute",top:(Ls-20)/2,left:fe,width:Math.max(ka-4,Ie),height:20,borderRadius:1,bgcolor:ne.bg,border:`1px solid ${ne.border}`,opacity:k.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),Re.map((le,y)=>Ee(Le,{sx:{display:"flex",height:fb,position:"relative",mt:y===0?`${xb}px`:0,mb:y===Re.length-1?`${gb}px`:0},children:Ee(Le,{sx:{width:Bn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:a.timeline.bg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:le.checked?a.colors.textMuted:a.colors.textPrimary},children:Lt(Le,{onClick:()=>n(k.seq,y,!le.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[le.checked?Ee(ob,{sx:{fontSize:17,color:a.colors.accentOnSurface,flexShrink:0}}):Ee(tb,{sx:{fontSize:17,color:a.colors.textMuted,flexShrink:0}}),Ee(Le,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:le.checked?"line-through":"none"},children:le.label})]})})},`${k.seq}-check-${y}`))]})},k.seq)}),s.length===0?Ee(Le,{sx:{py:8,textAlign:"center",color:a.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as en}from"react/jsx-runtime";function fD(e){switch(e.view){case"card":case"kanban":{let{view:o,...t}=e;return en(sa,{...t,columnAxis:o==="kanban"?"status":"project"})}case"sprint":{let{view:o,...t}=e;return en(sa,{...t,columnAxis:"sprint"})}case"calendar":{let{view:o,...t}=e;return en(vs,{...t})}case"month":{let{view:o,...t}=e;return en(Es,{...t})}case"agenda":{let{view:o,...t}=e;return en(zs,{...t})}case"timeline":{let{view:o,...t}=e;return en(Hs,{...t})}default:{let{view:o,...t}=e;return en(is,{...t})}}}var xD=["list","card","kanban","calendar","month","timeline"];import{Box as go}from"@mui/material";function yb(e){let o=String(e??"").trim();if(!o)return 0;let t=0,n=!1;for(let r of o.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let i=parseFloat(r[1]),a=r[2].toLowerCase();n=!0,a==="m"||a==="\uBD84"?t+=i/60:a==="d"||a==="\uC77C"?t+=i*8:t+=i}if(!n){let r=parseFloat(o);Number.isFinite(r)&&(t+=r)}return t}function Ws(e){let o=Math.round(e*10)/10;return`${o%1===0?o.toFixed(0):o.toFixed(1)}\uC2DC\uAC04`}function $s(e,o,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return 0;let n=new Date(`${e}T00:00:00`),r=new Date(`${o}T00:00:00`);if(r<n||r.getTime()-n.getTime()>3660*864e5)return 0;let i=0;for(let a=new Date(n);a<=r;a.setDate(a.getDate()+1)){let s=a.getDay();if(s===0||s===6)continue;let u=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;t.has(u)||(i+=1)}return i}function Ks(e){return e.reduce((o,t)=>t.completed?o:o+yb(t.estimated_time),0)}import{Fragment as Sb,jsx as Nt,jsxs as Ao}from"react/jsx-runtime";function Us(e,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return null;let t=new Date(`${e}T00:00:00`),n=new Date(`${o}T00:00:00`);return Math.round((t.getTime()-n.getTime())/864e5)}function Vs({tasks:e,todayStr:o,showProgress:t=!0,dday:n=null,workdaysLeft:r=null,showPoints:i=!0,showHours:a=!0,showOverdue:s=!0,showInfo:u=!0,inline:m=!1}){let d=oe(),p=e.filter(C=>!C.archived),l=p.filter(C=>C.completed).length,c=p.length>0?Math.round(l/p.length*100):0,f=p.filter(C=>!C.completed&&!C.is_event&&!!C.due_date&&C.due_date.slice(0,10)<o).length,w=p.reduce((C,F)=>F.completed?C:C+(F.story_points??0),0),h=Ks(p),x=t?Nt(go,{sx:{flex:m?"0 0 110px":"1 1 auto",minWidth:0,height:d.summary.gaugeHeight,borderRadius:3,bgcolor:d.summary.gaugeTrackColor},children:Nt(go,{sx:{height:"100%",borderRadius:3,width:`${c}%`,bgcolor:c>=100?d.summary.gaugeCompleteColor:d.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,g=t?Ao(go,{component:"span",sx:{flexShrink:0,fontSize:m?14:13,color:d.summary.textColor},children:[c,"%"]}):null,I={color:d.summary.numberColor,fontWeight:700,fontSize:m?15:14},b=p.length-l,O=Ao(Sb,{children:[m?null:Ao("span",{children:["\uB0A8\uC740 ",Nt(go,{component:"span",sx:I,children:b}),"\uAC74"]}),s&&f>0?Ao(go,{component:"span",sx:{color:d.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",Nt(go,{component:"span",sx:{fontWeight:700,fontSize:m?15:14},children:f}),"\uAC74"]}):null,i&&w>0?Ao("span",{children:[Nt(go,{component:"span",sx:I,children:w}),"SP"]}):null,a&&h>0?Ao("span",{children:["\uC57D ",Nt(go,{component:"span",sx:I,children:Ws(h).replace("\uC2DC\uAC04","")}),"\uC2DC\uAC04"]}):null]}),_=typeof r=="number"&&Number.isFinite(r)?Ao("span",{children:["\uADFC\uBB34\uC77C ",Nt(go,{component:"span",sx:I,children:r}),"\uC77C"]}):null,P=typeof n=="number"&&Number.isFinite(n)?Nt(go,{component:"span",sx:{ml:m?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:d.summary.overdueColor,color:d.colors.textInverse,lineHeight:1.6},children:n===0?"D-day":n>0?`D-${n}`:`D+${-n}`}):null;return m?Ao(go,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:d.summary.textColor,whiteSpace:"nowrap",...d.summary.sx},children:[u?O:null,u?_:null,u?P:null,x,g]}):Ao(go,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[t?Ao(go,{sx:{display:"flex",alignItems:"center",gap:1},children:[x,g]}):null,Ao(go,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:d.summary.textColor},children:[O,_,P]})]})}import{useMemo as Bb}from"react";import{jsx as Cb}from"react/jsx-runtime";function wD({sprint:e,tasks:o,todayStr:t,...n}){let r=e.status==="closed"?null:Us(e.end_date,t),i=r!==null&&r>=0,a=Bb(()=>{if(!i)return[];let m=Number(t.slice(0,4)),d=Number(e.end_date.slice(0,4))||m,p=[];for(let l=m;l<=Math.max(m,d);l+=1)p.push(l);return p},[i,t,e.end_date]),s=qt(a),u=i?$s(t,e.end_date,new Set(s.keys())):null;return Cb(Vs,{tasks:o,todayStr:t,dday:r,workdaysLeft:u,...n})}import{useEffect as Rb,useRef as zb,useState as qb}from"react";import{Box as Sa}from"@mui/material";import{Children as vb}from"react";import{Box as ya,CircularProgress as Ib}from"@mui/material";import{jsx as Xr}from"react/jsx-runtime";var Gs={xs:2,md:3};function Ys(){return Xr(ya,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:Xr(Ib,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function js({children:e}){return Xr(ya,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:Gs,pb:Gs},children:vb.map(e,o=>o==null||o===!1?null:Xr(ya,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:o}))})}import{Box as kt,Button as Ob,Checkbox as Mb,Typography as Ft}from"@mui/material";import Qs from"@mui/icons-material/CheckCircle";import Eb from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as Db,jsx as Xs}from"react/jsx-runtime";var _b="taskbox-search-highlight";function wb(e,o){let t=o?.keyPrefix??"hl";return e.map((n,r)=>Xs("span",{className:n.highlight?o?.highlightClassName??_b:o?.className,style:n.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:n.text},`${t}-${n.text}-${r}`))}function Qr({text:e,keyword:o,fallback:t="-",className:n,highlightClassName:r,keyPrefix:i}){let a=String(e??"").trim()||t,s=_r(a,o);return Xs(Db,{children:wb(s,{className:n,highlightClassName:r,keyPrefix:i})})}import{jsx as pe,jsxs as Cn}from"react/jsx-runtime";var Pb={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:uo(12.5),fontWeight:500,lineHeight:1.4},ht={fontSize:uo(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function Xo({label:e,children:o}){return Cn(kt,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[pe(kt,{sx:Pb,children:e}),pe(kt,{sx:{...ht,flex:1,pt:.2},children:o})]})}function Js({task:e,statusOptions:o,projectLabel:t,searchText:n,todayStr:r,onRequestToggleCompleted:i,onOpenDetail:a,onTaskContextMenu:s,targetSummary:u="",ackInfo:m,completeLocked:d=!1,unread:p=!1,noticeReadOnly:l=!1,onAckConfirm:c,onAckListClick:f,myManaged:w=!1}){let h=e.is_event?$n(e):po(e),x=Go(e.start_date),g=Go(e.due_date),I=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<r,b=(e.receiver_names??[]).filter(Boolean);return Cn(kt,{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),a(e))},onContextMenu:O=>s(e,O),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",position:"relative"},children:[w?pe(kt,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,Cn(kt,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[!l&&!d?pe(Mb,{checked:e.completed,icon:pe(Eb,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:pe(Qs,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:O=>O.stopPropagation(),onChange:(O,_)=>i({anchorEl:O.currentTarget,taskSeq:e.seq,nextCompleted:_}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{let O=ze(e.icon||(e.is_notice?Ro:De));if(!O)return null;let _=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return pe(O,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:_}})})(),pe(Ft,{sx:{fontSize:uo(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":"#111827",textDecoration:e.completed?"line-through":"none"},children:pe(Qr,{text:e.title,keyword:n})}),p?pe(kt,{component:"span",sx:{flexShrink:0,px:.55,fontSize:uo(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),Cn(kt,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[pe(Xo,{label:h?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:Cn(kt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:[h?pe(_e,{option:h,small:!0}):null,pe(zo,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?pe(Xo,{label:"\uB77C\uBCA8",children:pe(Mt,{labelKeys:e.label_keys,labelOptions:o})}):null,t?pe(Xo,{label:"\uD504\uB85C\uC81D\uD2B8",children:pe(Ft,{sx:ht,children:t})}):null,x?pe(Xo,{label:"\uC2DC\uC791",children:pe(Ft,{sx:ht,children:x})}):null,g?pe(Xo,{label:"\uB9C8\uAC10",children:Cn(Ft,{sx:{...ht,color:I?"#e5484d":ht.color,fontWeight:I?600:400},children:[g,I?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?pe(Xo,{label:"\uB300\uC0C1\uC790",children:pe(Ft,{sx:ht,children:u||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&m?pe(Xo,{label:"\uD655\uC778",children:pe(Ob,{size:"small",variant:m.canAck?"contained":"outlined",color:"inherit",startIcon:m.acked?pe(Qs,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:O=>{O.stopPropagation(),m.canAck?c?.(e):f?.(e,O.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:uo(13),...m.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:m.canAck?"\uD655\uC778":`${m.count}/${m.total}`})}):null,!e.is_notice&&e.manager_name?pe(Xo,{label:"\uCC45\uC784\uC790",children:pe(Ft,{sx:ht,children:pe(Qr,{text:e.manager_name,keyword:n})})}):null,!e.is_notice&&b.length>0?pe(Xo,{label:"\uCC38\uC870\uC790",children:pe(Ft,{sx:ht,children:b.join(", ")})}):null,e.note?pe(Xo,{label:"\uBE44\uACE0",children:pe(Ft,{sx:ht,children:pe(Qr,{text:e.note,keyword:n})})}):null]})]})}import{jsx as vn,jsxs as Ab}from"react/jsx-runtime";function oO({tasks:e,statusOptions:o,customTabs:t,loading:n,searchText:r,todayStr:i,onToggleCompleted:a,onOpenDetail:s,onTaskContextMenu:u,getTargetSummary:m,getAckInfo:d,getNoticeReadOnly:p,isTaskUnread:l,getCompleteLocked:c,onAckConfirm:f,onAckListClick:w,onEndReached:h,myAccountSeq:x=0}){let g=new Map(t.map(_=>[_.key,_.label])),[I,b]=qb(null),O=zb(null);return Rb(()=>{let _=O.current;if(!h||!_)return;let P=new IntersectionObserver(C=>{C[0]?.isIntersecting&&h()});return P.observe(_),()=>P.disconnect()},[h,e.length]),e.length===0?n?vn(Ys,{}):vn(Sa,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Ab(Sa,{sx:{minWidth:0},children:[vn(js,{children:e.map(_=>vn(Js,{myManaged:x>0&&!_.is_notice&&!_.is_event&&(_.manager_account_seq??0)===x,task:_,statusOptions:o,projectLabel:_.tab_key?g.get(_.tab_key)??"":"",searchText:r,todayStr:i,onRequestToggleCompleted:b,onOpenDetail:s,onTaskContextMenu:u,targetSummary:_.is_notice?m?.(_):void 0,ackInfo:_.is_notice?d?.(_):void 0,noticeReadOnly:_.is_notice?p?.(_):!1,unread:l?.(_)??!1,completeLocked:c?.(_)??!1,onAckConfirm:f,onAckListClick:w},_.seq))}),h?vn(Sa,{ref:O,sx:{height:"1px"}}):null,vn(Ue,{open:!!I,anchorEl:I?.anchorEl??null,title:I?.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:I?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>b(null),onConfirm:()=>{I&&a(I.taskSeq,I.nextCompleted),b(null)}})]})}import{useEffect as wk,useRef as Dk,useState as Dc}from"react";import{Box as ir,Button as Oc,Divider as Ok,Drawer as Mk,IconButton as qa,Tooltip as Ek}from"@mui/material";import Pk from"@mui/icons-material/Close";import Rk from"@mui/icons-material/ArrowBack";import zk from"@ehfuse/overlay-scrollbar";import{Box as Ba,ButtonBase as Lb,Divider as Nb,Popover as Fb}from"@mui/material";import Hb from"@mui/icons-material/Check";import Wb from"@ehfuse/overlay-scrollbar";import{jsx as on,jsxs as ec}from"react/jsx-runtime";var Zs=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function Jr({anchorEl:e,value:o,color:t="",onSelect:n,onSelectColor:r,onClose:i}){return on(Fb,{transitionDuration:0,open:!!e,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:ec(Ba,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[on(Wb,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:on(Er,{value:o||De,onChange:a=>{n(a),i()}})}),r?ec(Ba,{sx:{px:1.25,pb:1.25},children:[on(Nb,{sx:{mb:1,borderColor:"#efefed"}}),on(Ba,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:Zs.map(a=>{let s=(t||Zs[0])===a;return on(Lb,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${a}`,onClick:()=>r(a),sx:{width:26,height:26,borderRadius:"50%",bgcolor:a,display:"flex",alignItems:"center",justifyContent:"center"},children:s?on(Hb,{sx:{fontSize:15,color:"#ffffff"}}):null},a)})})]}):null]})})}import{useState as Ic}from"react";import{Box as tr,ButtonBase as hk,Divider as nr,Menu as kk,MenuItem as Tk}from"@mui/material";import yk from"@mui/icons-material/SubjectOutlined";import Sk from"@mui/icons-material/StickyNote2Outlined";import Bk from"@mui/icons-material/LabelOutlined";import Ck from"@mui/icons-material/DirectionsRunOutlined";import vk from"@mui/icons-material/SpeedOutlined";import{TextField as Ik}from"@ehfuse/mui-form-controls";import{InfoAlert as _k}from"@ehfuse/alerts";import{useState as Ht}from"react";import{Box as cc,Divider as lh,ListItemIcon as sh,Menu as Ia,MenuItem as Zn}from"@mui/material";import ch from"@mui/icons-material/Add";import ei from"@mui/icons-material/Check";import mh from"@mui/icons-material/ViewKanbanOutlined";import uh from"@mui/icons-material/CalendarTodayOutlined";import dh from"@mui/icons-material/EventOutlined";import ph from"@mui/icons-material/PersonOutlineOutlined";import ic from"@mui/icons-material/PeopleAltOutlined";import fh from"@mui/icons-material/FlagOutlined";import ac from"@mui/icons-material/TimerOutlined";import xh from"@mui/icons-material/NotificationsNoneOutlined";import gh from"@mui/icons-material/InboxOutlined";import bh from"@mui/icons-material/PlaceOutlined";import hh from"@mui/icons-material/MapOutlined";import{DatePicker as kh,TimePicker as lc}from"@ehfuse/mui-datetime-picker";var Qo="@media (max-width: 719.95px)";function so(e){return{[Qo]:{order:e}}}import{useEffect as $b,useState as Kb}from"react";import{Box as Ub}from"@mui/material";import{jsx as Vb}from"react/jsx-runtime";function Tt({value:e,placeholder:o,readOnly:t,onCommit:n}){let r=oe(),[i,a]=Kb(e);return $b(()=>a(e),[e]),Vb(Ub,{component:"input",spellCheck:!1,value:i,readOnly:t,placeholder:o,onChange:s=>a(s.target.value),onBlur:()=>{i.trim()!==e&&n(i.trim())},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:r.colors.textPrimary,caretColor:r.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as Ca}from"@mui/material";import{jsx as Gb,jsxs as oc}from"react/jsx-runtime";function me({icon:e,label:o,onClick:t,sx:n,children:r}){return oc(Ca,{sx:[{display:"flex",alignItems:"center",minHeight:26,[Qo]:{minHeight:25}},...Array.isArray(n)?n:[n]],children:[oc(Ca,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,o]}),Gb(Ca,{onClick:t?i=>t(i.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:t?"pointer":"default","&:hover":t?{bgcolor:"#f2f2f0"}:void 0,[Qo]:{py:.25}},children:r})]})}import{Suspense as Yb,lazy as jb,useEffect as Xb,useState as tc}from"react";import{Box as va,Dialog as Qb,DialogContent as Jb,DialogTitle as Zb,IconButton as nc,Tooltip as eh}from"@mui/material";import oh from"@mui/icons-material/Close";import th from"@mui/icons-material/Search";import{Fragment as ah,jsx as Lo,jsxs as Zr}from"react/jsx-runtime";function nh(e){return Lo(va,{sx:{p:3,fontSize:14,color:"#9a9a97"},children:"\uC8FC\uC18C \uAC80\uC0C9 \uBAA8\uB4C8(react-daum-postcode)\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC785\uB825\uD574 \uC8FC\uC138\uC694."})}var rh=jb(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:nh})));function ih(e){if(e.addressType!=="R")return e.address;let o="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(o+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(o+=o!==""?`, ${e.buildingName}`:e.buildingName),o!==""?`${e.address} (${o})`:e.address}function rc({value:e,placeholder:o="\uC8FC\uC18C \uC785\uB825",readOnly:t,onCommit:n}){let[r,i]=tc(e),[a,s]=tc(!1),u=So().slots?.addressSearch;Xb(()=>i(e),[e]);let m=p=>{i(p),s(!1),p!==e&&n(p)};return Zr(ah,{children:[Zr(va,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[Lo(va,{component:"input",spellCheck:!1,value:r,readOnly:t,placeholder:o,onChange:p=>i(p.target.value),onBlur:()=>{a||r.trim()!==e&&n(r.trim())},onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),!t&&s(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),t?null:Lo(eh,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:Lo(nc,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>s(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:Lo(th,{sx:{fontSize:17}})})})]}),u?Lo(u,{open:a,onComplete:m,onClose:()=>s(!1)}):Zr(Qb,{open:a,onClose:()=>s(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[Zr(Zb,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",Lo(nc,{onClick:()=>s(!1),size:"small",children:Lo(oh,{})})]}),Lo(Jb,{style:{padding:0},dividers:!0,children:a?Lo(Yb,{fallback:null,children:Lo(rh,{onComplete:p=>{m(ih(p))},onClose:()=>s(!1),defaultQuery:r,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as oi,jsx as V,jsxs as No}from"react/jsx-runtime";function Th(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function sc(e){let[o="00",t="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(o)?o:"00",minute:/^\d{2}$/.test(t)?t:"00"}}function tn({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return V(cc,{component:"span",sx:{color:"#9a9a97"},children:e})}function ti({values:e,customTabs:o,avatarSrcByName:t,showEstimatedTime:n=!1,managerLocked:r=!1,notice:i=!1,event:a=!1,readOnly:s=!1,targetSummary:u="",narrowCollapsedSx:m,reminderLocked:d=!1,managerAction:p,hideProject:l=!1,leading:c,trailing:f,onChangeProject:w,onChangeStartDate:h,onChangeDueDate:x,onChangeReminder:g,onChangePriority:I,onChangeEstimatedTime:b,onChangeEventTime:O,onChangeEventPlace:_,onChangeEventAddress:P,onMemberEdit:C,onAddProject:F}){let[D,Z]=Ht(null),[S,k]=Ht(!1),[H,K]=Ht(null),[G,R]=Ht(null),[te,ne]=Ht(null),[fe,Ie]=Ht(null),[Re,re]=Ht(null),[le,y]=Ht(null),B=He(),q=Uo(),N=z=>[so(z),...m?Array.isArray(m)?m:[m]:[]],W=o.find(z=>z.key===e.tabKey),se=o.filter(z=>!z.archived);return No(oi,{children:[No(cc,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",columnGap:3,rowGap:.25,px:2,[Qo]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[c,l?null:V(me,{icon:V(mh,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:s?void 0:z=>Z(z),sx:N(1),children:W?(()=>{let z=ze(W.icon);return No(oi,{children:[z?V(z,{sx:{fontSize:16,color:"#1e3a8a"}}):null,W.label]})})():"\uAE30\uBCF8"}),i?V(me,{icon:V(ic,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:s?void 0:()=>C("targets"),sx:so(7),children:u||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!i&&!a?V(me,{icon:V(ph,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:r||s||!e.managerName&&p?void 0:()=>C("manager"),sx:so(7),children:e.managerName?No(oi,{children:[V(fo,{names:[e.managerName],size:20,avatarSrcByName:t}),e.managerName]}):p??V(tn,{})}):null,a?null:V(me,{icon:V(uh,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC790",onClick:s?void 0:z=>ne(z),sx:so(2),children:e.startDate?Go(e.startDate):V(tn,{})}),i?null:V(me,{icon:V(ic,{sx:{fontSize:17}}),label:a?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:s?void 0:()=>C("receivers"),sx:so(a?7:8),children:e.receiverNames.length>0?No(oi,{children:[V(fo,{names:e.receiverNames,size:20,avatarSrcByName:t}),e.receiverNames.length===1?e.receiverNames[0]:null]}):V(tn,{})}),V(me,{icon:V(dh,{sx:{fontSize:17}}),label:a?"\uB0A0\uC9DC":"\uB9C8\uAC10\uAE30\uD55C",onClick:s?void 0:z=>Ie(z),sx:so(3),children:e.dueDate?Go(e.dueDate):V(tn,{})}),a?V(me,{icon:V(ac,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:s?void 0:z=>y(z),sx:so(4),children:e.eventTime?e.eventTime:V(tn,{label:"\uC885\uC77C"})}):null,a?V(me,{icon:V(bh,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:so(5),children:V(Tt,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:s,onCommit:z=>_?.(z)})}):null,n?V(me,{icon:V(ac,{sx:{fontSize:17}}),label:"\uC608\uC0C1\uC2DC\uAC04",onClick:s?void 0:z=>re(z),sx:N(4),children:e.estimatedTime?e.estimatedTime:V(tn,{})}):null,V(me,{icon:V(xh,{sx:{fontSize:17}}),label:"\uB9AC\uB9C8\uC778\uB354",onClick:s||d?void 0:z=>R(z),sx:N(a?8:5),children:e.reminder==="none"?V(tn,{label:"\uC5C6\uC74C"}):Ji(e.reminder)}),a?V(me,{icon:V(hh,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},so(6)],children:V(rc,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:s,onCommit:z=>P?.(z)})}):null,a?null:V(me,{icon:V(fh,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:s?void 0:z=>K(z),sx:N(6),children:V(zo,{priority:e.priority,small:!0})}),f]}),No(Ia,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>Z(null),...q,children:[No(Zn,{selected:!e.tabKey,onClick:()=>{w(""),Z(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[V(gh,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:V(ei,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),se.map(z=>{let Y=ze(z.icon),ke=e.tabKey===z.key;return No(Zn,{selected:ke,onClick:()=>{w(z.key),Z(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Y?V(Y,{sx:{fontSize:17,color:"#1e3a8a"}}):null,z.label,ke?V(ei,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},z.key)}),F?[V(lh,{},"add-project-divider"),No(Zn,{onClick:()=>k(!0),sx:{fontSize:14,color:"#787774"},children:[V(sh,{children:V(ch,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),F?V(Pr,{open:S,onClose:()=>k(!1),onSubmit:(z,Y,ke)=>{(async()=>{let M=await F(z,Y,ke);M&&w(M)})(),Z(null)}}):null,V(Ia,{transitionDuration:0,anchorEl:H,open:!!H,onClose:()=>K(null),...q,children:["high","medium","low"].map(z=>No(Zn,{selected:e.priority===z,onClick:()=>{I(z),K(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[V(zo,{priority:z,small:!0}),e.priority===z?V(ei,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},z))}),V(Ia,{transitionDuration:0,anchorEl:G,open:!!G,onClose:()=>R(null),...q,children:Qi(a&&!!e.eventTime).map(z=>No(Zn,{selected:e.reminder===z.value,onClick:()=>{g(z.value),R(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[z.label,e.reminder===z.value?V(ei,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},z.value))}),n?V(lc,{anchorEl:Re,open:!!Re,onClose:()=>re(null),value:sc(e.estimatedTime),format:"HH:mm",minuteStep:5,autoApply:!0,centered:B,locale:"ko",onChange:(z,Y)=>{b?.(`${z}:${Y}`),re(null)}}):null,a?V(lc,{anchorEl:le,open:!!le,onClose:()=>y(null),value:sc(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:B,locale:"ko",onChange:(z,Y)=>{O?.(`${z}:${Y}`),y(null)}}):null,V(kh,{anchorEl:te,open:!!te,onClose:()=>ne(null),selectedDate:Th(e.startDate),centered:B,onDateChange:z=>{h(qe(z)),ne(null)}}),V(Pt,{anchorEl:fe,open:!!fe,date:e.dueDate,reminder:e.reminder,hideReminder:d,centered:B,onClose:()=>Ie(null),onDateChange:x,onReminderChange:g})]})}import{useState as yh}from"react";import{Box as Sh,Menu as Bh,MenuItem as Ch}from"@mui/material";import vh from"@mui/icons-material/RepeatOutlined";import Ih from"@mui/icons-material/DevicesOutlined";import _h from"@mui/icons-material/ScreenSearchDesktopOutlined";import wh from"@mui/icons-material/SellOutlined";import Dh from"@mui/icons-material/TaskAltOutlined";import{Fragment as mc,jsx as Ge,jsxs as uc}from"react/jsx-runtime";function _a({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Ge(Sh,{component:"span",sx:{color:"#9a9a97"},children:e})}function ni({values:e,readOnly:o=!1,showResolution:t=!1,onChangeRepro:n,onChangeDevice:r,onChangeWhere:i,onChangeVersion:a,onChangeResolution:s}){let[u,m]=yh(null),d=u?.field==="repro"?Mi:u?.field==="device"?Ei:Pi,p=l=>{u?.field==="repro"?n(l):u?.field==="device"?r(l):u?.field==="resolution"&&s?.(l),m(null)};return uc(mc,{children:[uc(mc,{children:[Ge(me,{icon:Ge(vh,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:o?void 0:l=>m({field:"repro",el:l}),children:Ol(e.repro)||Ge(_a,{label:"\uC120\uD0DD"})}),Ge(me,{icon:Ge(Ih,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:o?void 0:l=>m({field:"device",el:l}),children:Ml(e.device)||Ge(_a,{label:"\uC120\uD0DD"})}),Ge(me,{icon:Ge(_h,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:Ge(Tt,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:o,onCommit:i})}),Ge(me,{icon:Ge(wh,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:Ge(Tt,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:o,onCommit:a})}),t?Ge(me,{icon:Ge(Dh,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:o?void 0:l=>m({field:"resolution",el:l}),children:br(e.resolution)||Ge(_a,{label:"\uC120\uD0DD"})}):null]}),Ge(Bh,{open:!!u,anchorEl:u?.el??null,onClose:()=>m(null),transitionDuration:0,children:d.map(l=>Ge(Ch,{onClick:()=>p(l.key),sx:{fontSize:14},children:l.name},l.key))})]})}import{Box as dc}from"@mui/material";import{jsxs as pc}from"react/jsx-runtime";function Oo({icon:e,title:o,titleExtra:t,children:n}){return pc(dc,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[pc(dc,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:14.5,fontWeight:500,color:"#37352f"},children:[e,o,t]}),n]})}import{useEffect as Oh,useRef as wa,useState as Mh}from"react";import{Box as Da,IconButton as Eh,Tooltip as Ph}from"@mui/material";import Rh from"@mui/icons-material/ContentCopyOutlined";import zh from"@mui/icons-material/Check";import{EhfuseEditor as qh,minimalToolbarOptions as Ah}from"@ehfuse/editor";import{jsx as nn,jsxs as Nh}from"react/jsx-runtime";function Oa(e){let o=e.trim();return o?o.startsWith("<")?e:`<p>${o}</p>`:"<p></p>"}function Lh(e){let o=e.replace(/<br\s*\/?>/gi,`
3
3
  `).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
4
4
  `),t=document.createElement("div");return t.innerHTML=o,(t.textContent??"").replace(/\n{3,}/g,`
5
5
 
6
- `).trim()}function Jr({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180}){let i=ka(null),a=ka(null),l=ka(Date.now()+800),[d,m]=Ch(!1),s=$e();return Bh(()=>{if(n)return;let p=ya(o);a.current===p||a.current===o||(a.current=p,l.current=Date.now()+800,i.current?.setHtml(p))},[e,o,n]),n?Eh(Ta,{sx:{position:"relative",mt:1},children:[tn(Ta,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:ya(o)}}),tn(Ih,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:tn(vh,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Mh(o)).then(()=>{m(!0),window.setTimeout(()=>m(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:d?tn(wh,{sx:{fontSize:17,color:"#2f9e5b"}}):tn(_h,{sx:{fontSize:17}})})})]}):tn(Ta,{sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:tn(Dh,{ref:i,defaultValue:ya(o),showToolbar:!s,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:Oh,locale:"ko",minHeight:r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:p=>{let u=Date.now()<l.current,c=p===a.current;a.current=p,!(u||c)&&t(p)}})})}import{useState as Sa}from"react";import{Box as Wo,IconButton as Ba,Tooltip as Ph}from"@mui/material";import Rh from"@mui/icons-material/Close";import zh from"@mui/icons-material/AddCircle";import qh from"@mui/icons-material/AddTask";import Ah from"@mui/icons-material/Checklist";import Lh from"@mui/icons-material/CheckCircle";import Nh from"@mui/icons-material/Launch";import Fh from"@mui/icons-material/RadioButtonUnchecked";import{Fragment as Hh,jsx as Ue,jsxs as Cn}from"react/jsx-runtime";function Zr({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:a=!1,onConvertToTask:l,onOpenLinkedTask:d,resolveLinkedTask:m}){let[s,p]=Sa(""),[u,c]=Sa(null),[f,_]=Sa(null),x=v=>{let b=v.task_seq?m?.(v.task_seq):void 0;return b?b.completed:v.checked},h=o.filter(x).length,g=()=>{s.trim()&&(t(e,s),p(""))};return Cn(Mo,{icon:Ue(Ah,{sx:{fontSize:19,display:"block"}}),title:Cn(Hh,{children:["\uD560\uC77C",o.length>0?Cn(Wo,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[h," / ",o.length]}):null]}),titleExtra:o.length>0?Ue(Wo,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:Ue(Wo,{sx:{height:"100%",borderRadius:3,width:`${Math.round(h/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[Ue(Wo,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((v,b)=>{let I=v.task_seq?m?.(v.task_seq):void 0,O=x(v),P=!!v.task_seq;return Cn(Wo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[Ue(Wo,{component:"span",onClick:()=>n(e,b,!O),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:O?Ue(Lh,{sx:{fontSize:18,color:"#2f80ed"}}):Ue(Fh,{sx:{fontSize:18,color:"#9a9a97"}})}),u?.index===b?Ue(Wo,{component:"input",autoFocus:!0,spellCheck:!1,value:u.label,enterKeyHint:"done",onChange:S=>c({index:b,label:S.target.value}),onBlur:()=>{u.label.trim()&&u.label.trim()!==v.label&&i?.(e,b,u.label),c(null)},onKeyDown:S=>{S.key==="Enter"&&S.target.blur(),S.key==="Escape"&&c(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):Ue(Wo,{component:"span",onClick:P?v.task_seq&&d?()=>d(v.task_seq):void 0:a||!i?void 0:()=>c({index:b,label:v.label}),sx:{flex:1,minWidth:0,fontSize:14,color:O?"#9a9a97":"#37352f",textDecoration:O?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...P?d?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:a||!i?{}:{cursor:"text"}},children:v.label}),P?Cn(Wo,{component:"span",onClick:v.task_seq&&d?()=>d(v.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...d?{cursor:"pointer"}:{}},children:[Ue(Nh,{sx:{fontSize:12}}),I?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!a&&!P&&l?Ue(Ph,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:Ue(Ba,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:S=>_({anchorEl:S.currentTarget,index:b,label:v.label}),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Ue(qh,{sx:{fontSize:16}})})}):null,a?null:Ue(Ba,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,b),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Ue(Rh,{sx:{fontSize:15}})})]},`${v.label}-${b}`)})}),Cn(Wo,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[Ue(Wo,{component:"input",spellCheck:!1,value:s,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:v=>p(v.target.value),onKeyDown:v=>{v.key==="Enter"&&g()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),Ue(Ba,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!s.trim(),onMouseDown:v=>v.preventDefault(),onClick:g,sx:{flexShrink:0,color:s.trim()?"#2f80ed":"#c9c8c5"},children:Ue(zh,{sx:{fontSize:20}})})]}),Ue(Ge,{open:!!f,anchorEl:f?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>_(null),onConfirm:()=>{f&&l?.(e,f.index,f.label),_(null)}})]})}import{useRef as Gh,useState as Yh}from"react";import{Box as Zo,IconButton as jh}from"@mui/material";import Xh from"@mui/icons-material/Close";import uc from"@mui/icons-material/AttachFileOutlined";var Wh=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),sc=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return Wh.has(o)};import{LinearProgress as $h}from"@mui/material";import{Fragment as Kh,jsx as Vh,jsxs as Uh}from"react/jsx-runtime";function cc(e){let o=it(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),a=n??0;return!a||e>0&&(t??0)!==e?null:{index:a,total:r??0,queue:i??[]}}function Ca(){let o=it().useValue("attachmentUpload.progress");return Uh(Kh,{children:[o??0,"%"]})}function mc(){let o=it().useValue("attachmentUpload.progress");return Vh($h,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as Qh,jsx as ko,jsxs as Xn}from"react/jsx-runtime";function ei(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var oi={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function ti({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:a}){let[l,d]=Yh(!1),m=Gh(null),s=$e(),p=qn(),u=hi(),c=cc(e),f=e===0,_=b=>{if(i){i(b);return}window.open(u(b.uuid??""),"_blank","noopener,noreferrer")},x=b=>{if(a){a(b);return}window.open(u(b.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},h=b=>c?b+1<c.index?"done":b+1===c.index?"uploading":"waiting":"waiting",g=(b,I,O,P={})=>Xn(Zo,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:P.uploading?"#d5e6fb":"#e6e6e3",bgcolor:P.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[Xn(Zo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[ko(uc,{sx:{fontSize:16,color:"#9a9a97"}}),I,ko(Zo,{component:"span",sx:{fontSize:12,color:P.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:O}),P.removeIndex!==void 0?ko(jh,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,P.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:ko(Xh,{sx:{fontSize:15}})}):null]}),P.uploading?ko(mc,{}):null]},b),v=b=>{let I=sc(b.name);return ko(Zo,{component:"button",type:"button",onClick:()=>I?_(b):x(b),title:`${b.name} ${I?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...oi,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:b.name})};return Xn(Mo,{icon:ko(uc,{sx:{fontSize:18,display:"block"}}),title:Xn(Qh,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[Xn(Zo,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((b,I)=>{let O=`${b.uuid||b.name}-${I}`;if(f){let P=h(I),S=P==="uploading";return g(O,ko(Zo,{component:"span",sx:{...oi,color:P==="done"?"#37352f":"#9a9a97"},children:b.name}),S?ko(Ca,{}):ei(b.size),{uploading:S,removeIndex:!r&&!c?I:void 0})}return b.uuid?g(O,v(b),ei(b.size),{removeIndex:r?void 0:I}):g(O,ko(Zo,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...oi,color:"#9a9a97"},children:b.name}),ei(b.size),{removeIndex:r?void 0:I})}),!f&&c?c.queue.slice(c.index-1).map((b,I)=>{let O=I===0;return g(`uploading-${c.index+I}-${b.name}`,ko(Zo,{component:"span",sx:{...oi,color:"#9a9a97"},children:b.name}),O?ko(Ca,{}):ei(b.size),{uploading:O})}):null]}),ko(Zo,{onClick:()=>m.current?.click(),onDragOver:b=>{b.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:b=>{b.preventDefault(),d(!1);let I=Array.from(b.dataTransfer.files);I.length>0&&t(e,I)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:l?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:l?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:s?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`}),ko(Zo,{component:"input",ref:m,type:"file",multiple:!0,onChange:b=>{let I=Array.from(b.target.files??[]);I.length>0&&t(e,I),b.target.value=""},sx:{display:"none"}})]})}import{useState as rk}from"react";import{Checkbox as ik,Divider as ak,ListItemIcon as lk,Menu as sk,MenuItem as xc}from"@mui/material";import ck from"@mui/icons-material/Add";import{useEffect as Jh,useState as dc}from"react";import{Box as va,Button as Zh}from"@mui/material";import{FormDialog as ek}from"@ehfuse/mui-form-dialog";import{ClearTextField as ok}from"@ehfuse/mui-form-controls";import{ColorPicker as tk}from"@ehfuse/mui-color-picker";import{ErrorAlert as nk}from"@ehfuse/alerts";import{jsx as Qn,jsxs as Ia}from"react/jsx-runtime";var pc="#2f80ed";function fc({open:e,onClose:o,onSubmit:t}){let[n,r]=dc(""),[i,a]=dc(pc);Jh(()=>{e&&(r(""),a(pc))},[e]);let l=()=>{let s=n.trim();if(!s){nk("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(s,i),o()},d=vl(i),m=Ia(va,{children:[Ia(va,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[Qn(ok,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:s=>r(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),l())},fullWidth:!0,autoFocus:!0}),Qn(tk,{value:i,onChange:s=>a(s),shape:"circle",colorSize:28})]}),Ia(va,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",Qn(Me,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...d}})]})]});return Qn(ek,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:m}],actions:{showCancelButton:!0,right:Qn(Zh,{variant:"contained",onClick:l,children:"\uCD94\uAC00"})}})}import{Fragment as mk,jsx as vn,jsxs as ni}from"react/jsx-runtime";function ri({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[a,l]=rk(!1),d=Go();return ni(mk,{children:[ni(sk,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...d,children:[t.map(m=>{let s=o.includes(m.key);return ni(xc,{onClick:()=>n(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[vn(ik,{size:"small",checked:s,sx:{p:0}}),vn(Me,{option:m})]},m.key)}),vn(ak,{}),ni(xc,{onClick:()=>l(!0),sx:{fontSize:14,color:"#787774"},children:[vn(lk,{children:vn(ck,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),vn(fc,{open:a,onClose:()=>l(!1),onSubmit:r})]})}function gc(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function bc(e,o){let t=(e.target_account_seqs??[]).filter(p=>p>0);if(t.length===0)return null;let n=new Set(t),r=gc(e,o),i=new Map;for(let p of r){let u=String(p.department??"").trim();if(!u)continue;let c=i.get(u)??[];c.push(p),i.set(u,c)}let a=[],l=new Set;for(let[p,u]of i)if(u.every(f=>n.has(Number(f.account_seq??0)))){a.push(p);for(let f of u)l.add(Number(f.account_seq??0))}let d=new Map(r.map(p=>[Number(p.account_seq??0),p.name])),m=e.target_names??[],s=[];return t.forEach((p,u)=>{l.has(p)||s.push(d.get(p)??m[u]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:s}}function ii(e,o){let t=bc(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function nE(e,o){let t=bc(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function hc(e,o,t){let n=(e.target_account_seqs??[]).filter(s=>s>0),r=gc(e,o),i=n.length>0?n.length:r.length,a=e.acks??[],l=t>0&&a.some(s=>s.account_seq===t),d=t>0&&Number(e.author_account_seq??0)===t,m=n.length===0||n.includes(t);return{count:a.length,total:i,acked:l,canAck:t>0&&!d&&m&&!l&&!e.completed}}function kc(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(l=>l.size>n),i=e.filter(l=>l.size<=n),a=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
7
- \uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(l=>l.name).join(", ")}`:null;return{accepted:i,rejected:r,message:a}}import{Fragment as ai,jsx as he,jsxs as er}from"react/jsx-runtime";var yc="#0f9d58";function Sc({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:a=!1,hideBug:l=!1,hideLabel:d=!1,employees:m=[],myAccountSeq:s=0,onMemberEdit:p,onAddProject:u,onAddLabelOption:c,contentSyncKey:f="create"}){let _=it(),x=qn(),h=e.useFormValue("manager_name"),g=e.useFormValue("receiver_names"),v=e.useFormValue("start_date"),b=!!e.useFormValue("is_event"),I=!!e.useFormValue("is_bug"),O=e.useFormValue("bug_repro")??"",P=e.useFormValue("bug_device")??"",S=e.useFormValue("bug_where")??"",q=e.useFormValue("bug_version")??"",B=e.useFormValue("event_time")??"",oe=e.useFormValue("event_place")??"",y=e.useFormValue("event_address")??"",k=e.useFormValue("due_date"),H=e.useFormValue("reminder"),$=e.useFormValue("priority"),K=e.useFormValue("content"),ae=e.useFormValue("checklist")??[],ie=e.useFormValue("tab_key"),Oe=e.useFormValue("sprint_seq")??0,N=e.useFormValue("story_points")??0,U=t.find(w=>w.key===ie&&w.useSprints),F=U?n.filter(w=>`custom-${w.group_seq}`===ie):[],[V,E]=Tc(null),z=e.useFormValue("label_keys"),[ne,te]=Tc(null),Z=e.useFormValue("target_names"),ye=e.useFormValue("target_account_seqs"),j=_.useValue("createAttachmentFiles")??[],ke=i?ii({author_account_seq:s,target_names:Z,target_account_seqs:ye},m):"";return er(ai,{children:[i?null:he(Jn,{sx:{display:"flex",gap:1.25,px:2,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...l?[]:[{value:"bug",label:"\uC624\uB958"}]].map(w=>{let le=I?"bug":b?"event":"task",xe=le===w.value;return he(uk,{onClick:()=>{if(le===w.value)return;e.setFormValue("is_event",w.value==="event"),e.setFormValue("is_bug",w.value==="bug"),e.setFormValue("is_open",w.value==="bug");let Ne=e.getFormValue("icon"),Je=e.getFormValue("icon_color"),W=[we,"event",An].includes(Ne),X=!Je||Je===yc||Je===Ln;W&&e.setFormValue("icon",w.value==="event"?"event":w.value==="bug"?An:we),X&&e.setFormValue("icon_color",w.value==="event"?yc:w.value==="bug"?Ln:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:xe?600:400,color:xe?"#ffffff":"#787774",bgcolor:xe?"#2563eb":"#f4f4f2"},children:w.label},w.label)})}),he(Zn,{sx:{borderColor:"#e6e6e3"}}),er(Jn,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[he(Xr,{hideProject:a,values:{tabKey:ie,managerName:h,receiverNames:g,startDate:v,dueDate:k,reminder:H,priority:$,eventTime:B,eventPlace:oe,eventAddress:y},customTabs:t,avatarSrcByName:r,notice:i,event:b,onChangeEventTime:w=>e.setFormValue("event_time",w),onChangeEventPlace:w=>e.setFormValue("event_place",w),onChangeEventAddress:w=>e.setFormValue("event_address",w),targetSummary:ke,onChangeProject:w=>e.setFormValue("tab_key",w),onAddProject:u,onChangeStartDate:w=>e.setFormValue("start_date",w),onChangeDueDate:w=>e.setFormValue("due_date",w),onChangeReminder:w=>e.setFormValue("reminder",w),onChangePriority:w=>e.setFormValue("priority",w),onMemberEdit:p,trailing:er(ai,{children:[U&&!b&&!i?er(ai,{children:[he(ue,{icon:he(bk,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:w=>E(w),children:Oe>0?F.find(w=>w.seq===Oe)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":he(Jn,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),he(ue,{icon:he(hk,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:he(ht,{value:N>0?String(N):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:w=>e.setFormValue("story_points",Number(w.replace(/[^0-9.]/g,""))||0)})})]}):null,I?he(Qr,{values:{repro:O,device:P,where:S,version:q},onChangeRepro:w=>e.setFormValue("bug_repro",w),onChangeDevice:w=>e.setFormValue("bug_device",w),onChangeWhere:w=>e.setFormValue("bug_where",w),onChangeVersion:w=>e.setFormValue("bug_version",w)}):null]}),leading:b||d?null:he(Jn,{sx:{gridColumn:"1 / -1"},children:he(ue,{icon:he(gk,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:w=>te(w),children:(z??[]).length>0?he(Ot,{labelKeys:z??[],labelOptions:o}):he(Jn,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),he(Zn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),he(Mo,{icon:he(fk,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:he(Jr,{syncKey:f,value:K,onChange:w=>e.setFormValue("content",w)})}),b?null:he(Zn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),b?null:he(Zr,{taskSeq:0,checklist:ae,onAdd:(w,le)=>e.setFormValue("checklist",[...ae,{label:le,checked:!1}]),onToggle:(w,le,xe)=>e.setFormValue("checklist",ae.map((Ne,Je)=>Je===le?{...Ne,checked:xe}:Ne)),onRemove:(w,le)=>e.setFormValue("checklist",ae.filter((xe,Ne)=>Ne!==le)),onUpdate:(w,le,xe)=>e.setFormValue("checklist",ae.map((Ne,Je)=>Je===le?{...Ne,label:xe}:Ne))}),he(Zn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),he(ti,{taskSeq:0,attachments:j.map(w=>({name:w.name,size:w.size})),onAdd:(w,le)=>{let xe=kc(le,x);xe.message&&Tk(xe.message),xe.accepted.length!==0&&_.setValue("createAttachmentFiles",[..._.getValue("createAttachmentFiles")??[],...xe.accepted])},onRemove:(w,le)=>_.setValue("createAttachmentFiles",j.filter((xe,Ne)=>Ne!==le))}),I?null:er(ai,{children:[he(Zn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),he(Mo,{icon:he(xk,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:he(kk,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),he(dk,{transitionDuration:0,anchorEl:V,open:!!V,onClose:()=>E(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...F.map(w=>({seq:w.seq,label:Do(w)}))].map(w=>he(pk,{onClick:()=>{e.setFormValue("sprint_seq",w.seq),E(null)},sx:{fontSize:14,minWidth:170},children:w.label},w.seq))}),he(ri,{anchorEl:ne,selectedKeys:z??[],labelOptions:o,onToggle:w=>e.setFormValue("label_keys",gr(z??[],w)),onAddLabel:(w,le)=>c?.(w,le),onClose:()=>te(null)})]})}import{Fragment as Dk,jsx as to,jsxs as li}from"react/jsx-runtime";function UE({open:e,onClose:o,...t}){let{form:n,presetDueDate:r="",presetTabKey:i="",presetManager:a=null,isNotice:l=!1,defaultBug:d=!1}=t,m=it(),s=Sk(!1),[p,u]=Bc(0),[c,f]=Bc(null),_=n.useFormValue("title"),x=n.useFormValue("icon"),h=n.useFormValue("icon_color"),g=!!n.useFormValue("is_event"),v=!!n.useFormValue("is_bug"),b=$e(),O=m.useValue("createSubmitting")??!1,P=ur(x||we);return yk(()=>{let S=s.current;s.current=e,!(!e||S)&&(n.setFormValues({...n.getFormValues(),title:"",icon:l?zo:d?An:we,icon_color:l?"#e5484d":d?Ln:"",manager_name:a?.name??"",manager_account_seq:a?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:l,is_event:!1,is_bug:d,is_open:d,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:Le(new Date),due_date:r,reminder:"none",priority:"medium",note:"",content:"",checklist:[],tab_key:i}),m.setValue("createAttachmentFiles",[]),u(q=>q+1))},[e]),li(Dk,{children:[to(Ck,{anchor:"right",open:e,onClose:o,sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:li(or,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[li(or,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[b?to(_a,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:to(_k,{})}):null,to(vk,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:to(_a,{size:"small",onClick:S=>f(S.currentTarget),sx:{color:h||"#1e3a8a"},children:to(P,{sx:{fontSize:20}})})}),to(or,{component:"input",autoFocus:!0,spellCheck:!1,value:_,placeholder:l?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":g?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":v?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:S=>n.setFormValue("title",S.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),b?null:to(_a,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:to(Ik,{})})]}),to(or,{sx:{flex:1,minHeight:0},children:to(wk,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:to(Sc,{...t,contentSyncKey:`create-${p}`})})}),to(Bk,{sx:{borderColor:"#e6e6e3"}}),li(or,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[to(Cc,{onClick:o,color:"inherit",disabled:O,children:"\uCDE8\uC18C"}),to(Cc,{onClick:n.submit,variant:"contained",disabled:O,children:O?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),to(Vr,{anchorEl:c,value:x,color:h||"#1e3a8a",onSelect:S=>n.setFormValue("icon",S),onSelectColor:S=>n.setFormValue("icon_color",S),onClose:()=>f(null)})]})}import{useRef as OT}from"react";import{Box as La,Divider as jc,Drawer as MT}from"@mui/material";import ET from"@ehfuse/overlay-scrollbar";import{useRef as vc,useState as Da}from"react";import{Box as Te,Button as Ic,Chip as Oc,IconButton as nn,Tooltip as Ok}from"@mui/material";import _c from"@mui/icons-material/Send";import{TextField as Mk}from"@ehfuse/mui-form-controls";import Ek from"@mui/icons-material/Close";import Pk from"@mui/icons-material/EditOutlined";import Rk from"@mui/icons-material/Favorite";import zk from"@mui/icons-material/FavoriteBorderOutlined";import qk from"@mui/icons-material/CheckCircle";import Ak from"@mui/icons-material/CheckCircleOutlineOutlined";import Oa from"@mui/icons-material/AttachFileOutlined";import Lk from"@mui/icons-material/ImageOutlined";var wa=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};import{Fragment as Dc,jsx as re,jsxs as no}from"react/jsx-runtime";function wc({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(m=>m.account_seq===t),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",l=r.length===0?a:re(Te,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(m=>`${m.name} \xB7 ${m.time}`).join(`
8
- `)}),d=e==="like"?"#e5484d":"#2f80ed";return re(Ok,{title:l,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:no(Te,{sx:{display:"inline-flex",alignItems:"center"},children:[re(nn,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?d:"#c9c8c5",p:.5},children:e==="like"?i?re(Rk,{sx:{fontSize:16}}):re(zk,{sx:{fontSize:16}}):i?re(qk,{sx:{fontSize:16}}):re(Ak,{sx:{fontSize:16}})}),r.length>0?re(Te,{component:"span",sx:{fontSize:12,color:i?d:"#9a9a97",ml:-.25},children:r.length}):null]})})}function Mc({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:l}){let[d,m]=Da(null),s=Co().slots?.avatar;return no(Te,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[no(Te,{sx:{fontSize:14.5,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),o.length===0?re(Te,{sx:{mt:1,fontSize:13.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,re(Te,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:o.map((p,u)=>no(Te,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let c=r?.get(p.author)??"";return s?re(Te,{sx:{display:"inline-flex",flexShrink:0},children:re(s,{name:p.author,src:c||void 0,size:44})}):re(Te,{sx:{display:"inline-flex",flexShrink:0},children:re(lt,{src:c,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...fn[0]},iconFontSize:24})})})(),no(Te,{sx:{flex:1,minWidth:0},children:[no(Te,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[re(Te,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.author}),re(Te,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:p.time}),no(Te,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[re(wc,{kind:"like",reactions:p.likes,myAccountSeq:n,onToggle:()=>l?.(e,u,"like")}),re(wc,{kind:"ack",reactions:p.acks,myAccountSeq:n,onToggle:()=>l?.(e,u,"ack")})]}),t&&p.author===t?no(Te,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[re(nn,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>m({index:u,text:p.text}),sx:{color:"#9a9a97"},children:re(Pk,{sx:{fontSize:15}})}),re(nn,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:()=>{a(e,u),m(null)},sx:{color:"#9a9a97"},children:re(Ek,{sx:{fontSize:15}})})]}):null]}),d?.index===u?no(Te,{sx:{mt:.5},children:[re(Te,{component:"textarea",autoFocus:!0,spellCheck:!1,value:d.text,onChange:c=>m({index:u,text:c.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),no(Te,{sx:{display:"flex",justifyContent:"flex-end",gap:.75,mt:.5},children:[re(Ic,{size:"small",color:"inherit",onClick:()=>m(null),children:"\uCDE8\uC18C"}),re(Ic,{size:"small",variant:"contained",disabled:!d.text.trim(),onClick:()=>{i(e,u,d.text),m(null)},children:"\uC800\uC7A5"})]})]}):no(Te,{children:[p.text?re(Te,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:p.text}):null,(p.attachments??[]).length>0?re(Te,{sx:{display:"flex",flexWrap:"wrap",gap:.5,mt:.5},children:(p.attachments??[]).map((c,f)=>re(Oc,{size:"small",icon:re(Oa,{sx:{fontSize:14}}),label:`${c.name} (${wa(c.size)})`,sx:{fontSize:12,bgcolor:"#f1f5f9"}},`${c.name}-${f}`))}):null]})]})]},`${p.time}-${u}`))})]})}function Ec({onSubmit:e}){let[o,t]=Da(""),[n,r]=Da([]),i=vc(null),a=vc(null),l=$e(),d=p=>{let u=Array.from(p??[]).map(c=>({name:c.name,size:c.size}));u.length!==0&&r(c=>[...c,...u].slice(0,10))},m=()=>{let p=o.trim();!p&&n.length===0||(e(p,n.length>0?n:void 0),t(""),r([]))},s=no(Dc,{children:[re(nn,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>i.current?.click(),sx:{color:"#9a9a97"},children:re(Oa,{sx:{fontSize:20}})}),re(nn,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>a.current?.click(),sx:{color:"#9a9a97"},children:re(Lk,{sx:{fontSize:20}})})]});return no(Te,{children:[n.length>0?re(Te,{sx:{display:"flex",flexWrap:"wrap",gap:.5,px:2,pt:1},children:n.map((p,u)=>re(Oc,{size:"small",icon:re(Oa,{sx:{fontSize:14}}),label:`${p.name} (${wa(p.size)})`,onDelete:()=>r(c=>c.filter((f,_)=>_!==u)),sx:{fontSize:12,bgcolor:"#f1f5f9"}},`${p.name}-${u}`))}):null,no(Te,{sx:{position:"relative",display:"flex"},children:[re(Mk,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:p=>t(p.target.value),fullWidth:!0,multiline:!0,minRows:l?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:l?15:6.5,pb:l?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),l?no(Te,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[s,re(nn,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:m,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:re(_c,{sx:{fontSize:22}})})]}):no(Dc,{children:[re(Te,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:s}),re(nn,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:m,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:re(_c,{sx:{fontSize:22}})})]})]}),re(Te,{component:"input",ref:i,type:"file",multiple:!0,onChange:p=>{d(p.target.files),p.target.value=""},sx:{display:"none"}}),re(Te,{component:"input",ref:a,type:"file",accept:"image/*",multiple:!0,onChange:p=>{d(p.target.files),p.target.value=""},sx:{display:"none"}})]})}import{useState as zc}from"react";import{Box as Ma,Checkbox as Wk,IconButton as Ea,Tooltip as Pa}from"@mui/material";import $k from"@mui/icons-material/Close";import Kk from"@mui/icons-material/ShareOutlined";import Uk from"@mui/icons-material/ContentPasteOutlined";import Vk from"@mui/icons-material/CheckCircle";import Gk from"@mui/icons-material/CheckCircleOutlineOutlined";import{InfoAlert as Nk,SuccessAlert as Fk}from"@ehfuse/alerts";var Pc=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
6
+ `).trim()}function ri({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180}){let i=wa(null),a=wa(null),s=wa(Date.now()+800),[u,m]=Mh(!1),d=He();return Oh(()=>{if(n)return;let p=Oa(o);a.current===p||a.current===o||(a.current=p,s.current=Date.now()+800,i.current?.setHtml(p))},[e,o,n]),n?Nh(Da,{sx:{position:"relative",mt:1},children:[nn(Da,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:Oa(o)}}),nn(Ph,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:nn(Eh,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Lh(o)).then(()=>{m(!0),window.setTimeout(()=>m(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:u?nn(zh,{sx:{fontSize:17,color:"#2f9e5b"}}):nn(Rh,{sx:{fontSize:17}})})})]}):nn(Da,{sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:nn(qh,{ref:i,defaultValue:Oa(o),showToolbar:!d,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:Ah,locale:"ko",minHeight:r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:p=>{let l=Date.now()<s.current,c=p===a.current;a.current=p,!(l||c)&&t(p)}})})}import{useState as Ma}from"react";import{Box as Fo,IconButton as Ea,Tooltip as Fh}from"@mui/material";import Hh from"@mui/icons-material/Close";import Wh from"@mui/icons-material/AddCircle";import $h from"@mui/icons-material/AddTask";import Kh from"@mui/icons-material/Checklist";import Uh from"@mui/icons-material/CheckCircle";import Vh from"@mui/icons-material/Launch";import Gh from"@mui/icons-material/RadioButtonUnchecked";import{Fragment as Yh,jsx as $e,jsxs as In}from"react/jsx-runtime";function ii({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:a=!1,onConvertToTask:s,onOpenLinkedTask:u,resolveLinkedTask:m}){let[d,p]=Ma(""),[l,c]=Ma(null),[f,w]=Ma(null),h=I=>{let b=I.task_seq?m?.(I.task_seq):void 0;return b?b.completed:I.checked},x=o.filter(h).length,g=()=>{d.trim()&&(t(e,d),p(""))};return In(Oo,{icon:$e(Kh,{sx:{fontSize:19,display:"block"}}),title:In(Yh,{children:["\uD560\uC77C",o.length>0?In(Fo,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[x," / ",o.length]}):null]}),titleExtra:o.length>0?$e(Fo,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:$e(Fo,{sx:{height:"100%",borderRadius:3,width:`${Math.round(x/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[$e(Fo,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((I,b)=>{let O=I.task_seq?m?.(I.task_seq):void 0,_=h(I),P=!!I.task_seq;return In(Fo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[$e(Fo,{component:"span",onClick:()=>n(e,b,!_),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:_?$e(Uh,{sx:{fontSize:18,color:"#2f80ed"}}):$e(Gh,{sx:{fontSize:18,color:"#9a9a97"}})}),l?.index===b?$e(Fo,{component:"input",autoFocus:!0,spellCheck:!1,value:l.label,enterKeyHint:"done",onChange:C=>c({index:b,label:C.target.value}),onBlur:()=>{l.label.trim()&&l.label.trim()!==I.label&&i?.(e,b,l.label),c(null)},onKeyDown:C=>{C.key==="Enter"&&C.target.blur(),C.key==="Escape"&&c(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):$e(Fo,{component:"span",onClick:P?I.task_seq&&u?()=>u(I.task_seq):void 0:a||!i?void 0:()=>c({index:b,label:I.label}),sx:{flex:1,minWidth:0,fontSize:14,color:_?"#9a9a97":"#37352f",textDecoration:_?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...P?u?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:a||!i?{}:{cursor:"text"}},children:I.label}),P?In(Fo,{component:"span",onClick:I.task_seq&&u?()=>u(I.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...u?{cursor:"pointer"}:{}},children:[$e(Vh,{sx:{fontSize:12}}),O?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!a&&!P&&s?$e(Fh,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:$e(Ea,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:C=>w({anchorEl:C.currentTarget,index:b,label:I.label}),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:$e($h,{sx:{fontSize:16}})})}):null,a?null:$e(Ea,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,b),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:$e(Hh,{sx:{fontSize:15}})})]},`${I.label}-${b}`)})}),In(Fo,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[$e(Fo,{component:"input",spellCheck:!1,value:d,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:I=>p(I.target.value),onKeyDown:I=>{I.key==="Enter"&&g()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),$e(Ea,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!d.trim(),onMouseDown:I=>I.preventDefault(),onClick:g,sx:{flexShrink:0,color:d.trim()?"#2f80ed":"#c9c8c5"},children:$e(Wh,{sx:{fontSize:20}})})]}),$e(Ue,{open:!!f,anchorEl:f?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>w(null),onConfirm:()=>{f&&s?.(e,f.index,f.label),w(null)}})]})}import{useRef as ek,useState as ok}from"react";import{Box as Jo,IconButton as tk}from"@mui/material";import nk from"@mui/icons-material/Close";import bc from"@mui/icons-material/AttachFileOutlined";var jh=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),fc=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return jh.has(o)};import{LinearProgress as Xh}from"@mui/material";import{Fragment as Qh,jsx as Zh,jsxs as Jh}from"react/jsx-runtime";function xc(e){let o=rt(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),a=n??0;return!a||e>0&&(t??0)!==e?null:{index:a,total:r??0,queue:i??[]}}function Pa(){let o=rt().useValue("attachmentUpload.progress");return Jh(Qh,{children:[o??0,"%"]})}function gc(){let o=rt().useValue("attachmentUpload.progress");return Zh(Xh,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as rk,jsx as bo,jsxs as er}from"react/jsx-runtime";function ai(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var li={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function si({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:a}){let[s,u]=ok(!1),m=ek(null),d=He(),p=Ln(),l=Ci(),c=xc(e),f=e===0,w=b=>{if(i){i(b);return}window.open(l(b.uuid??""),"_blank","noopener,noreferrer")},h=b=>{if(a){a(b);return}window.open(l(b.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},x=b=>c?b+1<c.index?"done":b+1===c.index?"uploading":"waiting":"waiting",g=(b,O,_,P={})=>er(Jo,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:P.uploading?"#d5e6fb":"#e6e6e3",bgcolor:P.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[er(Jo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[bo(bc,{sx:{fontSize:16,color:"#9a9a97"}}),O,bo(Jo,{component:"span",sx:{fontSize:12,color:P.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:_}),P.removeIndex!==void 0?bo(tk,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,P.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:bo(nk,{sx:{fontSize:15}})}):null]}),P.uploading?bo(gc,{}):null]},b),I=b=>{let O=fc(b.name);return bo(Jo,{component:"button",type:"button",onClick:()=>O?w(b):h(b),title:`${b.name} ${O?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...li,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:b.name})};return er(Oo,{icon:bo(bc,{sx:{fontSize:18,display:"block"}}),title:er(rk,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[er(Jo,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((b,O)=>{let _=`${b.uuid||b.name}-${O}`;if(f){let P=x(O),C=P==="uploading";return g(_,bo(Jo,{component:"span",sx:{...li,color:P==="done"?"#37352f":"#9a9a97"},children:b.name}),C?bo(Pa,{}):ai(b.size),{uploading:C,removeIndex:!r&&!c?O:void 0})}return b.uuid?g(_,I(b),ai(b.size),{removeIndex:r?void 0:O}):g(_,bo(Jo,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...li,color:"#9a9a97"},children:b.name}),ai(b.size),{removeIndex:r?void 0:O})}),!f&&c?c.queue.slice(c.index-1).map((b,O)=>{let _=O===0;return g(`uploading-${c.index+O}-${b.name}`,bo(Jo,{component:"span",sx:{...li,color:"#9a9a97"},children:b.name}),_?bo(Pa,{}):ai(b.size),{uploading:_})}):null]}),bo(Jo,{onClick:()=>m.current?.click(),onDragOver:b=>{b.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:b=>{b.preventDefault(),u(!1);let O=Array.from(b.dataTransfer.files);O.length>0&&t(e,O)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:d?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`}),bo(Jo,{component:"input",ref:m,type:"file",multiple:!0,onChange:b=>{let O=Array.from(b.target.files??[]);O.length>0&&t(e,O),b.target.value=""},sx:{display:"none"}})]})}import{useState as uk}from"react";import{Checkbox as dk,Divider as pk,ListItemIcon as fk,Menu as xk,MenuItem as yc}from"@mui/material";import gk from"@mui/icons-material/Add";import{useEffect as ik,useState as hc}from"react";import{Box as Ra,Button as ak}from"@mui/material";import{FormDialog as lk}from"@ehfuse/mui-form-dialog";import{ClearTextField as sk}from"@ehfuse/mui-form-controls";import{ColorPicker as ck}from"@ehfuse/mui-color-picker";import{ErrorAlert as mk}from"@ehfuse/alerts";import{jsx as or,jsxs as za}from"react/jsx-runtime";var kc="#2f80ed";function Tc({open:e,onClose:o,onSubmit:t}){let[n,r]=hc(""),[i,a]=hc(kc);ik(()=>{e&&(r(""),a(kc))},[e]);let s=()=>{let d=n.trim();if(!d){mk("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(d,i),o()},u=Rl(i),m=za(Ra,{children:[za(Ra,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[or(sk,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:d=>r(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),or(ck,{value:i,onChange:d=>a(d),shape:"circle",colorSize:28})]}),za(Ra,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",or(_e,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...u}})]})]});return or(lk,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:m}],actions:{showCancelButton:!0,right:or(ak,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}import{Fragment as bk,jsx as _n,jsxs as ci}from"react/jsx-runtime";function mi({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[a,s]=uk(!1),u=Uo();return ci(bk,{children:[ci(xk,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...u,children:[t.map(m=>{let d=o.includes(m.key);return ci(yc,{onClick:()=>n(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[_n(dk,{size:"small",checked:d,sx:{p:0}}),_n(_e,{option:m})]},m.key)}),_n(pk,{}),ci(yc,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[_n(fk,{children:_n(gk,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),_n(Tc,{open:a,onClose:()=>s(!1),onSubmit:r})]})}function Sc(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function Bc(e,o){let t=(e.target_account_seqs??[]).filter(p=>p>0);if(t.length===0)return null;let n=new Set(t),r=Sc(e,o),i=new Map;for(let p of r){let l=String(p.department??"").trim();if(!l)continue;let c=i.get(l)??[];c.push(p),i.set(l,c)}let a=[],s=new Set;for(let[p,l]of i)if(l.every(f=>n.has(Number(f.account_seq??0)))){a.push(p);for(let f of l)s.add(Number(f.account_seq??0))}let u=new Map(r.map(p=>[Number(p.account_seq??0),p.name])),m=e.target_names??[],d=[];return t.forEach((p,l)=>{s.has(p)||d.push(u.get(p)??m[l]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:d}}function ui(e,o){let t=Bc(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function yE(e,o){let t=Bc(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function Cc(e,o,t){let n=(e.target_account_seqs??[]).filter(d=>d>0),r=Sc(e,o),i=n.length>0?n.length:r.length,a=e.acks??[],s=t>0&&a.some(d=>d.account_seq===t),u=t>0&&Number(e.author_account_seq??0)===t,m=n.length===0||n.includes(t);return{count:a.length,total:i,acked:s,canAck:t>0&&!u&&m&&!s&&!e.completed}}function vc(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),a=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
7
+ \uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(s=>s.name).join(", ")}`:null;return{accepted:i,rejected:r,message:a}}import{Fragment as di,jsx as he,jsxs as rr}from"react/jsx-runtime";var _c="#0f9d58";function wc({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:a=!1,hideBug:s=!1,hideLabel:u=!1,employees:m=[],myAccountSeq:d=0,onMemberEdit:p,onAddProject:l,onAddLabelOption:c,contentSyncKey:f="create"}){let w=rt(),h=Ln(),x=e.useFormValue("manager_name"),g=e.useFormValue("receiver_names"),I=e.useFormValue("start_date"),b=!!e.useFormValue("is_event"),O=!!e.useFormValue("is_bug"),_=e.useFormValue("bug_repro")??"",P=e.useFormValue("bug_device")??"",C=e.useFormValue("bug_where")??"",F=e.useFormValue("bug_version")??"",D=e.useFormValue("event_time")??"",Z=e.useFormValue("event_place")??"",S=e.useFormValue("event_address")??"",k=e.useFormValue("due_date"),H=e.useFormValue("reminder"),K=e.useFormValue("priority"),G=e.useFormValue("content"),te=e.useFormValue("checklist")??[],ne=e.useFormValue("tab_key"),fe=e.useFormValue("sprint_seq")??0,Ie=e.useFormValue("story_points")??0,Re=t.find(M=>M.key===ne&&M.useSprints),re=Re?n.filter(M=>`custom-${M.group_seq}`===ne):[],[le,y]=Ic(null),B=e.useFormValue("label_keys"),[q,N]=Ic(null),W=e.useFormValue("target_names"),se=e.useFormValue("target_account_seqs"),Y=w.useValue("createAttachmentFiles")??[],ke=i?ui({author_account_seq:d,target_names:W,target_account_seqs:se},m):"";return rr(di,{children:[i?null:he(tr,{sx:{display:"flex",gap:1.25,px:2,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...s?[]:[{value:"bug",label:"\uC624\uB958"}]].map(M=>{let ie=O?"bug":b?"event":"task",xe=ie===M.value;return he(hk,{onClick:()=>{if(ie===M.value)return;e.setFormValue("is_event",M.value==="event"),e.setFormValue("is_bug",M.value==="bug"),e.setFormValue("is_open",M.value==="bug");let Ae=e.getFormValue("icon"),je=e.getFormValue("icon_color"),$=[De,"event",Nn].includes(Ae),j=!je||je===_c||je===Fn;$&&e.setFormValue("icon",M.value==="event"?"event":M.value==="bug"?Nn:De),j&&e.setFormValue("icon_color",M.value==="event"?_c:M.value==="bug"?Fn:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:xe?600:400,color:xe?"#ffffff":"#787774",bgcolor:xe?"#2563eb":"#f4f4f2"},children:M.label},M.label)})}),he(nr,{sx:{borderColor:"#e6e6e3"}}),rr(tr,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[he(ti,{hideProject:a,values:{tabKey:ne,managerName:x,receiverNames:g,startDate:I,dueDate:k,reminder:H,priority:K,eventTime:D,eventPlace:Z,eventAddress:S},customTabs:t,avatarSrcByName:r,notice:i,event:b,onChangeEventTime:M=>e.setFormValue("event_time",M),onChangeEventPlace:M=>e.setFormValue("event_place",M),onChangeEventAddress:M=>e.setFormValue("event_address",M),targetSummary:ke,onChangeProject:M=>e.setFormValue("tab_key",M),onAddProject:l,onChangeStartDate:M=>e.setFormValue("start_date",M),onChangeDueDate:M=>e.setFormValue("due_date",M),onChangeReminder:M=>e.setFormValue("reminder",M),onChangePriority:M=>e.setFormValue("priority",M),onMemberEdit:p,trailing:rr(di,{children:[Re&&!b&&!i?rr(di,{children:[he(me,{icon:he(Ck,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:M=>y(M),children:fe>0?re.find(M=>M.seq===fe)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":he(tr,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),he(me,{icon:he(vk,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:he(Tt,{value:Ie>0?String(Ie):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:M=>e.setFormValue("story_points",Number(M.replace(/[^0-9.]/g,""))||0)})})]}):null,O?he(ni,{values:{repro:_,device:P,where:C,version:F},onChangeRepro:M=>e.setFormValue("bug_repro",M),onChangeDevice:M=>e.setFormValue("bug_device",M),onChangeWhere:M=>e.setFormValue("bug_where",M),onChangeVersion:M=>e.setFormValue("bug_version",M)}):null]}),leading:b||u?null:he(tr,{sx:{gridColumn:"1 / -1"},children:he(me,{icon:he(Bk,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:M=>N(M),children:(B??[]).length>0?he(Mt,{labelKeys:B??[],labelOptions:o}):he(tr,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),he(nr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),he(Oo,{icon:he(yk,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:he(ri,{syncKey:f,value:G,onChange:M=>e.setFormValue("content",M)})}),b?null:he(nr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),b?null:he(ii,{taskSeq:0,checklist:te,onAdd:(M,ie)=>e.setFormValue("checklist",[...te,{label:ie,checked:!1}]),onToggle:(M,ie,xe)=>e.setFormValue("checklist",te.map((Ae,je)=>je===ie?{...Ae,checked:xe}:Ae)),onRemove:(M,ie)=>e.setFormValue("checklist",te.filter((xe,Ae)=>Ae!==ie)),onUpdate:(M,ie,xe)=>e.setFormValue("checklist",te.map((Ae,je)=>je===ie?{...Ae,label:xe}:Ae))}),he(nr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),he(si,{taskSeq:0,attachments:Y.map(M=>({name:M.name,size:M.size})),onAdd:(M,ie)=>{let xe=vc(ie,h);xe.message&&_k(xe.message),xe.accepted.length!==0&&w.setValue("createAttachmentFiles",[...w.getValue("createAttachmentFiles")??[],...xe.accepted])},onRemove:(M,ie)=>w.setValue("createAttachmentFiles",Y.filter((xe,Ae)=>Ae!==ie))}),O?null:rr(di,{children:[he(nr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),he(Oo,{icon:he(Sk,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:he(Ik,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),he(kk,{transitionDuration:0,anchorEl:le,open:!!le,onClose:()=>y(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...re.map(M=>({seq:M.seq,label:wo(M)}))].map(M=>he(Tk,{onClick:()=>{e.setFormValue("sprint_seq",M.seq),y(null)},sx:{fontSize:14,minWidth:170},children:M.label},M.seq))}),he(mi,{anchorEl:q,selectedKeys:B??[],labelOptions:o,onToggle:M=>e.setFormValue("label_keys",Tr(B??[],M)),onAddLabel:(M,ie)=>c?.(M,ie),onClose:()=>N(null)})]})}import{Fragment as qk,jsx as eo,jsxs as pi}from"react/jsx-runtime";function cP({open:e,onClose:o,...t}){let{form:n,presetDueDate:r="",presetTabKey:i="",presetManager:a=null,isNotice:s=!1,defaultBug:u=!1}=t,m=rt(),d=Dk(!1),[p,l]=Dc(0),[c,f]=Dc(null),w=n.useFormValue("title"),h=n.useFormValue("icon"),x=n.useFormValue("icon_color"),g=!!n.useFormValue("is_event"),I=!!n.useFormValue("is_bug"),b=He(),_=m.useValue("createSubmitting")??!1,P=xr(h||De);return wk(()=>{let C=d.current;d.current=e,!(!e||C)&&(n.setFormValues({...n.getFormValues(),title:"",icon:s?Ro:u?Nn:De,icon_color:s?"#e5484d":u?Fn:"",manager_name:a?.name??"",manager_account_seq:a?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:s,is_event:!1,is_bug:u,is_open:u,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:qe(new Date),due_date:r,reminder:"none",priority:"medium",note:"",content:"",checklist:[],tab_key:i}),m.setValue("createAttachmentFiles",[]),l(F=>F+1))},[e]),pi(qk,{children:[eo(Mk,{anchor:"right",open:e,onClose:o,sx:{zIndex:C=>C.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:pi(ir,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[pi(ir,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[b?eo(qa,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:eo(Rk,{})}):null,eo(Ek,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:eo(qa,{size:"small",onClick:C=>f(C.currentTarget),sx:{color:x||"#1e3a8a"},children:eo(P,{sx:{fontSize:20}})})}),eo(ir,{component:"input",autoFocus:!0,spellCheck:!1,value:w,placeholder:s?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":g?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":I?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:C=>n.setFormValue("title",C.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),b?null:eo(qa,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:eo(Pk,{})})]}),eo(ir,{sx:{flex:1,minHeight:0},children:eo(zk,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:eo(wc,{...t,contentSyncKey:`create-${p}`})})}),eo(Ok,{sx:{borderColor:"#e6e6e3"}}),pi(ir,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[eo(Oc,{onClick:o,color:"inherit",disabled:_,children:"\uCDE8\uC18C"}),eo(Oc,{onClick:n.submit,variant:"contained",disabled:_,children:_?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),eo(Jr,{anchorEl:c,value:h,color:x||"#1e3a8a",onSelect:C=>n.setFormValue("icon",C),onSelectColor:C=>n.setFormValue("icon_color",C),onClose:()=>f(null)})]})}import{useRef as AT}from"react";import{Box as Ga,Divider as om,Drawer as LT}from"@mui/material";import NT from"@ehfuse/overlay-scrollbar";import{useRef as Mc,useState as La}from"react";import{Box as Te,Button as Ec,Chip as qc,IconButton as rn,Tooltip as Ak}from"@mui/material";import Pc from"@mui/icons-material/Send";import{TextField as Lk}from"@ehfuse/mui-form-controls";import Nk from"@mui/icons-material/Close";import Fk from"@mui/icons-material/EditOutlined";import Hk from"@mui/icons-material/Favorite";import Wk from"@mui/icons-material/FavoriteBorderOutlined";import $k from"@mui/icons-material/CheckCircle";import Kk from"@mui/icons-material/CheckCircleOutlineOutlined";import Na from"@mui/icons-material/AttachFileOutlined";import Uk from"@mui/icons-material/ImageOutlined";var Aa=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};import{Fragment as zc,jsx as ee,jsxs as oo}from"react/jsx-runtime";function Rc({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(m=>m.account_seq===t),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",s=r.length===0?a:ee(Te,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(m=>`${m.name} \xB7 ${m.time}`).join(`
8
+ `)}),u=e==="like"?"#e5484d":"#2f80ed";return ee(Ak,{title:s,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:oo(Te,{sx:{display:"inline-flex",alignItems:"center"},children:[ee(rn,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?u:"#c9c8c5",p:.5},children:e==="like"?i?ee(Hk,{sx:{fontSize:16}}):ee(Wk,{sx:{fontSize:16}}):i?ee($k,{sx:{fontSize:16}}):ee(Kk,{sx:{fontSize:16}})}),r.length>0?ee(Te,{component:"span",sx:{fontSize:12,color:i?u:"#9a9a97",ml:-.25},children:r.length}):null]})})}function Ac({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:s}){let[u,m]=La(null),d=So().slots?.avatar;return oo(Te,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[oo(Te,{sx:{fontSize:14.5,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),o.length===0?ee(Te,{sx:{mt:1,fontSize:13.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,ee(Te,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:o.map((p,l)=>oo(Te,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let c=r?.get(p.author)??"";return d?ee(Te,{sx:{display:"inline-flex",flexShrink:0},children:ee(d,{name:p.author,src:c||void 0,size:44})}):ee(Te,{sx:{display:"inline-flex",flexShrink:0},children:ee(Vo,{src:c,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...gn[0]},iconFontSize:24})})})(),oo(Te,{sx:{flex:1,minWidth:0},children:[oo(Te,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[ee(Te,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.author}),ee(Te,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:p.time}),oo(Te,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[ee(Rc,{kind:"like",reactions:p.likes,myAccountSeq:n,onToggle:()=>s?.(e,l,"like")}),ee(Rc,{kind:"ack",reactions:p.acks,myAccountSeq:n,onToggle:()=>s?.(e,l,"ack")})]}),t&&p.author===t?oo(Te,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[ee(rn,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>m({index:l,text:p.text}),sx:{color:"#9a9a97"},children:ee(Fk,{sx:{fontSize:15}})}),ee(rn,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:()=>{a(e,l),m(null)},sx:{color:"#9a9a97"},children:ee(Nk,{sx:{fontSize:15}})})]}):null]}),u?.index===l?oo(Te,{sx:{mt:.5},children:[ee(Te,{component:"textarea",autoFocus:!0,spellCheck:!1,value:u.text,onChange:c=>m({index:l,text:c.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),oo(Te,{sx:{display:"flex",justifyContent:"flex-end",gap:.75,mt:.5},children:[ee(Ec,{size:"small",color:"inherit",onClick:()=>m(null),children:"\uCDE8\uC18C"}),ee(Ec,{size:"small",variant:"contained",disabled:!u.text.trim(),onClick:()=>{i(e,l,u.text),m(null)},children:"\uC800\uC7A5"})]})]}):oo(Te,{children:[p.text?ee(Te,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:p.text}):null,(p.attachments??[]).length>0?ee(Te,{sx:{display:"flex",flexWrap:"wrap",gap:.5,mt:.5},children:(p.attachments??[]).map((c,f)=>ee(qc,{size:"small",icon:ee(Na,{sx:{fontSize:14}}),label:`${c.name} (${Aa(c.size)})`,sx:{fontSize:12,bgcolor:"#f1f5f9"}},`${c.name}-${f}`))}):null]})]})]},`${p.time}-${l}`))})]})}function Lc({onSubmit:e}){let[o,t]=La(""),[n,r]=La([]),i=Mc(null),a=Mc(null),s=He(),u=p=>{let l=Array.from(p??[]).map(c=>({name:c.name,size:c.size}));l.length!==0&&r(c=>[...c,...l].slice(0,10))},m=()=>{let p=o.trim();!p&&n.length===0||(e(p,n.length>0?n:void 0),t(""),r([]))},d=oo(zc,{children:[ee(rn,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>i.current?.click(),sx:{color:"#9a9a97"},children:ee(Na,{sx:{fontSize:20}})}),ee(rn,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>a.current?.click(),sx:{color:"#9a9a97"},children:ee(Uk,{sx:{fontSize:20}})})]});return oo(Te,{children:[n.length>0?ee(Te,{sx:{display:"flex",flexWrap:"wrap",gap:.5,px:2,pt:1},children:n.map((p,l)=>ee(qc,{size:"small",icon:ee(Na,{sx:{fontSize:14}}),label:`${p.name} (${Aa(p.size)})`,onDelete:()=>r(c=>c.filter((f,w)=>w!==l)),sx:{fontSize:12,bgcolor:"#f1f5f9"}},`${p.name}-${l}`))}):null,oo(Te,{sx:{position:"relative",display:"flex"},children:[ee(Lk,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:p=>t(p.target.value),fullWidth:!0,multiline:!0,minRows:s?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:s?15:6.5,pb:s?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),s?oo(Te,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[d,ee(rn,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:m,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:ee(Pc,{sx:{fontSize:22}})})]}):oo(zc,{children:[ee(Te,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:d}),ee(rn,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:m,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:ee(Pc,{sx:{fontSize:22}})})]})]}),ee(Te,{component:"input",ref:i,type:"file",multiple:!0,onChange:p=>{u(p.target.files),p.target.value=""},sx:{display:"none"}}),ee(Te,{component:"input",ref:a,type:"file",accept:"image/*",multiple:!0,onChange:p=>{u(p.target.files),p.target.value=""},sx:{display:"none"}})]})}import{useState as Hc}from"react";import{Box as Fa,Checkbox as jk,IconButton as Ha,Tooltip as Wa}from"@mui/material";import Xk from"@mui/icons-material/Close";import Qk from"@mui/icons-material/ShareOutlined";import Jk from"@mui/icons-material/ContentPasteOutlined";import Zk from"@mui/icons-material/CheckCircle";import eT from"@mui/icons-material/CheckCircleOutlineOutlined";import{InfoAlert as Vk,SuccessAlert as Gk}from"@ehfuse/alerts";var Nc=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
9
9
  `).replace(/<\/(p|div|li|h[1-6]|tr)>/gi,`
10
10
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&amp;/gi,"&").replace(/\n{3,}/g,`
11
11
 
12
- `).trim():"";function Hk(e){let o=[`[\uC5C5\uBB34] ${e.title}`],t=Yo(e.start_date),n=Yo(e.due_date);(t||n)&&o.push(`\uAE30\uAC04: ${t&&n?`${t} ~ ${n}`:t||n}`),e.manager_name&&o.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let r=fo(e).name;r&&o.push(`\uC0C1\uD0DC: ${r}`);let i=Pc(e.content);i&&o.push("",i);let a=String(e.note??"").trim();return a&&o.push("",`\uBE44\uACE0: ${a}`),o.join(`
13
- `)}function Rc(e){navigator.clipboard.writeText(e).then(()=>Fk("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Nk("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function si(e,o){let t=Hk(e);if(o&&typeof navigator.share=="function"){navigator.share({text:t}).catch(n=>{n?.name!=="AbortError"&&Rc(t)});return}Rc(t)}import{Fragment as Yk,jsx as ro,jsxs as qc}from"react/jsx-runtime";function Ac({task:e,myAccountSeq:o=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:r,onChangeIconColor:i,onClose:a}){let l=$e(),[d,m]=zc(null),[s,p]=zc(null),u=ur(e.icon||(e.is_notice?zo:e.is_event?"event":we)),c=!!e.is_notice,f=!!e.is_event,_=c&&o>0&&(e.author_account_seq??0)===o,x=!at(e,o),h=!f&&(c?_:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o);return qc(Yk,{children:[qc(Ma,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[h?ro(Pa,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${st(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:ro(Wk,{checked:e.completed,icon:ro(Gk,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:ro(Vk,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(g,v)=>t(e.seq,v),sx:{p:0}})}):null,ro(Pa,{title:x?"":"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:ro(Ea,{size:"small",onClick:x?void 0:g=>p(g.currentTarget),sx:{color:e.icon_color||(c?"#e5484d":"#1e3a8a")},children:ro(u,{sx:{fontSize:20}})})}),d!==null?ro(Ma,{component:"input",autoFocus:!0,spellCheck:!1,value:d,onChange:g=>m(g.target.value),onBlur:()=>{d.trim()&&d.trim()!==e.title&&n(e.seq,d.trim()),m(null)},onKeyDown:g=>{g.key==="Enter"&&g.target.blur(),g.key==="Escape"&&m(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):ro(Ma,{onClick:x?void 0:()=>m(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:x?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),ro(Pa,{title:l?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:ro(Ea,{"aria-label":l?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>si(e,l),sx:{color:"#6b7280"},children:l?ro(Kk,{sx:{fontSize:20}}):ro(Uk,{sx:{fontSize:20}})})}),a?ro(Ea,{"aria-label":"\uB2EB\uAE30",onClick:a,sx:{color:"#6b7280"},children:ro($k,{})}):null]}),ro(Vr,{anchorEl:s,value:e.icon||(c?zo:""),color:e.icon_color||(c?"#e5484d":"#1e3a8a"),onSelect:g=>r(e.seq,g),onSelectColor:g=>i?.(e.seq,g),onClose:()=>p(null)})]})}import{useState as _n}from"react";import{Box as vo,Button as ci,ButtonBase as fT,Divider as an,Menu as xT,MenuItem as gT}from"@mui/material";import bT from"@mui/icons-material/ExpandLess";import hT from"@mui/icons-material/ExpandMore";import kT from"@mui/icons-material/ConfirmationNumberOutlined";import TT from"@mui/icons-material/Check";import yT from"@mui/icons-material/DirectionsRunOutlined";import ST from"@mui/icons-material/SpeedOutlined";import BT from"@mui/icons-material/CheckCircle";import Vc from"@mui/icons-material/CheckCircleOutlined";import Gc from"@mui/icons-material/AccessTimeOutlined";import CT from"@mui/icons-material/AutorenewOutlined";import vT from"@mui/icons-material/LabelOutlined";import IT from"@mui/icons-material/PersonOutlineOutlined";import _T from"@mui/icons-material/SubjectOutlined";import wT from"@mui/icons-material/StickyNote2Outlined";import DT from"@mui/icons-material/PanToolAltOutlined";import{useState as jk}from"react";import{TextField as Xk}from"@ehfuse/mui-form-controls";import{jsx as Qk}from"react/jsx-runtime";function Lc({value:e,onCommit:o,onDraftChange:t,readOnly:n=!1}){let[r,i]=jk(null);return Qk(Xk,{value:r??e,placeholder:n?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:n}},onChange:a=>{i(a.target.value),t?.(a.target.value)},onBlur:()=>{r!==null&&r.trim()!==e&&o(r),i(null)},onKeyDown:a=>{a.key==="Enter"&&a.target.blur(),a.key==="Escape"&&i(null)},sx:{mt:1}})}import{useMemo as $c,useState as qa}from"react";import{Box as io,Button as Kc,IconButton as sT}from"@mui/material";import cT from"@mui/icons-material/AccountTreeOutlined";import mT from"@mui/icons-material/Add";import uT from"@mui/icons-material/Close";import dT from"@mui/icons-material/NextPlanOutlined";function rn(e){return e.relations??[]}function N5(e,o,t){return rn(e).some(n=>n.type===t&&n.task_seq===o.seq)||rn(o).some(n=>n.type===t&&n.task_seq===e.seq)}function Nc(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Fc(e,o){let t=new Map(o.map(c=>[c.seq,c]));t.set(e.seq,e);let n=new Map,r=(c,f)=>{n.has(c)||n.set(c,new Set),n.has(f)||n.set(f,new Set),n.get(c).add(f),n.get(f).add(c)};for(let c of t.values())for(let f of rn(c))f.type==="follow_up"&&t.has(f.task_seq)&&r(c.seq,f.task_seq);let i=new Set([e.seq]),a=[e.seq];for(;a.length>0;){let c=a.shift();for(let f of n.get(c)??[])i.has(f)||(i.add(f),a.push(f))}let l=[...i].map(c=>t.get(c)).filter(c=>!!c).sort((c,f)=>Nc(c).localeCompare(Nc(f))),d=new Set;for(let c of rn(e))c.type==="related"&&d.add(c.task_seq);for(let c of t.values())c.seq!==e.seq&&rn(c).some(f=>f.type==="related"&&f.task_seq===e.seq)&&d.add(c.seq);let m=[...d].map(c=>t.get(c)).filter(c=>c!==void 0&&c.seq!==e.seq),s=[...t.values()].filter(c=>c.seq!==e.seq&&rn(c).some(f=>f.type==="duplicate_of"&&f.task_seq===e.seq)),p=rn(e).find(c=>c.type==="duplicate_of")?.task_seq,u=p?t.get(p)??null:null;return{lineage:l,related:m,duplicates:s,duplicateOf:u}}import{useEffect as Jk,useMemo as Zk,useState as Ra}from"react";import{Box as In,Button as eT,Tab as oT,Tabs as tT}from"@mui/material";import nT from"@mui/icons-material/Check";import{FormDialog as rT}from"@ehfuse/mui-form-dialog";import{ClearTextField as iT}from"@ehfuse/mui-form-controls";import{ErrorAlert as aT}from"@ehfuse/alerts";import{OverlayScrollbar as lT}from"@ehfuse/overlay-scrollbar";import{jsx as Eo,jsxs as za}from"react/jsx-runtime";var Hc=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function Wc({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i}){let[a,l]=Ra("related"),[d,m]=Ra(""),[s,p]=Ra(0);Jk(()=>{e&&(l("related"),m(""),p(0))},[e]);let u=Zk(()=>{let x=new Set([o.seq,...n]),h=d.trim().toLowerCase();return t.filter(g=>x.has(g.seq)||g.is_event||g.is_notice?!1:h?g.title.toLowerCase().includes(h)||(g.ticket_no??"").toLowerCase().includes(h):!0)},[t,o.seq,n,d]),c=()=>{if(!s){aT("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}i(s,a),r()},f=Hc.find(x=>x.type===a)?.hint??"",_=za(In,{children:[Eo(tT,{value:a,onChange:(x,h)=>l(h),sx:{minHeight:38,mb:.75,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Hc.map(x=>Eo(oT,{value:x.type,label:x.label},x.type))}),Eo(In,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:f}),Eo(iT,{label:"\uC5C5\uBB34 \uAC80\uC0C9",placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:d,onChange:x=>m(x.target.value),fullWidth:!0,autoFocus:!0}),Eo(In,{sx:{mt:1.5,height:300,border:"1px solid #e6e6e3",borderRadius:1},children:Eo(lT,{style:{height:"100%"},children:u.length===0?Eo(In,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):u.map(x=>{let h=Pe(x.icon||we),g=x.seq===s;return za(In,{onClick:()=>p(g?0:x.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.75,cursor:"pointer",bgcolor:g?"#e3eefb":"transparent","&:hover":{bgcolor:g?"#e3eefb":"#f7f7f5"}},children:[h?Eo(h,{sx:{fontSize:17,flexShrink:0,color:x.icon_color||"#1e3a8a"}}):null,za(In,{component:"span",sx:{flex:1,minWidth:0,fontSize:14,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[x.ticket_no?`${x.ticket_no} `:"",x.title]}),Eo(Me,{option:fo(x),small:!0}),g?Eo(nT,{sx:{fontSize:17,flexShrink:0,color:"#2f80ed"}}):null]},x.seq)})})})]});return Eo(rT,{open:e,onClose:r,maxWidth:"sm",title:"\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:_}],actions:{showCancelButton:!0,right:Eo(eT,{variant:"contained",disabled:!s,onClick:c,children:"\uC5F0\uACB0"})}})}import{Fragment as pT,jsx as Ae,jsxs as $o}from"react/jsx-runtime";function Aa({item:e,caption:o,onOpen:t,onUnlink:n}){let r=Pe(e.icon||we);return $o(io,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[o?Ae(io,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:o}):null,r?Ae(r,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,$o(io,{component:"span",onClick:t,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...t?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Ae(Me,{option:fo(e),small:!0}),n?Ae(sT,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:n,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Ae(uT,{sx:{fontSize:15}})}):null]})}function Uc({task:e,tasks:o,readOnly:t=!1,onOpenTask:n,onLink:r,onUnlink:i,onCreateFollowUp:a}){let[l,d]=qa(!1),[m,s]=qa(null),[p,u]=qa(null),c=$c(()=>Fc(e,o),[e,o]),f=c.lineage.length>=2,_=(f?c.lineage.length-1:0)+c.related.length+c.duplicates.length+(c.duplicateOf?1:0),x=$c(()=>{let g=new Set;for(let v of c.lineage)g.add(v.seq);for(let v of c.related)g.add(v.seq);for(let v of c.duplicates)g.add(v.seq);return c.duplicateOf&&g.add(c.duplicateOf.seq),[...g]},[c]),h=(g,v,b)=>{u({anchorEl:g,targetSeq:v,type:b})};return $o(Mo,{icon:Ae(cT,{sx:{fontSize:19,display:"block"}}),title:$o(pT,{children:["\uAD00\uB828 \uC5C5\uBB34",_>0?Ae(io,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:_}):null]}),titleExtra:t?null:$o(io,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[a?Ae(Kc,{size:"small",color:"inherit",startIcon:Ae(dT,{sx:{fontSize:16}}),onClick:g=>s(g.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,r?Ae(Kc,{size:"small",color:"inherit",startIcon:Ae(mT,{sx:{fontSize:16}}),onClick:()=>d(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[$o(io,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[f?Ae(io,{sx:{mb:c.related.length||c.duplicates.length||c.duplicateOf?1:0},children:c.lineage.map((g,v)=>{let b=g.seq===e.seq,I=v===c.lineage.length-1;return $o(io,{sx:{display:"flex",gap:1},children:[$o(io,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Ae(io,{sx:{width:b?9:7,height:b?9:7,borderRadius:"50%",bgcolor:b?"#2f80ed":g.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),I?null:Ae(io,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),$o(io,{sx:{flex:1,minWidth:0,pb:I?0:.5},children:[$o(io,{sx:{display:"flex",alignItems:"center",gap:.75},children:[$o(io,{component:"span",onClick:!b&&n?()=>n(g.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:b?600:400,color:b?"#2f80ed":g.completed?"#9a9a97":"#37352f",textDecoration:g.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!b&&n?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[g.ticket_no?`${g.ticket_no} `:"",g.title]}),Ae(Me,{option:fo(g),small:!0})]}),Ae(io,{sx:{fontSize:12,color:"#9a9a97"},children:g.completed&&g.completed_time?`${g.completed_time} \uC644\uB8CC`:g.created_time??""})]})]},g.seq)})}):null,c.duplicateOf?Ae(Aa,{item:c.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:n?()=>n(c.duplicateOf.seq):void 0,onUnlink:!t&&i?g=>h(g.currentTarget,c.duplicateOf.seq,"duplicate_of"):void 0}):null,c.duplicates.map(g=>Ae(Aa,{item:g,caption:"\uC911\uBCF5",onOpen:n?()=>n(g.seq):void 0,onUnlink:!t&&i?v=>h(v.currentTarget,g.seq,"duplicate_of"):void 0},`dup-${g.seq}`)),c.related.map(g=>Ae(Aa,{item:g,onOpen:n?()=>n(g.seq):void 0,onUnlink:!t&&i?v=>h(v.currentTarget,g.seq,"related"):void 0},`rel-${g.seq}`)),_===0?Ae(io,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),r?Ae(Wc,{open:l,task:e,tasks:o,excludeSeqs:x,onClose:()=>d(!1),onSubmit:(g,v)=>r(e.seq,g,v)}):null,Ae(Ge,{open:!!m,anchorEl:m,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:()=>s(null),onConfirm:()=>{a?.(e.seq),s(null)}}),Ae(Ge,{open:!!p,anchorEl:p?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>u(null),onConfirm:()=>{p&&i?.(e.seq,p.targetSeq,p.type),u(null)}})]})}import{Fragment as To,jsx as A,jsxs as Ke}from"react/jsx-runtime";function wn({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return A(vo,{component:"span",sx:{color:"#9a9a97"},children:e})}function Yc({task:e,customTabs:o,statusOptions:t,avatarSrcByName:n,onChangeStatus:r,onChangeLabels:i,onAddLabelOption:a,onChangeProject:l,onAddProject:d,onChangeDate:m,onChangeReminder:s,onMemberEdit:p,onChangePriority:u,onChangeEstimatedTime:c,onChangeEventTime:f,onChangeEventPlace:_,onChangeEventAddress:x,onChangeNote:h,onChangeContent:g,onAddChecklistItem:v,onToggleChecklistItem:b,onRemoveChecklistItem:I,onUpdateChecklistItem:O,onConvertChecklistToTask:P,onOpenChecklistTask:S,resolveChecklistTask:q,relatedTasksPool:B,onOpenRelatedTask:oe,onLinkRelatedTask:y,onUnlinkRelatedTask:k,onCreateFollowUpTask:H,onAddAttachments:$,onRemoveAttachment:K,onPreview:M,onDownload:ae,onUpdateComment:ie,onRemoveComment:Oe,onToggleCommentReaction:N,currentUserName:U="",myAccountSeq:F=0,noticeAdmin:V=!1,hideProject:E=!1,hideLabel:z=!1,employees:ne=[],onAckConfirm:te,onChangeBugField:Z,sprints:ye=[],sprintProject:R=!1,onChangeSprint:j,onChangeStoryPoints:ke,onChangeResolution:w,onClaimTask:le,onVerifyBug:xe}){let[Ne,Je]=_n(null),[W,X]=_n(!1),ze={[Jo]:W?{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"}},[Io,St]=_n(null),[tt,Bt]=_n(null),[Ct,Ro]=_n(null),[vt,nt]=_n(null),lo=!!e.is_notice,eo=!!e.is_event,Vo=!!e.is_bug,So=!!le&&Tr(e,F),En=!!le&&yr(e,F),Ie=!!xe&&Vo&&!!e.completed&&F>0&&(e.author_account_seq??0)===F&&!(e.acks??[]).some(D=>D.account_seq===F),C=!at(e,F),L=lo?!kr(e,F):C,Q=So||En?Ke(xn,{onClick:D=>nt(D.currentTarget),children:[A(DT,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,ce=lo?ii(e,ne):"",ge=lo?hc(e,ne,F):null;return Ke(To,{children:[Ke(vo,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[A(Xr,{hideProject:E,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,estimatedTime:e.estimated_time,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:o,avatarSrcByName:n,showEstimatedTime:!eo,notice:lo,event:eo,readOnly:C,targetSummary:ce,onChangeProject:D=>l(e.seq,D),onAddProject:d,onChangeStartDate:D=>m(e.seq,"start_date",D),onChangeDueDate:D=>m(e.seq,"due_date",D),onChangeReminder:D=>s(e.seq,D),onChangePriority:D=>u(e.seq,D),onChangeEstimatedTime:D=>c(e.seq,D),onChangeEventTime:D=>f?.(e.seq,D),onChangeEventPlace:D=>_?.(e.seq,D),onChangeEventAddress:D=>x?.(e.seq,D),onMemberEdit:D=>p(e,D),narrowCollapsedSx:ze,reminderLocked:e.completed,managerAction:Q,leading:Ke(To,{children:[Ie||Q&&(lo||eo)?Ke(vo,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"center",gap:1,px:2,py:.75},children:[lo||eo?Q:null,Ie?Ke(To,{children:[A(ci,{variant:"contained",size:"small",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uC218\uC815 \uD655\uC778(\uAC80\uC99D \uC644\uB8CC)"}),A(ci,{variant:"outlined",size:"small",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC544\uC9C1 \uC7AC\uD604\uB428(\uC7AC\uC624\uD508)"})]}):null]}):null,Vo&&e.ticket_no?A(ue,{icon:A(kT,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",children:A(vo,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,eo?null:A(vo,{sx:Vo&&e.ticket_no?void 0:{gridColumn:"1 / -1"},children:A(ue,{icon:A(CT,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:C||e.completed?void 0:D=>St(D),children:A(Me,{option:fo(e)})})}),R&&!eo&&!lo?Ke(To,{children:[A(ue,{icon:A(yT,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:C?void 0:D=>Bt(D),children:(e.sprint_seq??0)>0?ye.find(D=>D.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":A(wn,{label:"\uBBF8\uBC30\uC815"})}),A(ue,{icon:A(ST,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:A(ht,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:C,onCommit:D=>ke?.(e.seq,Number(D.replace(/[^0-9.]/g,""))||0)})})]}):null,eo||z?null:A(vo,{sx:[{gridColumn:"1 / -1"},ze??null],children:A(ue,{icon:A(vT,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:C?void 0:D=>Ro(D),children:(e.label_keys??[]).length>0?A(Ot,{labelKeys:e.label_keys??[],labelOptions:t}):A(wn,{})})}),lo&&ge?A(vo,{sx:{gridColumn:"1 / -1"},children:A(ue,{icon:A(Vc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:A(vo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ge.canAck?A(ci,{size:"small",variant:"contained",onClick:()=>te?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):A(ci,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.acked?A(BT,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:D=>Je({anchorEl:D.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ge.total>0&&ge.count>=ge.total?"\uC644\uB8CC":Ke(To,{children:[ge.count,A(vo,{component:"span",sx:{mx:.4},children:"/"}),ge.total]})})})})}):null]}),trailing:Ke(To,{children:[Vo?A(Qr,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:C,showResolution:!!e.completed,onChangeRepro:D=>Z?.(e.seq,"bug_repro",D),onChangeDevice:D=>Z?.(e.seq,"bug_device",D),onChangeWhere:D=>Z?.(e.seq,"bug_where",D),onChangeVersion:D=>Z?.(e.seq,"bug_version",D),onChangeResolution:D=>w?.(e.seq,D)}):null,A(ue,{icon:A(IT,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[co(9),ze??null],children:e.created_by?Ke(To,{children:[A(xo,{names:[e.created_by],size:20,avatarSrcByName:n}),e.created_by]}):A(wn,{})}),A(ue,{icon:A(Gc,{sx:{fontSize:17}}),label:"\uC791\uC131\uC2DC\uAC04",sx:[co(11),ze??null],children:e.created_time?st(e.created_time):A(wn,{})}),e.completed?Ke(To,{children:[A(ue,{icon:A(Vc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[co(10),ze??null],children:e.completed_by?Ke(To,{children:[A(xo,{names:[e.completed_by],size:20,avatarSrcByName:n}),e.completed_by]}):A(wn,{})}),A(ue,{icon:A(Gc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC2DC\uAC04",sx:[co(12),ze??null],children:e.completed_time?st(e.completed_time):A(wn,{})})]}):null]})}),Ke(vo,{sx:{display:"none",[Jo]:{display:"block",mt:1.5}},children:[A(an,{sx:{borderColor:"#e6e6e3"}}),A(fT,{onClick:()=>X(D=>!D),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.5,pb:1.25,fontSize:13,color:"#787774","&:active":{opacity:.6}},children:W?Ke(To,{children:["\uC811\uAE30 ",A(bT,{sx:{fontSize:18}})]}):Ke(To,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",A(hT,{sx:{fontSize:18}})]})})]}),Ke(vo,{children:[A(an,{sx:{my:1.5,borderColor:"#e6e6e3",[Jo]:{mt:0}}}),A(Mo,{icon:A(_T,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:A(vo,{sx:{userSelect:"text"},children:A(Jr,{syncKey:e.seq,value:e.content??"",readOnly:C,onChange:D=>g(e.seq,D)})})}),e.is_bug?null:Ke(To,{children:[A(an,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(Mo,{icon:A(wT,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:A(vo,{sx:{userSelect:"text"},children:A(Lc,{value:e.note,readOnly:L,onCommit:D=>h(e.seq,D)})})})]}),eo?null:Ke(To,{children:[A(an,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(Zr,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:L,onAdd:v,onToggle:b,onRemove:I,onUpdate:O,onConvertToTask:P,onOpenLinkedTask:S,resolveLinkedTask:q})]}),B&&!eo&&!lo?Ke(To,{children:[A(an,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(Uc,{task:e,tasks:B,readOnly:C,onOpenTask:oe,onLink:y,onUnlink:k,onCreateFollowUp:H})]}):null,A(an,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(ti,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:L,onAdd:$,onRemove:K,onPreview:M?D=>M({...D,taskSeq:e.seq}):void 0,onDownload:ae?D=>ae({...D,taskSeq:e.seq}):void 0})]}),A(an,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(Mc,{taskSeq:e.seq,comments:e.comments??[],currentUserName:U,myAccountSeq:F,avatarSrcByName:n,onUpdate:ie,onRemove:Oe,onToggleReaction:N})]}),A(hr,{anchorEl:Io,value:e.status,options:lo?Nn:Vo?$t:Fn,onSelect:D=>r(e.seq,D),onClose:()=>St(null)}),A(xT,{transitionDuration:0,anchorEl:tt,open:!!tt,onClose:()=>Bt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...ye.filter(D=>`custom-${D.group_seq}`===String(e.tab_key??"")).map(D=>({seq:D.seq,label:Do(D)}))].map(D=>Ke(gT,{onClick:()=>{j?.(e.seq,D.seq),Bt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[D.label,(e.sprint_seq??0)===D.seq?A(TT,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},D.seq))}),A(Er,{anchorEl:Ne?.anchorEl??null,open:!!Ne?.open,acks:e.acks??[],total:ge?.total??0,avatarSrcByName:n,onClose:()=>Je(D=>D?{...D,open:!1}:null)}),A(ri,{anchorEl:Ct,selectedKeys:e.label_keys??[],labelOptions:t,onToggle:D=>i(e.seq,gr(e.label_keys??[],D)),onAddLabel:a,onClose:()=>Ro(null)}),A(Ge,{open:!!vt,anchorEl:vt,title:So?"\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:()=>nt(null),onConfirm:()=>{le?.(e.seq),nt(null)}})]})}import{jsx as kt,jsxs as PT}from"react/jsx-runtime";function cR(){let e=new Date,o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function mR({open:e,task:o,onClose:t,onAddComment:n,myAccountSeq:r=0,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:l,onChangeIconColor:d,...m}){let s=OT(null);o&&(s.current=o);let p=o??s.current;return p?kt(MT,{anchor:"right",open:e,onClose:t,sx:{zIndex:u=>u.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:PT(La,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[kt(Ac,{task:p,myAccountSeq:r,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:l,onChangeIconColor:d,onClose:t}),kt(jc,{sx:{borderColor:"#e6e6e3"}}),kt(La,{sx:{flex:1,minHeight:0},children:kt(ET,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:kt(Yc,{...m,task:p,myAccountSeq:r})})}),kt(jc,{sx:{borderColor:"#37352f"}}),kt(La,{sx:{flexShrink:0},children:kt(Ec,{onSubmit:(u,c)=>n(p.seq,u,c)},p.seq)})]})}):null}import{useEffect as zT,useState as ln}from"react";import{Box as yo,Button as Ha,IconButton as Xc}from"@mui/material";import{FormDialog as qT}from"@ehfuse/mui-form-dialog";import AT from"@mui/icons-material/EditOutlined";import{ErrorAlert as Qc}from"@ehfuse/alerts";import{ClearTextField as Jc,DateTextField as Zc,LabelSelect as em}from"@ehfuse/mui-form-controls";var Na="custom-";function RT(e){return e.startsWith(Na)}function pR(e){return e>0?`${Na}${e}`:""}function Fa(e){if(!RT(e))return 0;let o=Number(e.slice(Na.length));return Number.isInteger(o)&&o>0?o:0}import{Fragment as NT,jsx as He,jsxs as Ht}from"react/jsx-runtime";var LT=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function om(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function BR({open:e,customTabs:o,sprints:t,onClose:n,onCreate:r,onUpdate:i,onChangeStatus:a,onRemove:l}){let d=o.filter(y=>y.useSprints&&!y.archived),[m,s]=ln(""),[p,u]=ln(""),[c,f]=ln(""),[_,x]=ln(""),[h,g]=ln(""),[v,b]=ln(!1),[I,O]=ln(0);zT(()=>{e&&(s(d.length===1?d[0].key:""),u(""),f(""),x(""),g(""),O(0))},[e]);let P=()=>{u(""),f(""),x(""),g(""),O(0)},S=y=>{O(y.seq),s(`custom-${y.group_seq}`),u(y.name),f(y.goal),x(y.start_date),g(y.end_date)},q=async()=>{let y=Fa(m);if(!y){Qc("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!p.trim()){Qc("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}b(!0);try{if(I>0){i(I,{name:p.trim(),goal:c.trim(),start_date:_,end_date:h}),P();return}await r({group_seq:y,name:p.trim(),goal:c.trim(),start_date:_,end_date:h})&&P()}finally{b(!1)}},B=new Map(o.map(y=>[Fa(y.key),y.label])),oe=He(yo,{children:d.length===0?He(yo,{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.'}):Ht(NT,{children:[Ht(yo,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[He(em,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:m,options:d.map(y=>({value:y.key,label:y.label})),onChange:y=>s(String(y.target.value)),disabled:I>0}),He(Jc,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:p,onChange:y=>u(y.target.value)}),He(Zc,{size:"medium",label:"\uC2DC\uC791\uC77C",value:_,onChange:y=>x(y.target.value)}),He(Zc,{size:"medium",label:"\uC885\uB8CC\uC77C",value:h,onChange:y=>g(y.target.value)}),He(Jc,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:c,onChange:y=>f(y.target.value),sx:{gridColumn:"1 / -1"}})]}),Ht(yo,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[I>0?He(Ha,{color:"inherit",onClick:P,disabled:v,children:"\uCDE8\uC18C"}):null,He(Ha,{variant:"contained",onClick:()=>{q()},disabled:v,children:I>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),He(yo,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:t.length===0?He(yo,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(y=>Ht(yo,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[Ht(yo,{sx:{minWidth:0},children:[Ht(yo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[He(yo,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:y.name}),He(yo,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:B.get(y.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Ht(yo,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[om(y.start_date)," ~ ",om(y.end_date)]})]}),y.goal?He(yo,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:y.goal}):null]}),Ht(yo,{sx:{display:"flex",alignItems:"center",gap:.5},children:[He(em,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:y.status,options:LT.map(k=>({value:k.value,label:k.label})),onChange:k=>a(y.seq,String(k.target.value)),sx:{width:104,flexShrink:0}}),He(Xc,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>S(y),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:He(AT,{sx:{fontSize:18}})}),He(Xc,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>l(y.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:He(dt,{style:{width:16,height:16}})})]})]},y.seq))})]})});return He(qT,{open:e,onClose:n,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:oe}],actions:{showCancelButton:!1,right:He(Ha,{variant:"contained",onClick:n,children:"\uB2EB\uAE30"})}})}import{useState as tm}from"react";import{Box as Qe,Button as Wa,Divider as FT,IconButton as HT,TextField as WT}from"@mui/material";import{FormDialog as $T}from"@ehfuse/mui-form-dialog";import KT from"@mui/icons-material/OpenInNewOutlined";import UT from"@mui/icons-material/EventOutlined";import{ConfirmDialog as VT}from"@ehfuse/alerts";import{jsx as _e,jsxs as sn}from"react/jsx-runtime";function PR({open:e,imports:o,onRegister:t,onRemove:n,onClose:r}){let[i,a]=tm(""),[l,d]=tm(!1),m=async()=>{let u=i.trim();if(u){d(!0);try{await t(u)&&a("")}finally{d(!1)}}},s=async u=>{await VT({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&n(u.seq)},p=sn(Qe,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[sn(Qe,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",_e("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",_e("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",_e("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),_e(Qe,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),o.length>0?_e(Qe,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:o.map((u,c)=>sn(Qe,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:c>0?"1px solid #efefed":"none"},children:[_e(UT,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),_e(Qe,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),_e(HT,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{s(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:_e(dt,{sx:{fontSize:18}})})]},u.seq))}):_e(Qe,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),_e(FT,{sx:{my:1,borderColor:"#e6e6e3"}}),_e(Qe,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),sn(Qe,{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:[_e(Qe,{children:sn(Qe,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",_e("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),_e(Qe,{children:sn(Qe,{component:"span",children:[_e("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",_e("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),_e(Qe,{children:_e(Qe,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),_e(Qe,{children:_e(Qe,{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."})})]}),sn(Qe,{sx:{display:"flex",gap:2,alignItems:"center"},children:[_e(WT,{value:i,onChange:u=>a(u.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),_e(Wa,{variant:"contained",disabled:!i.trim()||l,onClick:()=>{m()},sx:{flexShrink:0},children:l?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return _e($T,{open:e,onClose:r,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:p}],actions:{showCancelButton:!1,left:_e(Wa,{variant:"outlined",startIcon:_e(KT,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:_e(Wa,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Box as Tt,Button as tr,TextField as GT}from"@mui/material";import{FormDialog as YT}from"@ehfuse/mui-form-dialog";import jT from"@mui/icons-material/ContentCopyOutlined";import nm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as rm}from"@ehfuse/alerts";import{Fragment as QT,jsx as We,jsxs as cn}from"react/jsx-runtime";function XT(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function HR({open:e,feed:o,feedTaskCount:t,buildFeedUrl:n,onSubscribe:r,onClose:i}){let a=n??XT,l=o.subscribed?a(o.token):"",d=()=>{navigator.clipboard.writeText(l).then(()=>rm("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>rm("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},m=()=>{let p=l.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(p)}`,"_blank")},s=cn(Tt,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[cn(Tt,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",We("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),t===0?cn(Tt,{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.",We("br",{}),We("b",{children:"\uB9C8\uAC10\uAE30\uD55C\uC774 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",o.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):o.subscribed&&o.enabled?cn(QT,{children:[We(GT,{value:l,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),cn(Tt,{sx:{display:"flex",gap:2},children:[We(tr,{variant:"outlined",startIcon:We(jT,{}),onClick:d,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),We(tr,{variant:"contained",startIcon:We(nm,{}),onClick:m,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),cn(Tt,{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:[We(Tt,{children:cn("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",We("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),We(Tt,{children:We("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),We(Tt,{children:We("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),We(Tt,{children:We("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."})})]})]}):We(tr,{variant:"contained",onClick:r,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return We(YT,{open:e,onClose:i,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:s}],actions:{showCancelButton:!1,left:We(tr,{variant:"outlined",startIcon:We(nm,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:We(tr,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{useEffect as JT,useMemo as $a,useState as Ka}from"react";import{Box as nr,Button as ZT,Typography as ey}from"@mui/material";import{FormDialog as oy}from"@ehfuse/mui-form-dialog";import{SearchTextField as ty}from"@ehfuse/mui-form-controls";import{TreeView as ny}from"@ehfuse/tree-view";import{Fragment as cy,jsx as Ko,jsxs as my}from"react/jsx-runtime";function im(e){return`${e.name}#${e.seq}`}function ry(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function iy(e){let o=[],t=n=>{for(let r of n.employees??[])o.push(r);for(let r of n.groups??[])t(r)};for(let n of e)t(n);return o}function ay(e,o){return o?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(t=>String(t).toLowerCase().includes(o)):!0}function ly(e){let o=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:im(e),renderLabel:Ko(nr,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:Ko(nr,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:o})})}}function am(e,o){let t=(e.groups??[]).map(r=>am(r,o)).filter(r=>r!==null),n=(e.employees??[]).filter(r=>ay(r,o)).map(ly);return t.length===0&&n.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...t,...n]}}function sy({groups:e,allEmployees:o,initialSelectedSeqs:t,multiple:n,isMobile:r,onSelectionChange:i}){let[a,l]=Ka(""),d=$a(()=>e.map(s=>am(s,a.trim().toLowerCase())).filter(s=>s!==null),[e,a]),m=$a(()=>o.filter(s=>t.includes(s.seq)).map(im),[]);return my(cy,{children:[Ko(nr,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:Ko(ty,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:l,onClear:()=>l(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),Ko(nr,{sx:r?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:Ko(ny,{items:d,checkbox:!0,multiSelect:n,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:m,onChange:s=>i(s.map(ry).filter(p=>p>0)),styles:{border:"none",borderRadius:"0"}})})]})}function XR({open:e,title:o="\uC9C1\uC6D0 \uC120\uD0DD",hint:t="",groups:n,multiple:r=!1,selectedSeqs:i,confirmText:a="\uD655\uC778",onConfirm:l,onClose:d}){let m=$e(),[s,p]=Ka([]),[u,c]=Ka(0),f=$a(()=>iy(n),[n]),_=i??[];JT(()=>{e&&(p(_),c(h=>h+1))},[e]);let x=()=>{let h=f.filter(g=>s.includes(g.seq));l(r?h:h.slice(0,1)),d()};return Ko(oy,{open:e,onClose:d,title:`${o}${r&&s.length>0?` (${s.length}\uBA85)`:""}`,locale:"ko",fullScreen:m,mobilePresentation:m?"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:Ko(nr,{sx:{...m?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...m?{}:{overflow:"hidden"},userSelect:"none"},children:Ko(sy,{groups:n,allEmployees:f,initialSelectedSeqs:_,multiple:r,isMobile:m,onSelectionChange:p},u)})}],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:t?Ko(ey,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:t}):void 0,right:Ko(ZT,{variant:"contained",onClick:x,children:a})}})}import{useEffect as fy,useMemo as xy,useState as gy}from"react";import{Box as Mn,Button as by,Divider as hy}from"@mui/material";import{FormDialog as ky}from"@ehfuse/mui-form-dialog";import{LabelSelect as Ty}from"@ehfuse/mui-form-controls";import{Box as et}from"@mui/material";import{jsx as Dn,jsxs as On}from"react/jsx-runtime";function uy(e,o){let t=o.filter(n=>n.sprint_seq===e.seq&&!n.archived&&n.completed);return{points:t.reduce((n,r)=>n+(r.story_points??0),0),count:t.length}}function lm({sprints:e,tasks:o,height:t=160}){let r=[...e].sort((s,p)=>`${s.start_date}|${s.seq}`.localeCompare(`${p.start_date}|${p.seq}`)).map(s=>({sprint:s,...uy(s,o)})),i=r.some(s=>s.points>0),a=r.map(s=>i?s.points:s.count),l=Math.max(1,...a),d=r.filter(s=>s.sprint.status==="closed").map(s=>i?s.points:s.count),m=d.length>0?Math.round(d.reduce((s,p)=>s+p,0)/d.length*10)/10:null;return r.length===0?Dn(et,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):On(et,{children:[On(et,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[On("span",{children:["\uC644\uB8CC ",i?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),m!==null?On("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",Dn(et,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:m}),i?"SP":"\uAC74"]}):null]}),Dn(et,{sx:{display:"flex",alignItems:"flex-end",gap:2,height:t,px:.5},children:r.map(s=>{let p=i?s.points:s.count,u=Math.round((t-24)*p/l),c=s.sprint.status==="closed";return On(et,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:[Dn(et,{sx:{fontSize:14,fontWeight:700,color:"#37352f",lineHeight:1.5},children:p}),Dn(et,{sx:{width:"60%",maxWidth:56,height:Math.max(2,u),borderRadius:"4px 4px 0 0",bgcolor:c?"#2f80ed":"#a9c9f5"}})]},s.sprint.seq)})}),Dn(et,{sx:{display:"flex",gap:2,px:.5,mt:.5},children:r.map(s=>On(et,{sx:{flex:1,minWidth:0,textAlign:"center",fontSize:13.5,color:"#000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[s.sprint.name,s.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""]},s.sprint.seq))})]})}import{useMemo as dy}from"react";import{Box as mn}from"@mui/material";import{jsx as ot,jsxs as un}from"react/jsx-runtime";function sm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function py(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Ua(e){return e.slice(5).replace("-",".")}function cm({sprint:e,tasks:o,todayStr:t,height:n=200}){let r=dy(()=>{let h=sm(e.start_date),g=sm(e.end_date);if(!h||!g||g<h||Math.round((g.getTime()-h.getTime())/864e5)+1>366)return null;let b=o.filter(y=>y.sprint_seq===e.seq&&!y.archived);if(b.length===0)return{empty:!0};let I=b.some(y=>(y.story_points??0)>0),O=y=>I?y.story_points??0:1,P=b.reduce((y,k)=>y+O(k),0),S=new Map;for(let y of b){if(!y.completed)continue;let k=(y.completed_time??"").slice(0,10),H=/^\d{4}-\d{2}-\d{2}$/.test(k)?k:e.start_date;S.set(H,(S.get(H)??0)+O(y))}let q=[];for(let y=new Date(h);y<=g;y.setDate(y.getDate()+1))q.push(py(y));let B=P,oe=[];for(let y of q){if(y>t)break;B-=S.get(y)??0,oe.push({day:y,value:Math.max(0,B)})}return{empty:!1,days:q,total:P,usePoints:I,actual:oe}},[e,o,t]);if(!r)return ot(mn,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\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."});if(r.empty)return ot(mn,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let{days:i,total:a,usePoints:l,actual:d}=r,m=600,s=200,p=8,u=h=>i.length===1?0:h/(i.length-1)*m,c=h=>p+(s-p*2)*(1-h/Math.max(1,a)),f=`${u(0)},${c(a)} ${u(i.length-1)},${c(0)}`,_=d.map(h=>`${u(i.indexOf(h.day))},${c(h.value)}`).join(" "),x=d[d.length-1];return un(mn,{children:[un(mn,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[un("span",{children:["\uB0A8\uC740 ",l?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",a]}),x?un("span",{children:["\uD604\uC7AC"," ",ot(mn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:x.value}),l?"SP":"\uAC74"," \uB0A8\uC74C"]}):null]}),ot(mn,{sx:{border:"1px solid #e6e6e3",borderRadius:1,bgcolor:"#fafaf9",px:1,py:.5},children:un("svg",{viewBox:`0 0 ${m} ${s}`,preserveAspectRatio:"none",style:{display:"block",width:"100%",height:n},children:[ot("line",{x1:0,y1:c(0),x2:m,y2:c(0),stroke:"#e6e6e3",strokeWidth:1}),ot("polyline",{points:f,fill:"none",stroke:"#9a9a97",strokeWidth:1.5,strokeDasharray:"6 5",vectorEffect:"non-scaling-stroke"}),d.length>1?ot("polyline",{points:_,fill:"none",stroke:"#2f80ed",strokeWidth:2.5,vectorEffect:"non-scaling-stroke"}):null,x?ot("circle",{cx:u(i.indexOf(x.day)),cy:c(x.value),r:4,fill:"#2f80ed",vectorEffect:"non-scaling-stroke"}):null]})}),un(mn,{sx:{mt:.5,display:"flex",justifyContent:"space-between",fontSize:13.5,color:"#000"},children:[ot("span",{children:Ua(e.start_date)}),t>e.start_date&&t<e.end_date?un("span",{children:["\uC624\uB298 ",Ua(t)]}):null,ot("span",{children:Ua(e.end_date)})]})]})}import{jsx as yt,jsxs as Va}from"react/jsx-runtime";function p2({open:e,sprints:o,tasks:t,todayStr:n,initialSprintSeq:r=0,onClose:i}){let[a,l]=gy(0);fy(()=>{if(!e)return;let s=o.find(u=>u.status==="active")??o[0],p=o.find(u=>u.seq===r)??s;l(p?.seq??0)},[e]);let d=xy(()=>o.find(s=>s.seq===a)??null,[o,a]),m=Va(Mn,{sx:{display:"flex",flexDirection:"column"},children:[Va(Mn,{sx:{px:3,py:2.5},children:[yt(Mn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBCA8\uB85C\uC2DC\uD2F0"}),yt(lm,{sprints:o,tasks:t})]}),yt(hy,{sx:{borderColor:"#e6e6e3"}}),Va(Mn,{sx:{px:3,py:2.5},children:[yt(Mn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBC88\uB2E4\uC6B4"}),yt(Ty,{label:"\uBAA9\uD45C",showLabel:!1,value:a?String(a):"",options:o.map(s=>({value:String(s.seq),label:Do(s)})),onChange:s=>l(Number(s.target.value)||0),sx:{width:280,mb:2}}),d?yt(cm,{sprint:d,tasks:t,todayStr:n}):yt(Mn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694."})]})]});return yt(ky,{open:e,onClose:i,width:680,title:"\uBAA9\uD45C \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[{id:"sprint-charts",showTitle:!1,children:m}],actions:{showCancelButton:!1,right:yt(by,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Checkbox as yy,Divider as Sy,Menu as By,MenuItem as Ga}from"@mui/material";import{jsx as rr,jsxs as mm}from"react/jsx-runtime";function h2({anchorEl:e,candidates:o,selectedNames:t,avatarSrcByName:n,onToggle:r,onClear:i,onClose:a}){return mm(By,{anchorEl:e,open:!!e,onClose:a,transitionDuration:0,children:[o.length===0?rr(Ga,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):o.map(l=>{let d=t.includes(l.name);return mm(Ga,{onClick:()=>r(l),sx:{fontSize:14,minWidth:170,gap:1},children:[rr(yy,{size:"small",checked:d,sx:{p:0}}),rr(xo,{names:[l.name],size:20,avatarSrcByName:n}),l.name]},`${l.accountSeq}-${l.name}`)}),rr(Sy,{}),rr(Ga,{disabled:t.length===0,onClick:i,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as Cy}from"react";import{ButtonBase as vy,Menu as Iy,MenuItem as _y}from"@mui/material";import wy from"@mui/icons-material/KeyboardArrowDown";import Dy from"@mui/icons-material/Check";import{Fragment as Oy,jsx as Ya,jsxs as ja}from"react/jsx-runtime";function I2({value:e,onChange:o,options:t}){let[n,r]=Cy(null),i=t??Ri,a=Ri.find(l=>l.value===e)?.label??"";return ja(Oy,{children:[ja(vy,{onClick:l=>r(l.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[a,Ya(wy,{sx:{fontSize:17,color:"#9a9a97"}})]}),Ya(Iy,{transitionDuration:0,anchorEl:n,open:!!n,onClose:()=>r(null),children:i.map(l=>ja(_y,{selected:l.value===e,onClick:()=>{o(l.value),r(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[l.label,l.value===e?Ya(Dy,{sx:{fontSize:16,color:"#2f80ed"}}):null]},l.value))})]})}import{Box as ui,ButtonBase as My}from"@mui/material";import{DateTextField as um}from"@ehfuse/mui-form-controls";function dn(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function mi(e,o=new Date){let t=new Date(o);return t.setMonth(t.getMonth()-e),t}function D2(e=new Date){return{fromDate:dn(mi(1,e)),toDate:dn(e)}}import{jsx as ir,jsxs as dm}from"react/jsx-runtime";var Ey=[{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 pm({fromDate:e,toDate:o,onChange:t}){let n=i=>{if(i<=0){t("","");return}t(dn(mi(i)),dn(new Date))},r=i=>i<=0?!e&&!o:!e||!o?!1:e===dn(mi(i))&&o===dn(new Date);return dm(ui,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[ir(ui,{sx:{display:"flex",alignItems:"center",gap:1.5},children:Ey.map(i=>{let a=r(i.months);return ir(My,{onClick:()=>n(i.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:a?500:400,border:"1px solid",borderColor:a?"#2f80ed":"#dedddb",color:a?"#2f80ed":"#37352f",bgcolor:a?"#eef6ff":"transparent","&:hover":{bgcolor:a?"#eef6ff":"#f7f7f5"}},children:i.label},i.label)})}),dm(ui,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ir(um,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:i=>t(i.target.value,o),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),ir(ui,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),ir(um,{value:o,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:i=>t(e,i.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as Py}from"@mui/material";import{jsx as fm}from"react/jsx-runtime";function L2({anchorEl:e,fromDate:o,toDate:t,onChange:n,onClose:r}){return fm(Py,{transitionDuration:0,anchorEl:e,open:!!e,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:fm(pm,{fromDate:o,toDate:t,onChange:n})})}import{Box as Ry,ButtonBase as zy,Tab as qy,Tabs as Ay}from"@mui/material";import Ly from"@mui/icons-material/Checklist";import Ny from"@mui/icons-material/Face";import Fy from"@mui/icons-material/Publish";import Hy from"@mui/icons-material/NotificationsOutlined";import Wy from"@mui/icons-material/BugReportOutlined";import $y from"@mui/icons-material/DescriptionOutlined";import Ky from"@mui/icons-material/Inventory2Outlined";import{jsx as Uo}from"react/jsx-runtime";function xm(e,o){return o>0?`${e} (${o})`:e}var Q2=[{id:"my",label:"\uC804\uCCB4",icon:Uo(Ly,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Uo(Hy,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Uo(Ny,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Uo(Fy,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Uo(Wy,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Uo(Ky,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Uo($y,{sx:{fontSize:18}}),hideCount:!0}];function Uy(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 J2({items:e,activeTab:o,counts:t,onChange:n,compact:r=!1}){let i=se(),a=Uy(i.tabs),l=e;return r?Uo(Ry,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:l.map(d=>{let m=o===d.id;return Uo(zy,{onClick:()=>n(d.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:po(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:m?i.tabs.selectedBg:i.tabs.bg,color:m?i.tabs.selectedColor:i.tabs.color,borderColor:m?i.tabs.selectedBg:i.tabs.borderColor},children:xm(d.label,d.hideCount?0:t[d.id]??0)},d.id)})}):Uo(Ay,{value:o,onChange:(d,m)=>n(m),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:l.map(d=>Uo(qy,{value:d.id,label:xm(d.label,d.hideCount?0:t[d.id]??0),icon:d.icon,iconPosition:"start",sx:a},d.id))})}import{useEffect as Vy,useMemo as Gy,useState as Xa}from"react";import{Divider as Qa,ListItemIcon as Po,Menu as Ja,MenuItem as mo}from"@mui/material";import Yy from"@mui/icons-material/OpenInNewOutlined";import jy from"@mui/icons-material/Check";import Xy from"@mui/icons-material/CheckCircleOutlined";import Qy from"@mui/icons-material/RadioButtonUnchecked";import Jy from"@mui/icons-material/SendOutlined";import Zy from"@mui/icons-material/EventOutlined";import e0 from"@mui/icons-material/PersonOutlineOutlined";import o0 from"@mui/icons-material/ViewKanbanOutlined";import t0 from"@mui/icons-material/ContentCopyOutlined";import n0 from"@mui/icons-material/NextPlanOutlined";import r0 from"@mui/icons-material/ContentPasteOutlined";import i0 from"@mui/icons-material/ShareOutlined";import a0 from"@mui/icons-material/DirectionsRunOutlined";import gm from"@mui/icons-material/ChevronRight";import l0 from"@mui/icons-material/ArchiveOutlined";import s0 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as c0}from"@ehfuse/alerts";import{Fragment as m0,jsx as me,jsxs as ao}from"react/jsx-runtime";function wz({target:e,onClose:o,customTabs:t,sprints:n=[],myAccountSeq:r=0,onOpenDetail:i,onToggleCompleted:a,onRequestConfirm:l,onChangeDueDate:d,onChangeReminder:m,onMemberEdit:s,onMoveProject:p,onDuplicate:u,onCreateFollowUp:c,onShare:f,onAssignSprint:_,onArchiveToggle:x,onDelete:h}){let g=$e(),v=Go(),[b,I]=Xa(null),[O,P]=Xa(null),[S,q]=Xa(null);Vy(()=>{e||(I(null),P(null),q(null))},[e]);let B=e?.task??null,oe=!!B?.is_notice,y=!!B?.is_event,k=B?!at(B,r):!1,H=Gy(()=>new Set(t.filter(M=>M.useSprints).map(M=>M.key)),[t]),$=async()=>{let M=B;if(o(),!M)return;await c0({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:`"${M.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&h(M.seq)},K=()=>{B&&x(B.seq,!B.archived),o()};return ao(m0,{children:[ao(Ja,{open:!!e,onClose:o,transitionDuration:0,anchorReference:g?"none":"anchorPosition",anchorPosition:!g&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...g?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:g?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[ao(mo,{onClick:()=>{B&&i(B),o()},sx:{fontSize:14},children:[me(Po,{children:me(Yy,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),ao(mo,{disabled:oe?(B?.author_account_seq??0)!==r:(B?.author_account_seq??0)!==r&&(B?.manager_account_seq??0)!==r,onClick:()=>{B&&a(B.seq,!B.completed),o()},sx:{fontSize:14},children:[me(Po,{children:B?.completed?me(Qy,{sx:{fontSize:19}}):me(Xy,{sx:{fontSize:19}})}),B?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!oe&&l?ao(mo,{disabled:!(B?.manager_account_seq??0)&&(B?.receiver_account_seqs??[]).length===0,onClick:()=>{B&&l(B),o()},sx:{fontSize:14},children:[me(Po,{children:me(Jy,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,y?null:me(Qa,{}),y?null:ao(mo,{disabled:k,onClick:M=>{B&&I({anchorEl:M.currentTarget,task:B})},sx:{fontSize:14},children:[me(Po,{children:me(Zy,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uAE30\uD55C \uBCC0\uACBD"]}),!oe&&!y&&s?ao(mo,{onClick:()=>{B&&s(B,"manager"),o()},sx:{fontSize:14},children:[me(Po,{children:me(e0,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,y?null:ao(mo,{disabled:k,onClick:M=>{B&&P({anchorEl:M.currentTarget,task:B})},sx:{fontSize:14},children:[me(Po,{children:me(o0,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",me(gm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),me(Qa,{}),u?ao(mo,{disabled:k,onClick:()=>{B&&u(B.seq),o()},sx:{fontSize:14},children:[me(Po,{children:me(t0,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,c&&B&&!B.is_event&&!B.is_notice?ao(mo,{onClick:()=>{B&&c(B.seq),o()},sx:{fontSize:14},children:[me(Po,{children:me(n0,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,ao(mo,{onClick:()=>{B&&(f?f(B):si(B,g)),o()},sx:{fontSize:14},children:[me(Po,{children:g?me(i0,{sx:{fontSize:19}}):me(r0,{sx:{fontSize:19}})}),g?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),B&&!B.is_notice&&!B.is_event&&H.has(String(B.tab_key??""))&&_?ao(mo,{onClick:M=>q(M.currentTarget),sx:{fontSize:14},children:[me(Po,{children:me(a0,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",me(gm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,ao(mo,{onClick:K,disabled:k||!B?.archived&&!(B&&fr(B)),sx:{fontSize:14},children:[me(Po,{children:B?.archived?me(s0,{sx:{fontSize:19}}):me(l0,{sx:{fontSize:19}})}),B?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),me(Qa,{}),ao(mo,{disabled:k,onClick:$,sx:{fontSize:14,color:"#e5484d"},children:[me(Po,{children:me(dt,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C"]})]}),me(Et,{anchorEl:b?.anchorEl??null,open:!!b,date:b?.task.due_date??"",reminder:b?.task.reminder??"none",hideReminder:!!b?.task.completed,centered:g,onClose:()=>{I(null),o()},onDateChange:M=>{b&&d(b.task.seq,M)},onReminderChange:M=>{b&&m?.(b.task.seq,M)}}),ao(Ja,{transitionDuration:0,anchorEl:O?.anchorEl??null,open:!!O,onClose:()=>{P(null),o()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...v,children:[me(mo,{selected:!O?.task.tab_key,onClick:()=>{O&&p(O.task.seq,""),P(null),o()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),t.filter(M=>!M.archived).map(M=>me(mo,{selected:O?.task.tab_key===M.key,onClick:()=>{O&&p(O.task.seq,M.key),P(null),o()},sx:{fontSize:14,minWidth:170},children:M.label},M.key))]}),me(Ja,{transitionDuration:0,anchorEl:S,open:!!S,onClose:()=>q(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...n.filter(M=>`custom-${M.group_seq}`===String(B?.tab_key??"")).map(M=>({seq:M.seq,label:Do(M)}))].map(M=>ao(mo,{onClick:()=>{B&&_?.(B.seq,M.seq),q(null),o()},sx:{fontSize:14,minWidth:160,gap:1},children:[M.label,(B?.sprint_seq??0)===M.seq?me(jy,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},M.seq))})]})}import{Checkbox as u0,Divider as d0,Menu as p0,MenuItem as bm}from"@mui/material";import{jsx as di,jsxs as hm}from"react/jsx-runtime";function Pz({anchorEl:e,labelOptions:o,selectedKeys:t,onToggle:n,onClear:r,onClose:i}){return hm(p0,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,children:[o.map(a=>{let l=t.includes(a.key);return hm(bm,{onClick:()=>n(a.key),sx:{fontSize:14,minWidth:190,gap:1},children:[di(u0,{size:"small",checked:l,sx:{p:0}}),di(Me,{option:a})]},a.key)}),di(d0,{}),di(bm,{disabled:t.length===0,onClick:()=>{r(),i()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as km,Menu as f0,MenuItem as Za}from"@mui/material";import x0 from"@mui/icons-material/Check";import g0 from"@mui/icons-material/BarChartOutlined";import b0 from"@mui/icons-material/SettingsOutlined";import{jsx as ar,jsxs as pi}from"react/jsx-runtime";function Hz(e){let{anchorEl:o,sprints:t,value:n,onSelect:r,onManage:i,onCharts:a,onClose:l}=e;return pi(f0,{transitionDuration:0,anchorEl:o,open:!!o,onClose:l,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...t.map(d=>({seq:d.seq,label:Do(d)}))].map(d=>pi(Za,{onClick:()=>{r(d.seq),l()},sx:{fontSize:14,minWidth:180,gap:1},children:[d.label,n===d.seq?ar(x0,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},d.seq)),ar(km,{}),a?pi(Za,{onClick:()=>{l(),a()},sx:{fontSize:14,gap:1},children:[ar(g0,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uCC28\uD2B8"]}):null,a?ar(km,{}):null,pi(Za,{onClick:()=>{l(),i()},sx:{fontSize:14,gap:1},children:[ar(b0,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var h0={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function k0(e){return h0[e]??"tasks"}var Kz={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"},Tm=["list","calendar","month","card","kanban","sprint","timeline"],T0=["list","card"];function Uz(e){let o=k0(e);switch(o){case"notice":return{kind:o,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:o,viewOptions:Tm,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:o,viewOptions:T0,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:o,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:o,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:o,viewOptions:Tm,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"}:{}}}}export{av as ALL_TASK_VIEWER_ACCOUNT_SEQS,fc as AddLabelDialog,Dr as AddTabDialog,mc as AttachmentUploadGauge,Ca as AttachmentUploadPercent,Ii as BUG_DEVICE_OPTIONS,Ln as BUG_ICON_COLOR,$C as BUG_KANBAN_COLUMNS,vi as BUG_REPRO_OPTIONS,_i as BUG_RESOLUTION_OPTIONS,$t as BUG_STATUS_OPTIONS,An as BUG_TASK_ICON,Qr as BugPropertiesGrid,Up as COLUMN_WIDTHS,Di as COMPLETED_STATUS_OPTION,Na as CUSTOM_TAB_KEY_PREFIX,PR as CalendarImportDialog,HR as CalendarSubscribeDialog,Ir as CommentBubbleIcon,gn as ConfirmCountButton,Kl as DATE_REMINDER_OPTIONS,ki as DEFAULT_PROJECT_ICON,Q2 as DEFAULT_TASKBOX_TAB_ITEMS,we as DEFAULT_TASK_ICON,L2 as DateRangeFilterPopover,Mo as DrawerSection,Et as DueDatePickerPopover,Cp as ENDED_EVENT_STATUS_OPTION,yc as EVENT_ICON_COLOR,XR as EmployeeSelectDialog,Ri as GROUP_BY_OPTIONS,Tn as GoogleEventChip,I2 as GroupByMenuButton,wr as IconPickerGrid,Js as InlineAddressInput,ht as InlineTextValue,Oi as KANBAN_CLOSED_COLUMN_KEY,Pz as LabelFilterMenu,ri as LabelSelectMenu,Fn as MANUAL_TASK_STATUS_OPTIONS,h2 as MemberFilterMenu,Nn as NOTICE_STATUS_OPTIONS,zo as NOTICE_TASK_ICON,gl as NO_TASK_ICON,Ti as PROJECT_ICON_OPTIONS,ue as PropertyRow,fn as RECEIVER_AVATAR_COLORS,Ul as REMINDER_OPTIONS,xo as ReceiverAvatarStack,Uc as RelatedTasksSection,mr as STATUS_KEY_REPLIED,zn as STATUS_KEY_WAITING,Pr as SortableTaskCard,cm as SprintBurndownChart,p2 as SprintChartsDialog,Hz as SprintFilterMenu,BR as SprintManageDialog,lm as SprintVelocityChart,hr as StatusSelectMenu,Ai as TASKBOX_COLUMNS,Jo as TASKBOX_DRAWER_NARROW_MQ,bl as TASKBOX_UI_STATE_ID,Kz as TASKBOX_VIEW_LABELS,Qw as TASKBOX_VIEW_MODES,Wt as TASK_STATUS_OPTIONS,Af as TIME_REMINDER_OPTIONS,Er as TaskAckListPopover,xn as TaskActionButton,ti as TaskAttachmentsSection,Fs as TaskBoxColumnSummary,ta as TaskBoxGroupBoard,AD as TaskBoxMobileList,Ds as TaskBoxMonthAgenda,Cs as TaskBoxMonthCalendar,mD as TaskBoxSprintColumnSummary,Xl as TaskBoxTable,J2 as TaskBoxTabs,zs as TaskBoxTimeline,Xw as TaskBoxView,gs as TaskBoxWeekCalendar,Xt as TaskCardContent,Zr as TaskChecklistSection,Ec as TaskCommentInput,Mc as TaskCommentsSection,Jr as TaskContentEditor,wz as TaskContextMenu,Xr as TaskCorePropertiesGrid,Sc as TaskCreateBody,UE as TaskCreateDrawer,pm as TaskDateRangeFilter,Yc as TaskDetailBody,mR as TaskDetailDrawer,Ac as TaskDetailHeader,Vr as TaskIconPickerPopover,Ot as TaskLabelChips,Wc as TaskLinkDialog,Lc as TaskNoteField,qo as TaskPriorityChip,Me as TaskStatusChip,XC as TaskStatusChips,Dm as TaskboxProvider,XT as buildCalendarFeedUrl,hn as buildCardBaseSx,vl as buildStatusOptionColors,zi as buildTaskGroupSections,Fc as buildTaskRelationsModel,Hk as buildTaskShareText,dr as buildTaskboxTheme,Il as canAssignBugManager,Tr as canClaimTaskItem,at as canEditTaskItem,kr as canViewTaskItem,yr as canVolunteerTaskItem,As as countWorkdays,kp as createTaskboxTheme,Ns as daysLeftUntil,yi as defaultTaskBoxFormValues,Si as defaultTaskboxUiStateValues,kc as filterFilesWithinLimit,w1 as formatConfirmTime,qs as formatHours,Yo as formatKoreanDate,st as formatKoreanDateTime,Do as formatSprintOptionLabel,Sl as getBugDeviceName,yl as getBugReproName,pr as getBugResolutionName,vp as getBugStatusOption,D2 as getDefaultDateRange,Hn as getEventDisplayStatusOption,KC as getNoDueStatusRank,hc as getNoticeAckInfo,Bl as getNoticeStatusOption,nE as getNoticeTargetDisplay,ur as getProjectIconAnchorComponent,Pe as getProjectIconComponent,Vi as getReminderLabel,Ui as getReminderOptions,Cl as getStatusOptionsForTask,Uz as getTabHeaderConfig,Ni as getTaskBoxColumnDefs,Sr as getTaskBoxGridTemplate,k0 as getTaskBoxTabKind,Jl as getTaskConfirmInfo,fo as getTaskDisplayStatusOption,xr as getTaskStatusOption,kn as groupGoogleEventsByDate,Fa as groupSeqFromTabKey,N5 as hasRelation,Mh as htmlToPlainText,RT as isCustomTabKey,Pi as isOpenPoolTaskItem,wi as isPastEvent,fr as isTaskDone,Mi as isWaitingTask,mi as monthsAgoDate,co as narrowOrderSx,cR as nowDateTimeString,fb as parseEstimatedHours,rn as relationsOf,Dt as resolveTaskStatusOptions,Ci as resolveTaskboxTheme,si as shareTaskText,Ls as sumRemainingHours,ii as summarizeNoticeTargets,pR as tabKeyFromGroupSeq,dn as toYmd,gr as toggleLabelKey,hi as useBuildFileUrl,cc as useTaskAttachmentUploadMeta,Co as useTaskboxConfig,fp as useTaskboxForm,se as useTaskboxTheme,it as useTaskboxUiState,qn as useUploadMaxMb};
12
+ `).trim():"";function Yk(e){let o=[`[\uC5C5\uBB34] ${e.title}`],t=Go(e.start_date),n=Go(e.due_date);(t||n)&&o.push(`\uAE30\uAC04: ${t&&n?`${t} ~ ${n}`:t||n}`),e.manager_name&&o.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let r=po(e).name;r&&o.push(`\uC0C1\uD0DC: ${r}`);let i=Nc(e.content);i&&o.push("",i);let a=String(e.note??"").trim();return a&&o.push("",`\uBE44\uACE0: ${a}`),o.join(`
13
+ `)}function Fc(e){navigator.clipboard.writeText(e).then(()=>Gk("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Vk("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function fi(e,o){let t=Yk(e);if(o&&typeof navigator.share=="function"){navigator.share({text:t}).catch(n=>{n?.name!=="AbortError"&&Fc(t)});return}Fc(t)}import{Fragment as oT,jsx as to,jsxs as Wc}from"react/jsx-runtime";function $c({task:e,myAccountSeq:o=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:r,onChangeIconColor:i,onClose:a}){let s=He(),[u,m]=Hc(null),[d,p]=Hc(null),l=xr(e.icon||(e.is_notice?Ro:e.is_event?"event":De)),c=!!e.is_notice,f=!!e.is_event,w=c&&o>0&&(e.author_account_seq??0)===o,h=!it(e,o),x=!f&&(c?w:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o);return Wc(oT,{children:[Wc(Fa,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[x?to(Wa,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${at(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:to(jk,{checked:e.completed,icon:to(eT,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:to(Zk,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(g,I)=>t(e.seq,I),sx:{p:0}})}):null,to(Wa,{title:h?"":"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:to(Ha,{size:"small",onClick:h?void 0:g=>p(g.currentTarget),sx:{color:e.icon_color||(c?"#e5484d":"#1e3a8a")},children:to(l,{sx:{fontSize:20}})})}),u!==null?to(Fa,{component:"input",autoFocus:!0,spellCheck:!1,value:u,onChange:g=>m(g.target.value),onBlur:()=>{u.trim()&&u.trim()!==e.title&&n(e.seq,u.trim()),m(null)},onKeyDown:g=>{g.key==="Enter"&&g.target.blur(),g.key==="Escape"&&m(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):to(Fa,{onClick:h?void 0:()=>m(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:h?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),to(Wa,{title:s?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:to(Ha,{"aria-label":s?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>fi(e,s),sx:{color:"#6b7280"},children:s?to(Qk,{sx:{fontSize:20}}):to(Jk,{sx:{fontSize:20}})})}),a?to(Ha,{"aria-label":"\uB2EB\uAE30",onClick:a,sx:{color:"#6b7280"},children:to(Xk,{})}):null]}),to(Jr,{anchorEl:d,value:e.icon||(c?Ro:""),color:e.icon_color||(c?"#e5484d":"#1e3a8a"),onSelect:g=>r(e.seq,g),onSelectColor:g=>i?.(e.seq,g),onClose:()=>p(null)})]})}import{useState as Dn}from"react";import{Box as Co,Button as xi,ButtonBase as yT,Divider as ln,Menu as ST,MenuItem as BT}from"@mui/material";import CT from"@mui/icons-material/ExpandLess";import vT from"@mui/icons-material/ExpandMore";import IT from"@mui/icons-material/ConfirmationNumberOutlined";import _T from"@mui/icons-material/Check";import wT from"@mui/icons-material/DirectionsRunOutlined";import DT from"@mui/icons-material/SpeedOutlined";import OT from"@mui/icons-material/CheckCircle";import Jc from"@mui/icons-material/CheckCircleOutlined";import Zc from"@mui/icons-material/AccessTimeOutlined";import MT from"@mui/icons-material/AutorenewOutlined";import ET from"@mui/icons-material/LabelOutlined";import PT from"@mui/icons-material/PersonOutlineOutlined";import RT from"@mui/icons-material/SubjectOutlined";import zT from"@mui/icons-material/StickyNote2Outlined";import qT from"@mui/icons-material/PanToolAltOutlined";import{useState as tT}from"react";import{TextField as nT}from"@ehfuse/mui-form-controls";import{jsx as rT}from"react/jsx-runtime";function Kc({value:e,onCommit:o,onDraftChange:t,readOnly:n=!1}){let[r,i]=tT(null);return rT(nT,{value:r??e,placeholder:n?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:n}},onChange:a=>{i(a.target.value),t?.(a.target.value)},onBlur:()=>{r!==null&&r.trim()!==e&&o(r),i(null)},onKeyDown:a=>{a.key==="Enter"&&a.target.blur(),a.key==="Escape"&&i(null)},sx:{mt:1}})}import{useMemo as jc,useState as Ua}from"react";import{Box as no,Button as Xc,IconButton as xT}from"@mui/material";import gT from"@mui/icons-material/AccountTreeOutlined";import bT from"@mui/icons-material/Add";import hT from"@mui/icons-material/Close";import kT from"@mui/icons-material/NextPlanOutlined";function an(e){return e.relations??[]}function n5(e,o,t){return an(e).some(n=>n.type===t&&n.task_seq===o.seq)||an(o).some(n=>n.type===t&&n.task_seq===e.seq)}function Uc(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Vc(e,o){let t=new Map(o.map(c=>[c.seq,c]));t.set(e.seq,e);let n=new Map,r=(c,f)=>{n.has(c)||n.set(c,new Set),n.has(f)||n.set(f,new Set),n.get(c).add(f),n.get(f).add(c)};for(let c of t.values())for(let f of an(c))f.type==="follow_up"&&t.has(f.task_seq)&&r(c.seq,f.task_seq);let i=new Set([e.seq]),a=[e.seq];for(;a.length>0;){let c=a.shift();for(let f of n.get(c)??[])i.has(f)||(i.add(f),a.push(f))}let s=[...i].map(c=>t.get(c)).filter(c=>!!c).sort((c,f)=>Uc(c).localeCompare(Uc(f))),u=new Set;for(let c of an(e))c.type==="related"&&u.add(c.task_seq);for(let c of t.values())c.seq!==e.seq&&an(c).some(f=>f.type==="related"&&f.task_seq===e.seq)&&u.add(c.seq);let m=[...u].map(c=>t.get(c)).filter(c=>c!==void 0&&c.seq!==e.seq),d=[...t.values()].filter(c=>c.seq!==e.seq&&an(c).some(f=>f.type==="duplicate_of"&&f.task_seq===e.seq)),p=an(e).find(c=>c.type==="duplicate_of")?.task_seq,l=p?t.get(p)??null:null;return{lineage:s,related:m,duplicates:d,duplicateOf:l}}import{useEffect as iT,useMemo as aT,useState as $a}from"react";import{Box as wn,Button as lT,Tab as sT,Tabs as cT}from"@mui/material";import mT from"@mui/icons-material/Check";import{FormDialog as uT}from"@ehfuse/mui-form-dialog";import{ClearTextField as dT}from"@ehfuse/mui-form-controls";import{ErrorAlert as pT}from"@ehfuse/alerts";import{OverlayScrollbar as fT}from"@ehfuse/overlay-scrollbar";import{jsx as Mo,jsxs as Ka}from"react/jsx-runtime";var Gc=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function Yc({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i}){let[a,s]=$a("related"),[u,m]=$a(""),[d,p]=$a(0);iT(()=>{e&&(s("related"),m(""),p(0))},[e]);let l=aT(()=>{let h=new Set([o.seq,...n]),x=u.trim().toLowerCase();return t.filter(g=>h.has(g.seq)||g.is_event||g.is_notice?!1:x?g.title.toLowerCase().includes(x)||(g.ticket_no??"").toLowerCase().includes(x):!0)},[t,o.seq,n,u]),c=()=>{if(!d){pT("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}i(d,a),r()},f=Gc.find(h=>h.type===a)?.hint??"",w=Ka(wn,{children:[Mo(cT,{value:a,onChange:(h,x)=>s(x),sx:{minHeight:38,mb:.75,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Gc.map(h=>Mo(sT,{value:h.type,label:h.label},h.type))}),Mo(wn,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:f}),Mo(dT,{label:"\uC5C5\uBB34 \uAC80\uC0C9",placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:u,onChange:h=>m(h.target.value),fullWidth:!0,autoFocus:!0}),Mo(wn,{sx:{mt:1.5,height:300,border:"1px solid #e6e6e3",borderRadius:1},children:Mo(fT,{style:{height:"100%"},children:l.length===0?Mo(wn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):l.map(h=>{let x=ze(h.icon||De),g=h.seq===d;return Ka(wn,{onClick:()=>p(g?0:h.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.75,cursor:"pointer",bgcolor:g?"#e3eefb":"transparent","&:hover":{bgcolor:g?"#e3eefb":"#f7f7f5"}},children:[x?Mo(x,{sx:{fontSize:17,flexShrink:0,color:h.icon_color||"#1e3a8a"}}):null,Ka(wn,{component:"span",sx:{flex:1,minWidth:0,fontSize:14,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[h.ticket_no?`${h.ticket_no} `:"",h.title]}),Mo(_e,{option:po(h),small:!0}),g?Mo(mT,{sx:{fontSize:17,flexShrink:0,color:"#2f80ed"}}):null]},h.seq)})})})]});return Mo(uT,{open:e,onClose:r,maxWidth:"sm",title:"\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:w}],actions:{showCancelButton:!0,right:Mo(lT,{variant:"contained",disabled:!d,onClick:c,children:"\uC5F0\uACB0"})}})}import{Fragment as TT,jsx as Pe,jsxs as Ho}from"react/jsx-runtime";function Va({item:e,caption:o,onOpen:t,onUnlink:n}){let r=ze(e.icon||De);return Ho(no,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[o?Pe(no,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:o}):null,r?Pe(r,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Ho(no,{component:"span",onClick:t,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...t?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Pe(_e,{option:po(e),small:!0}),n?Pe(xT,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:n,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Pe(hT,{sx:{fontSize:15}})}):null]})}function Qc({task:e,tasks:o,readOnly:t=!1,onOpenTask:n,onLink:r,onUnlink:i,onCreateFollowUp:a}){let[s,u]=Ua(!1),[m,d]=Ua(null),[p,l]=Ua(null),c=jc(()=>Vc(e,o),[e,o]),f=c.lineage.length>=2,w=(f?c.lineage.length-1:0)+c.related.length+c.duplicates.length+(c.duplicateOf?1:0),h=jc(()=>{let g=new Set;for(let I of c.lineage)g.add(I.seq);for(let I of c.related)g.add(I.seq);for(let I of c.duplicates)g.add(I.seq);return c.duplicateOf&&g.add(c.duplicateOf.seq),[...g]},[c]),x=(g,I,b)=>{l({anchorEl:g,targetSeq:I,type:b})};return Ho(Oo,{icon:Pe(gT,{sx:{fontSize:19,display:"block"}}),title:Ho(TT,{children:["\uAD00\uB828 \uC5C5\uBB34",w>0?Pe(no,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:w}):null]}),titleExtra:t?null:Ho(no,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[a?Pe(Xc,{size:"small",color:"inherit",startIcon:Pe(kT,{sx:{fontSize:16}}),onClick:g=>d(g.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,r?Pe(Xc,{size:"small",color:"inherit",startIcon:Pe(bT,{sx:{fontSize:16}}),onClick:()=>u(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Ho(no,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[f?Pe(no,{sx:{mb:c.related.length||c.duplicates.length||c.duplicateOf?1:0},children:c.lineage.map((g,I)=>{let b=g.seq===e.seq,O=I===c.lineage.length-1;return Ho(no,{sx:{display:"flex",gap:1},children:[Ho(no,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Pe(no,{sx:{width:b?9:7,height:b?9:7,borderRadius:"50%",bgcolor:b?"#2f80ed":g.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),O?null:Pe(no,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Ho(no,{sx:{flex:1,minWidth:0,pb:O?0:.5},children:[Ho(no,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Ho(no,{component:"span",onClick:!b&&n?()=>n(g.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:b?600:400,color:b?"#2f80ed":g.completed?"#9a9a97":"#37352f",textDecoration:g.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!b&&n?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[g.ticket_no?`${g.ticket_no} `:"",g.title]}),Pe(_e,{option:po(g),small:!0})]}),Pe(no,{sx:{fontSize:12,color:"#9a9a97"},children:g.completed&&g.completed_time?`${g.completed_time} \uC644\uB8CC`:g.created_time??""})]})]},g.seq)})}):null,c.duplicateOf?Pe(Va,{item:c.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:n?()=>n(c.duplicateOf.seq):void 0,onUnlink:!t&&i?g=>x(g.currentTarget,c.duplicateOf.seq,"duplicate_of"):void 0}):null,c.duplicates.map(g=>Pe(Va,{item:g,caption:"\uC911\uBCF5",onOpen:n?()=>n(g.seq):void 0,onUnlink:!t&&i?I=>x(I.currentTarget,g.seq,"duplicate_of"):void 0},`dup-${g.seq}`)),c.related.map(g=>Pe(Va,{item:g,onOpen:n?()=>n(g.seq):void 0,onUnlink:!t&&i?I=>x(I.currentTarget,g.seq,"related"):void 0},`rel-${g.seq}`)),w===0?Pe(no,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),r?Pe(Yc,{open:s,task:e,tasks:o,excludeSeqs:h,onClose:()=>u(!1),onSubmit:(g,I)=>r(e.seq,g,I)}):null,Pe(Ue,{open:!!m,anchorEl:m,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:()=>d(null),onConfirm:()=>{a?.(e.seq),d(null)}}),Pe(Ue,{open:!!p,anchorEl:p?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>l(null),onConfirm:()=>{p&&i?.(e.seq,p.targetSeq,p.type),l(null)}})]})}import{Fragment as ho,jsx as A,jsxs as We}from"react/jsx-runtime";function On({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return A(Co,{component:"span",sx:{color:"#9a9a97"},children:e})}function em({task:e,customTabs:o,statusOptions:t,avatarSrcByName:n,onChangeStatus:r,onChangeLabels:i,onAddLabelOption:a,onChangeProject:s,onAddProject:u,onChangeDate:m,onChangeReminder:d,onMemberEdit:p,onChangePriority:l,onChangeEstimatedTime:c,onChangeEventTime:f,onChangeEventPlace:w,onChangeEventAddress:h,onChangeNote:x,onChangeContent:g,onAddChecklistItem:I,onToggleChecklistItem:b,onRemoveChecklistItem:O,onUpdateChecklistItem:_,onConvertChecklistToTask:P,onOpenChecklistTask:C,resolveChecklistTask:F,relatedTasksPool:D,onOpenRelatedTask:Z,onLinkRelatedTask:S,onUnlinkRelatedTask:k,onCreateFollowUpTask:H,onAddAttachments:K,onRemoveAttachment:G,onPreview:R,onDownload:te,onUpdateComment:ne,onRemoveComment:fe,onToggleCommentReaction:Ie,currentUserName:Re="",myAccountSeq:re=0,noticeAdmin:le=!1,hideProject:y=!1,hideLabel:B=!1,employees:q=[],onAckConfirm:N,onChangeBugField:W,sprints:se=[],sprintProject:z=!1,onChangeSprint:Y,onChangeStoryPoints:ke,onChangeResolution:M,onClaimTask:ie,onVerifyBug:xe}){let[Ae,je]=Dn(null),[$,j]=Dn(!1),Me={[Qo]:$?{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"}},[vo,Ct]=Dn(null),[ot,vt]=Dn(null),[It,Po]=Dn(null),[_t,tt]=Dn(null),io=!!e.is_notice,Qe=!!e.is_event,Ko=!!e.is_bug,To=!!ie&&Cr(e,re),Rn=!!ie&&vr(e,re),Ce=!!xe&&Ko&&!!e.completed&&re>0&&(e.author_account_seq??0)===re&&!(e.acks??[]).some(E=>E.account_seq===re),v=!it(e,re),L=io?!Br(e,re):v,X=To||Rn?We(bn,{onClick:E=>tt(E.currentTarget),children:[A(qT,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,ae=io?ui(e,q):"",ge=io?Cc(e,q,re):null;return We(ho,{children:[We(Co,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[A(ti,{hideProject:y,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,estimatedTime:e.estimated_time,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:o,avatarSrcByName:n,showEstimatedTime:!Qe,notice:io,event:Qe,readOnly:v,targetSummary:ae,onChangeProject:E=>s(e.seq,E),onAddProject:u,onChangeStartDate:E=>m(e.seq,"start_date",E),onChangeDueDate:E=>m(e.seq,"due_date",E),onChangeReminder:E=>d(e.seq,E),onChangePriority:E=>l(e.seq,E),onChangeEstimatedTime:E=>c(e.seq,E),onChangeEventTime:E=>f?.(e.seq,E),onChangeEventPlace:E=>w?.(e.seq,E),onChangeEventAddress:E=>h?.(e.seq,E),onMemberEdit:E=>p(e,E),narrowCollapsedSx:Me,reminderLocked:e.completed,managerAction:X,leading:We(ho,{children:[Ce||X&&(io||Qe)?We(Co,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"center",gap:1,px:2,py:.75},children:[io||Qe?X:null,Ce?We(ho,{children:[A(xi,{variant:"contained",size:"small",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uC218\uC815 \uD655\uC778(\uAC80\uC99D \uC644\uB8CC)"}),A(xi,{variant:"outlined",size:"small",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC544\uC9C1 \uC7AC\uD604\uB428(\uC7AC\uC624\uD508)"})]}):null]}):null,Ko&&e.ticket_no?A(me,{icon:A(IT,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",children:A(Co,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Qe?null:A(Co,{sx:Ko&&e.ticket_no?void 0:{gridColumn:"1 / -1"},children:A(me,{icon:A(MT,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:v||e.completed?void 0:E=>Ct(E),children:A(_e,{option:po(e)})})}),z&&!Qe&&!io?We(ho,{children:[A(me,{icon:A(wT,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:v?void 0:E=>vt(E),children:(e.sprint_seq??0)>0?se.find(E=>E.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":A(On,{label:"\uBBF8\uBC30\uC815"})}),A(me,{icon:A(DT,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:A(Tt,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:v,onCommit:E=>ke?.(e.seq,Number(E.replace(/[^0-9.]/g,""))||0)})})]}):null,Qe||B?null:A(Co,{sx:[{gridColumn:"1 / -1"},Me??null],children:A(me,{icon:A(ET,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:v?void 0:E=>Po(E),children:(e.label_keys??[]).length>0?A(Mt,{labelKeys:e.label_keys??[],labelOptions:t}):A(On,{})})}),io&&ge?A(Co,{sx:{gridColumn:"1 / -1"},children:A(me,{icon:A(Jc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:A(Co,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ge.canAck?A(xi,{size:"small",variant:"contained",onClick:()=>N?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):A(xi,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.acked?A(OT,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:E=>je({anchorEl:E.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ge.total>0&&ge.count>=ge.total?"\uC644\uB8CC":We(ho,{children:[ge.count,A(Co,{component:"span",sx:{mx:.4},children:"/"}),ge.total]})})})})}):null]}),trailing:We(ho,{children:[Ko?A(ni,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:v,showResolution:!!e.completed,onChangeRepro:E=>W?.(e.seq,"bug_repro",E),onChangeDevice:E=>W?.(e.seq,"bug_device",E),onChangeWhere:E=>W?.(e.seq,"bug_where",E),onChangeVersion:E=>W?.(e.seq,"bug_version",E),onChangeResolution:E=>M?.(e.seq,E)}):null,A(me,{icon:A(PT,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[so(9),Me??null],children:e.created_by?We(ho,{children:[A(fo,{names:[e.created_by],size:20,avatarSrcByName:n}),e.created_by]}):A(On,{})}),A(me,{icon:A(Zc,{sx:{fontSize:17}}),label:"\uC791\uC131\uC2DC\uAC04",sx:[so(11),Me??null],children:e.created_time?at(e.created_time):A(On,{})}),e.completed?We(ho,{children:[A(me,{icon:A(Jc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[so(10),Me??null],children:e.completed_by?We(ho,{children:[A(fo,{names:[e.completed_by],size:20,avatarSrcByName:n}),e.completed_by]}):A(On,{})}),A(me,{icon:A(Zc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC2DC\uAC04",sx:[so(12),Me??null],children:e.completed_time?at(e.completed_time):A(On,{})})]}):null]})}),We(Co,{sx:{display:"none",[Qo]:{display:"block",mt:1.5}},children:[A(ln,{sx:{borderColor:"#e6e6e3"}}),A(yT,{onClick:()=>j(E=>!E),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.5,pb:1.25,fontSize:13,color:"#787774","&:active":{opacity:.6}},children:$?We(ho,{children:["\uC811\uAE30 ",A(CT,{sx:{fontSize:18}})]}):We(ho,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",A(vT,{sx:{fontSize:18}})]})})]}),We(Co,{children:[A(ln,{sx:{my:1.5,borderColor:"#e6e6e3",[Qo]:{mt:0}}}),A(Oo,{icon:A(RT,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:A(Co,{sx:{userSelect:"text"},children:A(ri,{syncKey:e.seq,value:e.content??"",readOnly:v,onChange:E=>g(e.seq,E)})})}),e.is_bug?null:We(ho,{children:[A(ln,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(Oo,{icon:A(zT,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:A(Co,{sx:{userSelect:"text"},children:A(Kc,{value:e.note,readOnly:L,onCommit:E=>x(e.seq,E)})})})]}),Qe?null:We(ho,{children:[A(ln,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(ii,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:L,onAdd:I,onToggle:b,onRemove:O,onUpdate:_,onConvertToTask:P,onOpenLinkedTask:C,resolveLinkedTask:F})]}),D&&!Qe&&!io?We(ho,{children:[A(ln,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(Qc,{task:e,tasks:D,readOnly:v,onOpenTask:Z,onLink:S,onUnlink:k,onCreateFollowUp:H})]}):null,A(ln,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(si,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:L,onAdd:K,onRemove:G,onPreview:R?E=>R({...E,taskSeq:e.seq}):void 0,onDownload:te?E=>te({...E,taskSeq:e.seq}):void 0})]}),A(ln,{sx:{my:1.5,borderColor:"#e6e6e3"}}),A(Ac,{taskSeq:e.seq,comments:e.comments??[],currentUserName:Re,myAccountSeq:re,avatarSrcByName:n,onUpdate:ne,onRemove:fe,onToggleReaction:Ie})]}),A(Sr,{anchorEl:vo,value:e.status,options:io?Hn:Ko?Kt:Wn,onSelect:E=>r(e.seq,E),onClose:()=>Ct(null)}),A(ST,{transitionDuration:0,anchorEl:ot,open:!!ot,onClose:()=>vt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...se.filter(E=>`custom-${E.group_seq}`===String(e.tab_key??"")).map(E=>({seq:E.seq,label:wo(E)}))].map(E=>We(BT,{onClick:()=>{Y?.(e.seq,E.seq),vt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[E.label,(e.sprint_seq??0)===E.seq?A(_T,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},E.seq))}),A(qr,{anchorEl:Ae?.anchorEl??null,open:!!Ae?.open,acks:e.acks??[],total:ge?.total??0,avatarSrcByName:n,onClose:()=>je(E=>E?{...E,open:!1}:null)}),A(mi,{anchorEl:It,selectedKeys:e.label_keys??[],labelOptions:t,onToggle:E=>i(e.seq,Tr(e.label_keys??[],E)),onAddLabel:a,onClose:()=>Po(null)}),A(Ue,{open:!!_t,anchorEl:_t,title:To?"\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:()=>tt(null),onConfirm:()=>{ie?.(e.seq),tt(null)}})]})}import{jsx as yt,jsxs as FT}from"react/jsx-runtime";function _R(){let e=new Date,o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function wR({open:e,task:o,onClose:t,onAddComment:n,myAccountSeq:r=0,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:s,onChangeIconColor:u,...m}){let d=AT(null);o&&(d.current=o);let p=o??d.current;return p?yt(LT,{anchor:"right",open:e,onClose:t,sx:{zIndex:l=>l.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:FT(Ga,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[yt($c,{task:p,myAccountSeq:r,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:s,onChangeIconColor:u,onClose:t}),yt(om,{sx:{borderColor:"#e6e6e3"}}),yt(Ga,{sx:{flex:1,minHeight:0},children:yt(NT,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:yt(em,{...m,task:p,myAccountSeq:r})})}),yt(om,{sx:{borderColor:"#37352f"}}),yt(Ga,{sx:{flexShrink:0},children:yt(Lc,{onSubmit:(l,c)=>n(p.seq,l,c)},p.seq)})]})}):null}import{useEffect as WT,useState as sn}from"react";import{Box as ko,Button as Xa,IconButton as tm}from"@mui/material";import{FormDialog as $T}from"@ehfuse/mui-form-dialog";import KT from"@mui/icons-material/EditOutlined";import{ErrorAlert as nm}from"@ehfuse/alerts";import{ClearTextField as rm,DateTextField as im,LabelSelect as am}from"@ehfuse/mui-form-controls";var Ya="custom-";function HT(e){return e.startsWith(Ya)}function MR(e){return e>0?`${Ya}${e}`:""}function ja(e){if(!HT(e))return 0;let o=Number(e.slice(Ya.length));return Number.isInteger(o)&&o>0?o:0}import{Fragment as VT,jsx as Ne,jsxs as Wt}from"react/jsx-runtime";var UT=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function lm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function HR({open:e,customTabs:o,sprints:t,onClose:n,onCreate:r,onUpdate:i,onChangeStatus:a,onRemove:s}){let u=o.filter(S=>S.useSprints&&!S.archived),[m,d]=sn(""),[p,l]=sn(""),[c,f]=sn(""),[w,h]=sn(""),[x,g]=sn(""),[I,b]=sn(!1),[O,_]=sn(0);WT(()=>{e&&(d(u.length===1?u[0].key:""),l(""),f(""),h(""),g(""),_(0))},[e]);let P=()=>{l(""),f(""),h(""),g(""),_(0)},C=S=>{_(S.seq),d(`custom-${S.group_seq}`),l(S.name),f(S.goal),h(S.start_date),g(S.end_date)},F=async()=>{let S=ja(m);if(!S){nm("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!p.trim()){nm("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}b(!0);try{if(O>0){i(O,{name:p.trim(),goal:c.trim(),start_date:w,end_date:x}),P();return}await r({group_seq:S,name:p.trim(),goal:c.trim(),start_date:w,end_date:x})&&P()}finally{b(!1)}},D=new Map(o.map(S=>[ja(S.key),S.label])),Z=Ne(ko,{children:u.length===0?Ne(ko,{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.'}):Wt(VT,{children:[Wt(ko,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Ne(am,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:m,options:u.map(S=>({value:S.key,label:S.label})),onChange:S=>d(String(S.target.value)),disabled:O>0}),Ne(rm,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:p,onChange:S=>l(S.target.value)}),Ne(im,{size:"medium",label:"\uC2DC\uC791\uC77C",value:w,onChange:S=>h(S.target.value)}),Ne(im,{size:"medium",label:"\uC885\uB8CC\uC77C",value:x,onChange:S=>g(S.target.value)}),Ne(rm,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:c,onChange:S=>f(S.target.value),sx:{gridColumn:"1 / -1"}})]}),Wt(ko,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[O>0?Ne(Xa,{color:"inherit",onClick:P,disabled:I,children:"\uCDE8\uC18C"}):null,Ne(Xa,{variant:"contained",onClick:()=>{F()},disabled:I,children:O>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),Ne(ko,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:t.length===0?Ne(ko,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(S=>Wt(ko,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[Wt(ko,{sx:{minWidth:0},children:[Wt(ko,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Ne(ko,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:S.name}),Ne(ko,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:D.get(S.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Wt(ko,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[lm(S.start_date)," ~ ",lm(S.end_date)]})]}),S.goal?Ne(ko,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:S.goal}):null]}),Wt(ko,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Ne(am,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:S.status,options:UT.map(k=>({value:k.value,label:k.label})),onChange:k=>a(S.seq,String(k.target.value)),sx:{width:104,flexShrink:0}}),Ne(tm,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>C(S),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Ne(KT,{sx:{fontSize:18}})}),Ne(tm,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>s(S.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Ne(mt,{style:{width:16,height:16}})})]})]},S.seq))})]})});return Ne($T,{open:e,onClose:n,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:Z}],actions:{showCancelButton:!1,right:Ne(Xa,{variant:"contained",onClick:n,children:"\uB2EB\uAE30"})}})}import{useState as sm}from"react";import{Box as Ye,Button as Qa,Divider as GT,IconButton as YT,TextField as jT}from"@mui/material";import{FormDialog as XT}from"@ehfuse/mui-form-dialog";import QT from"@mui/icons-material/OpenInNewOutlined";import JT from"@mui/icons-material/EventOutlined";import{ConfirmDialog as ZT}from"@ehfuse/alerts";import{jsx as ve,jsxs as cn}from"react/jsx-runtime";function QR({open:e,imports:o,onRegister:t,onRemove:n,onClose:r}){let[i,a]=sm(""),[s,u]=sm(!1),m=async()=>{let l=i.trim();if(l){u(!0);try{await t(l)&&a("")}finally{u(!1)}}},d=async l=>{await ZT({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${l.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&n(l.seq)},p=cn(Ye,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[cn(Ye,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",ve("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",ve("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",ve("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),ve(Ye,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),o.length>0?ve(Ye,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:o.map((l,c)=>cn(Ye,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:c>0?"1px solid #efefed":"none"},children:[ve(JT,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),ve(Ye,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),ve(YT,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{d(l)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:ve(mt,{sx:{fontSize:18}})})]},l.seq))}):ve(Ye,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),ve(GT,{sx:{my:1,borderColor:"#e6e6e3"}}),ve(Ye,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),cn(Ye,{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:[ve(Ye,{children:cn(Ye,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",ve("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),ve(Ye,{children:cn(Ye,{component:"span",children:[ve("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",ve("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),ve(Ye,{children:ve(Ye,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),ve(Ye,{children:ve(Ye,{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."})})]}),cn(Ye,{sx:{display:"flex",gap:2,alignItems:"center"},children:[ve(jT,{value:i,onChange:l=>a(l.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),ve(Qa,{variant:"contained",disabled:!i.trim()||s,onClick:()=>{m()},sx:{flexShrink:0},children:s?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return ve(XT,{open:e,onClose:r,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:p}],actions:{showCancelButton:!1,left:ve(Qa,{variant:"outlined",startIcon:ve(QT,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:ve(Qa,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Box as St,Button as ar,TextField as ey}from"@mui/material";import{FormDialog as oy}from"@ehfuse/mui-form-dialog";import ty from"@mui/icons-material/ContentCopyOutlined";import cm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as mm}from"@ehfuse/alerts";import{Fragment as ry,jsx as Fe,jsxs as mn}from"react/jsx-runtime";function ny(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function i2({open:e,feed:o,feedTaskCount:t,buildFeedUrl:n,onSubscribe:r,onClose:i}){let a=n??ny,s=o.subscribed?a(o.token):"",u=()=>{navigator.clipboard.writeText(s).then(()=>mm("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>mm("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},m=()=>{let p=s.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(p)}`,"_blank")},d=mn(St,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[mn(St,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Fe("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),t===0?mn(St,{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.",Fe("br",{}),Fe("b",{children:"\uB9C8\uAC10\uAE30\uD55C\uC774 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",o.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):o.subscribed&&o.enabled?mn(ry,{children:[Fe(ey,{value:s,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),mn(St,{sx:{display:"flex",gap:2},children:[Fe(ar,{variant:"outlined",startIcon:Fe(ty,{}),onClick:u,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Fe(ar,{variant:"contained",startIcon:Fe(cm,{}),onClick:m,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),mn(St,{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:[Fe(St,{children:mn("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Fe("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Fe(St,{children:Fe("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),Fe(St,{children:Fe("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),Fe(St,{children:Fe("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."})})]})]}):Fe(ar,{variant:"contained",onClick:r,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Fe(oy,{open:e,onClose:i,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:d}],actions:{showCancelButton:!1,left:Fe(ar,{variant:"outlined",startIcon:Fe(cm,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Fe(ar,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{useEffect as iy,useMemo as Ja,useState as Za}from"react";import{Box as lr,Button as ay,Typography as ly}from"@mui/material";import{FormDialog as sy}from"@ehfuse/mui-form-dialog";import{SearchTextField as cy}from"@ehfuse/mui-form-controls";import{TreeView as my}from"@ehfuse/tree-view";import{Fragment as gy,jsx as Wo,jsxs as by}from"react/jsx-runtime";function um(e){return`${e.name}#${e.seq}`}function uy(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function dy(e){let o=[],t=n=>{for(let r of n.employees??[])o.push(r);for(let r of n.groups??[])t(r)};for(let n of e)t(n);return o}function py(e,o){return o?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(t=>String(t).toLowerCase().includes(o)):!0}function fy(e){let o=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:um(e),renderLabel:Wo(lr,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:Wo(lr,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:o})})}}function dm(e,o){let t=(e.groups??[]).map(r=>dm(r,o)).filter(r=>r!==null),n=(e.employees??[]).filter(r=>py(r,o)).map(fy);return t.length===0&&n.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...t,...n]}}function xy({groups:e,allEmployees:o,initialSelectedSeqs:t,multiple:n,isMobile:r,onSelectionChange:i}){let[a,s]=Za(""),u=Ja(()=>e.map(d=>dm(d,a.trim().toLowerCase())).filter(d=>d!==null),[e,a]),m=Ja(()=>o.filter(d=>t.includes(d.seq)).map(um),[]);return by(gy,{children:[Wo(lr,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:Wo(cy,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:s,onClear:()=>s(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),Wo(lr,{sx:r?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:Wo(my,{items:u,checkbox:!0,multiSelect:n,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:m,onChange:d=>i(d.map(uy).filter(p=>p>0)),styles:{border:"none",borderRadius:"0"}})})]})}function f2({open:e,title:o="\uC9C1\uC6D0 \uC120\uD0DD",hint:t="",groups:n,multiple:r=!1,selectedSeqs:i,confirmText:a="\uD655\uC778",onConfirm:s,onClose:u}){let m=He(),[d,p]=Za([]),[l,c]=Za(0),f=Ja(()=>dy(n),[n]),w=i??[];iy(()=>{e&&(p(w),c(x=>x+1))},[e]);let h=()=>{let x=f.filter(g=>d.includes(g.seq));s(r?x:x.slice(0,1)),u()};return Wo(sy,{open:e,onClose:u,title:`${o}${r&&d.length>0?` (${d.length}\uBA85)`:""}`,locale:"ko",fullScreen:m,mobilePresentation:m?"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:Wo(lr,{sx:{...m?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...m?{}:{overflow:"hidden"},userSelect:"none"},children:Wo(xy,{groups:n,allEmployees:f,initialSelectedSeqs:w,multiple:r,isMobile:m,onSelectionChange:p},l)})}],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:t?Wo(ly,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:t}):void 0,right:Wo(ay,{variant:"contained",onClick:h,children:a})}})}import{useEffect as yy,useMemo as Sy,useState as By}from"react";import{Box as Pn,Button as Cy,Divider as vy}from"@mui/material";import{FormDialog as Iy}from"@ehfuse/mui-form-dialog";import{LabelSelect as _y}from"@ehfuse/mui-form-controls";import{Box as Zo}from"@mui/material";import{jsx as Mn,jsxs as En}from"react/jsx-runtime";function hy(e,o){let t=o.filter(n=>n.sprint_seq===e.seq&&!n.archived&&n.completed);return{points:t.reduce((n,r)=>n+(r.story_points??0),0),count:t.length}}function pm({sprints:e,tasks:o,height:t=160}){let r=[...e].sort((d,p)=>`${d.start_date}|${d.seq}`.localeCompare(`${p.start_date}|${p.seq}`)).map(d=>({sprint:d,...hy(d,o)})),i=r.some(d=>d.points>0),a=r.map(d=>i?d.points:d.count),s=Math.max(1,...a),u=r.filter(d=>d.sprint.status==="closed").map(d=>i?d.points:d.count),m=u.length>0?Math.round(u.reduce((d,p)=>d+p,0)/u.length*10)/10:null;return r.length===0?Mn(Zo,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):En(Zo,{children:[En(Zo,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[En("span",{children:["\uC644\uB8CC ",i?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),m!==null?En("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",Mn(Zo,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:m}),i?"SP":"\uAC74"]}):null]}),Mn(Zo,{sx:{display:"flex",alignItems:"flex-end",gap:2,height:t,px:.5},children:r.map(d=>{let p=i?d.points:d.count,l=Math.round((t-24)*p/s),c=d.sprint.status==="closed";return En(Zo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:[Mn(Zo,{sx:{fontSize:14,fontWeight:700,color:"#37352f",lineHeight:1.5},children:p}),Mn(Zo,{sx:{width:"60%",maxWidth:56,height:Math.max(2,l),borderRadius:"4px 4px 0 0",bgcolor:c?"#2f80ed":"#a9c9f5"}})]},d.sprint.seq)})}),Mn(Zo,{sx:{display:"flex",gap:2,px:.5,mt:.5},children:r.map(d=>En(Zo,{sx:{flex:1,minWidth:0,textAlign:"center",fontSize:13.5,color:"#000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[d.sprint.name,d.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""]},d.sprint.seq))})]})}import{useMemo as ky}from"react";import{Box as un}from"@mui/material";import{jsx as et,jsxs as dn}from"react/jsx-runtime";function fm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function Ty(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function el(e){return e.slice(5).replace("-",".")}function xm({sprint:e,tasks:o,todayStr:t,height:n=200}){let r=ky(()=>{let x=fm(e.start_date),g=fm(e.end_date);if(!x||!g||g<x||Math.round((g.getTime()-x.getTime())/864e5)+1>366)return null;let b=o.filter(S=>S.sprint_seq===e.seq&&!S.archived);if(b.length===0)return{empty:!0};let O=b.some(S=>(S.story_points??0)>0),_=S=>O?S.story_points??0:1,P=b.reduce((S,k)=>S+_(k),0),C=new Map;for(let S of b){if(!S.completed)continue;let k=(S.completed_time??"").slice(0,10),H=/^\d{4}-\d{2}-\d{2}$/.test(k)?k:e.start_date;C.set(H,(C.get(H)??0)+_(S))}let F=[];for(let S=new Date(x);S<=g;S.setDate(S.getDate()+1))F.push(Ty(S));let D=P,Z=[];for(let S of F){if(S>t)break;D-=C.get(S)??0,Z.push({day:S,value:Math.max(0,D)})}return{empty:!1,days:F,total:P,usePoints:O,actual:Z}},[e,o,t]);if(!r)return et(un,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\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."});if(r.empty)return et(un,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let{days:i,total:a,usePoints:s,actual:u}=r,m=600,d=200,p=8,l=x=>i.length===1?0:x/(i.length-1)*m,c=x=>p+(d-p*2)*(1-x/Math.max(1,a)),f=`${l(0)},${c(a)} ${l(i.length-1)},${c(0)}`,w=u.map(x=>`${l(i.indexOf(x.day))},${c(x.value)}`).join(" "),h=u[u.length-1];return dn(un,{children:[dn(un,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[dn("span",{children:["\uB0A8\uC740 ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",a]}),h?dn("span",{children:["\uD604\uC7AC"," ",et(un,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:h.value}),s?"SP":"\uAC74"," \uB0A8\uC74C"]}):null]}),et(un,{sx:{border:"1px solid #e6e6e3",borderRadius:1,bgcolor:"#fafaf9",px:1,py:.5},children:dn("svg",{viewBox:`0 0 ${m} ${d}`,preserveAspectRatio:"none",style:{display:"block",width:"100%",height:n},children:[et("line",{x1:0,y1:c(0),x2:m,y2:c(0),stroke:"#e6e6e3",strokeWidth:1}),et("polyline",{points:f,fill:"none",stroke:"#9a9a97",strokeWidth:1.5,strokeDasharray:"6 5",vectorEffect:"non-scaling-stroke"}),u.length>1?et("polyline",{points:w,fill:"none",stroke:"#2f80ed",strokeWidth:2.5,vectorEffect:"non-scaling-stroke"}):null,h?et("circle",{cx:l(i.indexOf(h.day)),cy:c(h.value),r:4,fill:"#2f80ed",vectorEffect:"non-scaling-stroke"}):null]})}),dn(un,{sx:{mt:.5,display:"flex",justifyContent:"space-between",fontSize:13.5,color:"#000"},children:[et("span",{children:el(e.start_date)}),t>e.start_date&&t<e.end_date?dn("span",{children:["\uC624\uB298 ",el(t)]}):null,et("span",{children:el(e.end_date)})]})]})}import{jsx as Bt,jsxs as ol}from"react/jsx-runtime";function M2({open:e,sprints:o,tasks:t,todayStr:n,initialSprintSeq:r=0,onClose:i}){let[a,s]=By(0);yy(()=>{if(!e)return;let d=o.find(l=>l.status==="active")??o[0],p=o.find(l=>l.seq===r)??d;s(p?.seq??0)},[e]);let u=Sy(()=>o.find(d=>d.seq===a)??null,[o,a]),m=ol(Pn,{sx:{display:"flex",flexDirection:"column"},children:[ol(Pn,{sx:{px:3,py:2.5},children:[Bt(Pn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBCA8\uB85C\uC2DC\uD2F0"}),Bt(pm,{sprints:o,tasks:t})]}),Bt(vy,{sx:{borderColor:"#e6e6e3"}}),ol(Pn,{sx:{px:3,py:2.5},children:[Bt(Pn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBC88\uB2E4\uC6B4"}),Bt(_y,{label:"\uBAA9\uD45C",showLabel:!1,value:a?String(a):"",options:o.map(d=>({value:String(d.seq),label:wo(d)})),onChange:d=>s(Number(d.target.value)||0),sx:{width:280,mb:2}}),u?Bt(xm,{sprint:u,tasks:t,todayStr:n}):Bt(Pn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694."})]})]});return Bt(Iy,{open:e,onClose:i,width:680,title:"\uBAA9\uD45C \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[{id:"sprint-charts",showTitle:!1,children:m}],actions:{showCancelButton:!1,right:Bt(Cy,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Checkbox as wy,Divider as Dy,Menu as Oy,MenuItem as tl}from"@mui/material";import{jsx as sr,jsxs as gm}from"react/jsx-runtime";function q2({anchorEl:e,candidates:o,selectedNames:t,avatarSrcByName:n,onToggle:r,onClear:i,onClose:a}){return gm(Oy,{anchorEl:e,open:!!e,onClose:a,transitionDuration:0,children:[o.length===0?sr(tl,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):o.map(s=>{let u=t.includes(s.name);return gm(tl,{onClick:()=>r(s),sx:{fontSize:14,minWidth:170,gap:1},children:[sr(wy,{size:"small",checked:u,sx:{p:0}}),sr(fo,{names:[s.name],size:20,avatarSrcByName:n}),s.name]},`${s.accountSeq}-${s.name}`)}),sr(Dy,{}),sr(tl,{disabled:t.length===0,onClick:i,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as My}from"react";import{ButtonBase as Ey,Menu as Py,MenuItem as Ry}from"@mui/material";import zy from"@mui/icons-material/KeyboardArrowDown";import qy from"@mui/icons-material/Check";import{Fragment as Ay,jsx as nl,jsxs as rl}from"react/jsx-runtime";function K2({value:e,onChange:o,options:t}){let[n,r]=My(null),i=t??Fi,a=Fi.find(s=>s.value===e)?.label??"";return rl(Ay,{children:[rl(Ey,{onClick:s=>r(s.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[a,nl(zy,{sx:{fontSize:17,color:"#9a9a97"}})]}),nl(Py,{transitionDuration:0,anchorEl:n,open:!!n,onClose:()=>r(null),children:i.map(s=>rl(Ry,{selected:s.value===e,onClick:()=>{o(s.value),r(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[s.label,s.value===e?nl(qy,{sx:{fontSize:16,color:"#2f80ed"}}):null]},s.value))})]})}import{Box as bi,ButtonBase as Ly}from"@mui/material";import{DateTextField as bm}from"@ehfuse/mui-form-controls";function pn(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function gi(e,o=new Date){let t=new Date(o);return t.setMonth(t.getMonth()-e),t}function G2(e=new Date){return{fromDate:pn(gi(1,e)),toDate:pn(e)}}import{jsx as cr,jsxs as hm}from"react/jsx-runtime";var Ny=[{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 km({fromDate:e,toDate:o,onChange:t}){let n=i=>{if(i<=0){t("","");return}t(pn(gi(i)),pn(new Date))},r=i=>i<=0?!e&&!o:!e||!o?!1:e===pn(gi(i))&&o===pn(new Date);return hm(bi,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[cr(bi,{sx:{display:"flex",alignItems:"center",gap:1.5},children:Ny.map(i=>{let a=r(i.months);return cr(Ly,{onClick:()=>n(i.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:a?500:400,border:"1px solid",borderColor:a?"#2f80ed":"#dedddb",color:a?"#2f80ed":"#37352f",bgcolor:a?"#eef6ff":"transparent","&:hover":{bgcolor:a?"#eef6ff":"#f7f7f5"}},children:i.label},i.label)})}),hm(bi,{sx:{display:"flex",alignItems:"center",gap:.5},children:[cr(bm,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:i=>t(i.target.value,o),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),cr(bi,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),cr(bm,{value:o,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:i=>t(e,i.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as Fy}from"@mui/material";import{jsx as Tm}from"react/jsx-runtime";function tz({anchorEl:e,fromDate:o,toDate:t,onChange:n,onClose:r}){return Tm(Fy,{transitionDuration:0,anchorEl:e,open:!!e,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Tm(km,{fromDate:o,toDate:t,onChange:n})})}import{Box as Hy,ButtonBase as Wy,Tab as $y,Tabs as Ky}from"@mui/material";import Uy from"@mui/icons-material/Checklist";import Vy from"@mui/icons-material/Face";import Gy from"@mui/icons-material/Publish";import Yy from"@mui/icons-material/NotificationsOutlined";import jy from"@mui/icons-material/BugReportOutlined";import Xy from"@mui/icons-material/DescriptionOutlined";import Qy from"@mui/icons-material/Inventory2Outlined";import{jsx as $o}from"react/jsx-runtime";function ym(e,o){return o>0?`${e} (${o})`:e}var xz=[{id:"my",label:"\uC804\uCCB4",icon:$o(Uy,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:$o(Yy,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:$o(Vy,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:$o(Gy,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:$o(jy,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:$o(Qy,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:$o(Xy,{sx:{fontSize:18}}),hideCount:!0}];function Jy(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 gz({items:e,activeTab:o,counts:t,onChange:n,compact:r=!1}){let i=oe(),a=Jy(i.tabs),s=e;return r?$o(Hy,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:s.map(u=>{let m=o===u.id;return $o(Wy,{onClick:()=>n(u.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:uo(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:m?i.tabs.selectedBg:i.tabs.bg,color:m?i.tabs.selectedColor:i.tabs.color,borderColor:m?i.tabs.selectedBg:i.tabs.borderColor},children:ym(u.label,u.hideCount?0:t[u.id]??0)},u.id)})}):$o(Ky,{value:o,onChange:(u,m)=>n(m),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:s.map(u=>$o($y,{value:u.id,label:ym(u.label,u.hideCount?0:t[u.id]??0),icon:u.icon,iconPosition:"start",sx:a},u.id))})}import{useEffect as Zy,useMemo as eS,useState as il}from"react";import{Divider as al,ListItemIcon as Eo,Menu as ll,MenuItem as co}from"@mui/material";import oS from"@mui/icons-material/OpenInNewOutlined";import tS from"@mui/icons-material/Check";import nS from"@mui/icons-material/CheckCircleOutlined";import rS from"@mui/icons-material/RadioButtonUnchecked";import iS from"@mui/icons-material/SendOutlined";import aS from"@mui/icons-material/EventOutlined";import lS from"@mui/icons-material/PersonOutlineOutlined";import sS from"@mui/icons-material/ViewKanbanOutlined";import cS from"@mui/icons-material/ContentCopyOutlined";import mS from"@mui/icons-material/NextPlanOutlined";import uS from"@mui/icons-material/ContentPasteOutlined";import dS from"@mui/icons-material/ShareOutlined";import pS from"@mui/icons-material/DirectionsRunOutlined";import Sm from"@mui/icons-material/ChevronRight";import fS from"@mui/icons-material/ArchiveOutlined";import xS from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as gS}from"@ehfuse/alerts";import{Fragment as bS,jsx as ce,jsxs as ro}from"react/jsx-runtime";function Vz({target:e,onClose:o,customTabs:t,sprints:n=[],myAccountSeq:r=0,onOpenDetail:i,onToggleCompleted:a,onRequestConfirm:s,onChangeDueDate:u,onChangeReminder:m,onMemberEdit:d,onMoveProject:p,onDuplicate:l,onCreateFollowUp:c,onShare:f,onAssignSprint:w,onArchiveToggle:h,onDelete:x}){let g=He(),I=Uo(),[b,O]=il(null),[_,P]=il(null),[C,F]=il(null);Zy(()=>{e||(O(null),P(null),F(null))},[e]);let D=e?.task??null,Z=!!D?.is_notice,S=!!D?.is_event,k=D?!it(D,r):!1,H=eS(()=>new Set(t.filter(R=>R.useSprints).map(R=>R.key)),[t]),K=async()=>{let R=D;if(o(),!R)return;await gS({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:`"${R.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&x(R.seq)},G=()=>{D&&h(D.seq,!D.archived),o()};return ro(bS,{children:[ro(ll,{open:!!e,onClose:o,transitionDuration:0,anchorReference:g?"none":"anchorPosition",anchorPosition:!g&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...g?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:g?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[ro(co,{onClick:()=>{D&&i(D),o()},sx:{fontSize:14},children:[ce(Eo,{children:ce(oS,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),ro(co,{disabled:Z?(D?.author_account_seq??0)!==r:(D?.author_account_seq??0)!==r&&(D?.manager_account_seq??0)!==r,onClick:()=>{D&&a(D.seq,!D.completed),o()},sx:{fontSize:14},children:[ce(Eo,{children:D?.completed?ce(rS,{sx:{fontSize:19}}):ce(nS,{sx:{fontSize:19}})}),D?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!Z&&s?ro(co,{disabled:!(D?.manager_account_seq??0)&&(D?.receiver_account_seqs??[]).length===0,onClick:()=>{D&&s(D),o()},sx:{fontSize:14},children:[ce(Eo,{children:ce(iS,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,S?null:ce(al,{}),S?null:ro(co,{disabled:k,onClick:R=>{D&&O({anchorEl:R.currentTarget,task:D})},sx:{fontSize:14},children:[ce(Eo,{children:ce(aS,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uAE30\uD55C \uBCC0\uACBD"]}),!Z&&!S&&d?ro(co,{onClick:()=>{D&&d(D,"manager"),o()},sx:{fontSize:14},children:[ce(Eo,{children:ce(lS,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,S?null:ro(co,{disabled:k,onClick:R=>{D&&P({anchorEl:R.currentTarget,task:D})},sx:{fontSize:14},children:[ce(Eo,{children:ce(sS,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ce(Sm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ce(al,{}),l?ro(co,{disabled:k,onClick:()=>{D&&l(D.seq),o()},sx:{fontSize:14},children:[ce(Eo,{children:ce(cS,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,c&&D&&!D.is_event&&!D.is_notice?ro(co,{onClick:()=>{D&&c(D.seq),o()},sx:{fontSize:14},children:[ce(Eo,{children:ce(mS,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,ro(co,{onClick:()=>{D&&(f?f(D):fi(D,g)),o()},sx:{fontSize:14},children:[ce(Eo,{children:g?ce(dS,{sx:{fontSize:19}}):ce(uS,{sx:{fontSize:19}})}),g?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),D&&!D.is_notice&&!D.is_event&&H.has(String(D.tab_key??""))&&w?ro(co,{onClick:R=>F(R.currentTarget),sx:{fontSize:14},children:[ce(Eo,{children:ce(pS,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ce(Sm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,ro(co,{onClick:G,disabled:k||!D?.archived&&!(D&&hr(D)),sx:{fontSize:14},children:[ce(Eo,{children:D?.archived?ce(xS,{sx:{fontSize:19}}):ce(fS,{sx:{fontSize:19}})}),D?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ce(al,{}),ro(co,{disabled:k,onClick:K,sx:{fontSize:14,color:"#e5484d"},children:[ce(Eo,{children:ce(mt,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C"]})]}),ce(Pt,{anchorEl:b?.anchorEl??null,open:!!b,date:b?.task.due_date??"",reminder:b?.task.reminder??"none",hideReminder:!!b?.task.completed,centered:g,onClose:()=>{O(null),o()},onDateChange:R=>{b&&u(b.task.seq,R)},onReminderChange:R=>{b&&m?.(b.task.seq,R)}}),ro(ll,{transitionDuration:0,anchorEl:_?.anchorEl??null,open:!!_,onClose:()=>{P(null),o()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...I,children:[ce(co,{selected:!_?.task.tab_key,onClick:()=>{_&&p(_.task.seq,""),P(null),o()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),t.filter(R=>!R.archived).map(R=>ce(co,{selected:_?.task.tab_key===R.key,onClick:()=>{_&&p(_.task.seq,R.key),P(null),o()},sx:{fontSize:14,minWidth:170},children:R.label},R.key))]}),ce(ll,{transitionDuration:0,anchorEl:C,open:!!C,onClose:()=>F(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...n.filter(R=>`custom-${R.group_seq}`===String(D?.tab_key??"")).map(R=>({seq:R.seq,label:wo(R)}))].map(R=>ro(co,{onClick:()=>{D&&w?.(D.seq,R.seq),F(null),o()},sx:{fontSize:14,minWidth:160,gap:1},children:[R.label,(D?.sprint_seq??0)===R.seq?ce(tS,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.seq))})]})}import{Checkbox as hS,Divider as kS,Menu as TS,MenuItem as Bm}from"@mui/material";import{jsx as hi,jsxs as Cm}from"react/jsx-runtime";function Qz({anchorEl:e,labelOptions:o,selectedKeys:t,onToggle:n,onClear:r,onClose:i}){return Cm(TS,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,children:[o.map(a=>{let s=t.includes(a.key);return Cm(Bm,{onClick:()=>n(a.key),sx:{fontSize:14,minWidth:190,gap:1},children:[hi(hS,{size:"small",checked:s,sx:{p:0}}),hi(_e,{option:a})]},a.key)}),hi(kS,{}),hi(Bm,{disabled:t.length===0,onClick:()=>{r(),i()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as vm,Menu as yS,MenuItem as sl}from"@mui/material";import SS from"@mui/icons-material/Check";import BS from"@mui/icons-material/BarChartOutlined";import CS from"@mui/icons-material/SettingsOutlined";import{jsx as mr,jsxs as ki}from"react/jsx-runtime";function iq(e){let{anchorEl:o,sprints:t,value:n,onSelect:r,onManage:i,onCharts:a,onClose:s}=e;return ki(yS,{transitionDuration:0,anchorEl:o,open:!!o,onClose:s,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...t.map(u=>({seq:u.seq,label:wo(u)}))].map(u=>ki(sl,{onClick:()=>{r(u.seq),s()},sx:{fontSize:14,minWidth:180,gap:1},children:[u.label,n===u.seq?mr(SS,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},u.seq)),mr(vm,{}),a?ki(sl,{onClick:()=>{s(),a()},sx:{fontSize:14,gap:1},children:[mr(BS,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uCC28\uD2B8"]}):null,a?mr(vm,{}):null,ki(sl,{onClick:()=>{s(),i()},sx:{fontSize:14,gap:1},children:[mr(CS,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var vS={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function IS(e){return vS[e]??"tasks"}var sq={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"},Im=["list","calendar","month","card","kanban","sprint","timeline"],_S=["list","card"];function cq(e){let o=IS(e);switch(o){case"notice":return{kind:o,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:o,viewOptions:Im,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:o,viewOptions:_S,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:o,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:o,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:o,viewOptions:Im,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"}:{}}}}export{pv as ALL_TASK_VIEWER_ACCOUNT_SEQS,Tc as AddLabelDialog,Pr as AddTabDialog,gc as AttachmentUploadGauge,Pa as AttachmentUploadPercent,Ei as BUG_DEVICE_OPTIONS,Fn as BUG_ICON_COLOR,XC as BUG_KANBAN_COLUMNS,Mi as BUG_REPRO_OPTIONS,Pi as BUG_RESOLUTION_OPTIONS,Kt as BUG_STATUS_OPTIONS,Nn as BUG_TASK_ICON,ni as BugPropertiesGrid,Qp as COLUMN_WIDTHS,zi as COMPLETED_STATUS_OPTION,Ya as CUSTOM_TAB_KEY_PREFIX,QR as CalendarImportDialog,i2 as CalendarSubscribeDialog,Or as CommentBubbleIcon,hn as ConfirmCountButton,Zl as DATE_REMINDER_OPTIONS,vi as DEFAULT_PROJECT_ICON,xz as DEFAULT_TASKBOX_TAB_ITEMS,De as DEFAULT_TASK_ICON,tz as DateRangeFilterPopover,Oo as DrawerSection,Pt as DueDatePickerPopover,Op as ENDED_EVENT_STATUS_OPTION,_c as EVENT_ICON_COLOR,f2 as EmployeeSelectDialog,Fi as GROUP_BY_OPTIONS,Sn as GoogleEventChip,K2 as GroupByMenuButton,Er as IconPickerGrid,rc as InlineAddressInput,Tt as InlineTextValue,qi as KANBAN_CLOSED_COLUMN_KEY,Qz as LabelFilterMenu,mi as LabelSelectMenu,Wn as MANUAL_TASK_STATUS_OPTIONS,q2 as MemberFilterMenu,Hn as NOTICE_STATUS_OPTIONS,Ro as NOTICE_TASK_ICON,vl as NO_TASK_ICON,Ii as PROJECT_ICON_OPTIONS,me as PropertyRow,gn as RECEIVER_AVATAR_COLORS,es as REMINDER_OPTIONS,fo as ReceiverAvatarStack,Qc as RelatedTasksSection,fr as STATUS_KEY_REPLIED,An as STATUS_KEY_WAITING,Ar as SortableTaskCard,xm as SprintBurndownChart,M2 as SprintChartsDialog,iq as SprintFilterMenu,HR as SprintManageDialog,pm as SprintVelocityChart,Sr as StatusSelectMenu,$i as TASKBOX_COLUMNS,Qo as TASKBOX_DRAWER_NARROW_MQ,Il as TASKBOX_UI_STATE_ID,sq as TASKBOX_VIEW_LABELS,xD as TASKBOX_VIEW_MODES,$t as TASK_STATUS_OPTIONS,$f as TIME_REMINDER_OPTIONS,qr as TaskAckListPopover,bn as TaskActionButton,si as TaskAttachmentsSection,Vs as TaskBoxColumnSummary,sa as TaskBoxGroupBoard,oO as TaskBoxMobileList,zs as TaskBoxMonthAgenda,Es as TaskBoxMonthCalendar,wD as TaskBoxSprintColumnSummary,is as TaskBoxTable,gz as TaskBoxTabs,Hs as TaskBoxTimeline,fD as TaskBoxView,vs as TaskBoxWeekCalendar,Qt as TaskCardContent,ii as TaskChecklistSection,Lc as TaskCommentInput,Ac as TaskCommentsSection,ri as TaskContentEditor,Vz as TaskContextMenu,ti as TaskCorePropertiesGrid,wc as TaskCreateBody,cP as TaskCreateDrawer,km as TaskDateRangeFilter,em as TaskDetailBody,wR as TaskDetailDrawer,$c as TaskDetailHeader,Jr as TaskIconPickerPopover,Mt as TaskLabelChips,Yc as TaskLinkDialog,Kc as TaskNoteField,zo as TaskPriorityChip,_e as TaskStatusChip,nv as TaskStatusChips,zm as TaskboxProvider,ny as buildCalendarFeedUrl,Tn as buildCardBaseSx,Rl as buildStatusOptionColors,Hi as buildTaskGroupSections,Vc as buildTaskRelationsModel,Yk as buildTaskShareText,gr as buildTaskboxTheme,zl as canAssignBugManager,Cr as canClaimTaskItem,it as canEditTaskItem,Br as canViewTaskItem,vr as canVolunteerTaskItem,$s as countWorkdays,vp as createTaskboxTheme,Us as daysLeftUntil,_i as defaultTaskBoxFormValues,wi as defaultTaskboxUiStateValues,vc as filterFilesWithinLimit,z1 as formatConfirmTime,Ws as formatHours,Go as formatKoreanDate,at as formatKoreanDateTime,wo as formatSprintOptionLabel,Ml as getBugDeviceName,Ol as getBugReproName,br as getBugResolutionName,Mp as getBugStatusOption,G2 as getDefaultDateRange,$n as getEventDisplayStatusOption,QC as getNoDueStatusRank,Cc as getNoticeAckInfo,El as getNoticeStatusOption,yE as getNoticeTargetDisplay,xr as getProjectIconAnchorComponent,ze as getProjectIconComponent,Ji as getReminderLabel,Qi as getReminderOptions,Pl as getStatusOptionsForTask,cq as getTabHeaderConfig,Ui as getTaskBoxColumnDefs,Ir as getTaskBoxGridTemplate,IS as getTaskBoxTabKind,ls as getTaskConfirmInfo,po as getTaskDisplayStatusOption,kr as getTaskStatusOption,yn as groupGoogleEventsByDate,ja as groupSeqFromTabKey,n5 as hasRelation,Lh as htmlToPlainText,HT as isCustomTabKey,Ni as isOpenPoolTaskItem,Ri as isPastEvent,hr as isTaskDone,Ai as isWaitingTask,gi as monthsAgoDate,so as narrowOrderSx,_R as nowDateTimeString,yb as parseEstimatedHours,an as relationsOf,xn as resolveTaskStatusOptions,Oi as resolveTaskboxTheme,fi as shareTaskText,Ks as sumRemainingHours,ui as summarizeNoticeTargets,MR as tabKeyFromGroupSeq,pn as toYmd,Tr as toggleLabelKey,Ci as useBuildFileUrl,xc as useTaskAttachmentUploadMeta,So as useTaskboxConfig,Tp as useTaskboxForm,oe as useTaskboxTheme,rt as useTaskboxUiState,Ln as useUploadMaxMb};
14
14
  //# sourceMappingURL=index.esm.js.map