@ehfuse/taskbox 0.5.296 → 0.5.297

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
@@ -26,8 +26,8 @@ use chrome, FireFox or Internet Explorer 11`)}var r=e("safe-buffer"),t=e("random
26
26
  `)):L=p.stylize("[Circular]","special")),B(E)){if(S&&k.match(/^\d+$/))return L;(E=JSON.stringify(""+k)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(E=E.substr(1,E.length-2),E=p.stylize(E,"name")):(E=E.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),E=p.stylize(E,"string"))}return E+": "+L}function u(p){return Array.isArray(p)}function g(p){return typeof p=="boolean"}function m(p){return p===null}function x(p){return typeof p=="number"}function _(p){return typeof p=="string"}function B(p){return p===void 0}function A(p){return j(p)&&q(p)==="[object RegExp]"}function j(p){return typeof p=="object"&&p!==null}function D(p){return j(p)&&q(p)==="[object Date]"}function P(p){return j(p)&&(q(p)==="[object Error]"||p instanceof Error)}function N(p){return typeof p=="function"}function q(p){return Object.prototype.toString.call(p)}function z(p){return p<10?"0"+p.toString(10):p.toString(10)}b.debuglog=function(p){if(B(r)&&(r=l.env.NODE_DEBUG||""),p=p.toUpperCase(),!t[p])if(new RegExp("\\b"+p+"\\b","i").test(r)){var y=l.pid;t[p]=function(){var v=b.format.apply(b,arguments);console.error("%s %d: %s",p,y,v)}}else t[p]=function(){};return t[p]},b.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},b.isArray=u,b.isBoolean=g,b.isNull=m,b.isNullOrUndefined=function(p){return p==null},b.isNumber=x,b.isString=_,b.isSymbol=function(p){return typeof p=="symbol"},b.isUndefined=B,b.isRegExp=A,b.isObject=j,b.isDate=D,b.isError=P,b.isFunction=N,b.isPrimitive=function(p){return p===null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||typeof p=="symbol"||p===void 0},b.isBuffer=e("./support/isBuffer");var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var p=new Date,y=[z(p.getHours()),z(p.getMinutes()),z(p.getSeconds())].join(":");return[p.getDate(),T[p.getMonth()],y].join(" ")}function R(p,y){return Object.prototype.hasOwnProperty.call(p,y)}b.log=function(){console.log("%s - %s",C(),b.format.apply(b,arguments))},b.inherits=e("inherits"),b._extend=function(p,y){if(!y||!j(y))return p;for(var v=Object.keys(y),w=v.length;w--;)p[v[w]]=y[v[w]];return p}}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":526,_process:467,inherits:525}],528:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"v1",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(b,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(b,"v4",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(b,"v5",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(b,"NIL",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(b,"version",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(b,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(b,"stringify",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(b,"parse",{enumerable:!0,get:function(){return a.default}});var l=d(e("./v1.js")),o=d(e("./v3.js")),s=d(e("./v4.js")),r=d(e("./v5.js")),t=d(e("./nil.js")),n=d(e("./version.js")),c=d(e("./validate.js")),i=d(e("./stringify.js")),a=d(e("./parse.js"));function d(f){return f&&f.__esModule?f:{default:f}}},{"./nil.js":530,"./parse.js":531,"./stringify.js":535,"./v1.js":536,"./v3.js":537,"./v4.js":539,"./v5.js":540,"./validate.js":541,"./version.js":542}],529:[function(e,h,b){"use strict";function l(a){return 14+(a+64>>>9<<4)+1}function o(a,d){let f=(65535&a)+(65535&d);return(a>>16)+(d>>16)+(f>>16)<<16|65535&f}function s(a,d,f,u,g,m){return o((x=o(o(d,a),o(u,m)))<<(_=g)|x>>>32-_,f);var x,_}function r(a,d,f,u,g,m,x){return s(d&f|~d&u,a,d,g,m,x)}function t(a,d,f,u,g,m,x){return s(d&u|f&~u,a,d,g,m,x)}function n(a,d,f,u,g,m,x){return s(d^f^u,a,d,g,m,x)}function c(a,d,f,u,g,m,x){return s(f^(d|~u),a,d,g,m,x)}Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var i=function(a){if(typeof a=="string"){let d=unescape(encodeURIComponent(a));a=new Uint8Array(d.length);for(let f=0;f<d.length;++f)a[f]=d.charCodeAt(f)}return(function(d){let f=[],u=32*d.length;for(let g=0;g<u;g+=8){let m=d[g>>5]>>>g%32&255,x=parseInt("0123456789abcdef".charAt(m>>>4&15)+"0123456789abcdef".charAt(15&m),16);f.push(x)}return f})((function(d,f){d[f>>5]|=128<<f%32,d[l(f)-1]=f;let u=1732584193,g=-271733879,m=-1732584194,x=271733878;for(let _=0;_<d.length;_+=16){let B=u,A=g,j=m,D=x;u=r(u,g,m,x,d[_],7,-680876936),x=r(x,u,g,m,d[_+1],12,-389564586),m=r(m,x,u,g,d[_+2],17,606105819),g=r(g,m,x,u,d[_+3],22,-1044525330),u=r(u,g,m,x,d[_+4],7,-176418897),x=r(x,u,g,m,d[_+5],12,1200080426),m=r(m,x,u,g,d[_+6],17,-1473231341),g=r(g,m,x,u,d[_+7],22,-45705983),u=r(u,g,m,x,d[_+8],7,1770035416),x=r(x,u,g,m,d[_+9],12,-1958414417),m=r(m,x,u,g,d[_+10],17,-42063),g=r(g,m,x,u,d[_+11],22,-1990404162),u=r(u,g,m,x,d[_+12],7,1804603682),x=r(x,u,g,m,d[_+13],12,-40341101),m=r(m,x,u,g,d[_+14],17,-1502002290),g=r(g,m,x,u,d[_+15],22,1236535329),u=t(u,g,m,x,d[_+1],5,-165796510),x=t(x,u,g,m,d[_+6],9,-1069501632),m=t(m,x,u,g,d[_+11],14,643717713),g=t(g,m,x,u,d[_],20,-373897302),u=t(u,g,m,x,d[_+5],5,-701558691),x=t(x,u,g,m,d[_+10],9,38016083),m=t(m,x,u,g,d[_+15],14,-660478335),g=t(g,m,x,u,d[_+4],20,-405537848),u=t(u,g,m,x,d[_+9],5,568446438),x=t(x,u,g,m,d[_+14],9,-1019803690),m=t(m,x,u,g,d[_+3],14,-187363961),g=t(g,m,x,u,d[_+8],20,1163531501),u=t(u,g,m,x,d[_+13],5,-1444681467),x=t(x,u,g,m,d[_+2],9,-51403784),m=t(m,x,u,g,d[_+7],14,1735328473),g=t(g,m,x,u,d[_+12],20,-1926607734),u=n(u,g,m,x,d[_+5],4,-378558),x=n(x,u,g,m,d[_+8],11,-2022574463),m=n(m,x,u,g,d[_+11],16,1839030562),g=n(g,m,x,u,d[_+14],23,-35309556),u=n(u,g,m,x,d[_+1],4,-1530992060),x=n(x,u,g,m,d[_+4],11,1272893353),m=n(m,x,u,g,d[_+7],16,-155497632),g=n(g,m,x,u,d[_+10],23,-1094730640),u=n(u,g,m,x,d[_+13],4,681279174),x=n(x,u,g,m,d[_],11,-358537222),m=n(m,x,u,g,d[_+3],16,-722521979),g=n(g,m,x,u,d[_+6],23,76029189),u=n(u,g,m,x,d[_+9],4,-640364487),x=n(x,u,g,m,d[_+12],11,-421815835),m=n(m,x,u,g,d[_+15],16,530742520),g=n(g,m,x,u,d[_+2],23,-995338651),u=c(u,g,m,x,d[_],6,-198630844),x=c(x,u,g,m,d[_+7],10,1126891415),m=c(m,x,u,g,d[_+14],15,-1416354905),g=c(g,m,x,u,d[_+5],21,-57434055),u=c(u,g,m,x,d[_+12],6,1700485571),x=c(x,u,g,m,d[_+3],10,-1894986606),m=c(m,x,u,g,d[_+10],15,-1051523),g=c(g,m,x,u,d[_+1],21,-2054922799),u=c(u,g,m,x,d[_+8],6,1873313359),x=c(x,u,g,m,d[_+15],10,-30611744),m=c(m,x,u,g,d[_+6],15,-1560198380),g=c(g,m,x,u,d[_+13],21,1309151649),u=c(u,g,m,x,d[_+4],6,-145523070),x=c(x,u,g,m,d[_+11],10,-1120210379),m=c(m,x,u,g,d[_+2],15,718787259),g=c(g,m,x,u,d[_+9],21,-343485551),u=o(u,B),g=o(g,A),m=o(m,j),x=o(x,D)}return[u,g,m,x]})((function(d){if(d.length===0)return[];let f=8*d.length,u=new Uint32Array(l(f));for(let g=0;g<f;g+=8)u[g>>5]|=(255&d[g/8])<<g%32;return u})(a),8*a.length))};b.default=i},{}],530:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0,b.default="00000000-0000-0000-0000-000000000000"},{}],531:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l,o=(l=e("./validate.js"))&&l.__esModule?l:{default:l},s=function(r){if(!(0,o.default)(r))throw TypeError("Invalid UUID");let t,n=new Uint8Array(16);return n[0]=(t=parseInt(r.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(r.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(r.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(r.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};b.default=s},{"./validate.js":541}],532:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0,b.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],533:[function(e,h,b){"use strict";let l;Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(){if(!l&&(l=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!l))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(o)};let o=new Uint8Array(16)},{}],534:[function(e,h,b){"use strict";function l(r,t,n,c){switch(r){case 0:return t&n^~t&c;case 1:return t^n^c;case 2:return t&n^t&c^n&c;case 3:return t^n^c}}function o(r,t){return r<<t|r>>>32-t}Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var s=function(r){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){let d=unescape(encodeURIComponent(r));r=[];for(let f=0;f<d.length;++f)r.push(d.charCodeAt(f))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);let c=r.length/4+2,i=Math.ceil(c/16),a=new Array(i);for(let d=0;d<i;++d){let f=new Uint32Array(16);for(let u=0;u<16;++u)f[u]=r[64*d+4*u]<<24|r[64*d+4*u+1]<<16|r[64*d+4*u+2]<<8|r[64*d+4*u+3];a[d]=f}a[i-1][14]=8*(r.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(r.length-1)&4294967295;for(let d=0;d<i;++d){let f=new Uint32Array(80);for(let B=0;B<16;++B)f[B]=a[d][B];for(let B=16;B<80;++B)f[B]=o(f[B-3]^f[B-8]^f[B-14]^f[B-16],1);let u=n[0],g=n[1],m=n[2],x=n[3],_=n[4];for(let B=0;B<80;++B){let A=Math.floor(B/20),j=o(u,5)+l(A,g,m,x)+_+t[A]+f[B]>>>0;_=x,x=m,m=o(g,30)>>>0,g=u,u=j}n[0]=n[0]+u>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+x>>>0,n[4]=n[4]+_>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]};b.default=s},{}],535:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l,o=(l=e("./validate.js"))&&l.__esModule?l:{default:l};let s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).substr(1));var r=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=(s[t[n+0]]+s[t[n+1]]+s[t[n+2]]+s[t[n+3]]+"-"+s[t[n+4]]+s[t[n+5]]+"-"+s[t[n+6]]+s[t[n+7]]+"-"+s[t[n+8]]+s[t[n+9]]+"-"+s[t[n+10]]+s[t[n+11]]+s[t[n+12]]+s[t[n+13]]+s[t[n+14]]+s[t[n+15]]).toLowerCase();if(!(0,o.default)(c))throw TypeError("Stringified UUID is invalid");return c};b.default=r},{"./validate.js":541}],536:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l=s(e("./rng.js")),o=s(e("./stringify.js"));function s(a){return a&&a.__esModule?a:{default:a}}let r,t,n=0,c=0;var i=function(a,d,f){let u=d&&f||0,g=d||new Array(16),m=(a=a||{}).node||r,x=a.clockseq!==void 0?a.clockseq:t;if(m==null||x==null){let P=a.random||(a.rng||l.default)();m==null&&(m=r=[1|P[0],P[1],P[2],P[3],P[4],P[5]]),x==null&&(x=t=16383&(P[6]<<8|P[7]))}let _=a.msecs!==void 0?a.msecs:Date.now(),B=a.nsecs!==void 0?a.nsecs:c+1,A=_-n+(B-c)/1e4;if(A<0&&a.clockseq===void 0&&(x=x+1&16383),(A<0||_>n)&&a.nsecs===void 0&&(B=0),B>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");n=_,c=B,t=x,_+=122192928e5;let j=(1e4*(268435455&_)+B)%4294967296;g[u++]=j>>>24&255,g[u++]=j>>>16&255,g[u++]=j>>>8&255,g[u++]=255&j;let D=_/4294967296*1e4&268435455;g[u++]=D>>>8&255,g[u++]=255&D,g[u++]=D>>>24&15|16,g[u++]=D>>>16&255,g[u++]=x>>>8|128,g[u++]=255&x;for(let P=0;P<6;++P)g[u+P]=m[P];return d||(0,o.default)(g)};b.default=i},{"./rng.js":533,"./stringify.js":535}],537:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l=s(e("./v35.js")),o=s(e("./md5.js"));function s(t){return t&&t.__esModule?t:{default:t}}var r=(0,l.default)("v3",48,o.default);b.default=r},{"./md5.js":529,"./v35.js":538}],538:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(n,c,i){function a(d,f,u,g){if(typeof d=="string"&&(d=(function(x){x=unescape(encodeURIComponent(x));let _=[];for(let B=0;B<x.length;++B)_.push(x.charCodeAt(B));return _})(d)),typeof f=="string"&&(f=(0,o.default)(f)),f.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+d.length);if(m.set(f),m.set(d,f.length),m=i(m),m[6]=15&m[6]|c,m[8]=63&m[8]|128,u){g=g||0;for(let x=0;x<16;++x)u[g+x]=m[x];return u}return(0,l.default)(m)}try{a.name=n}catch{}return a.DNS=r,a.URL=t,a},b.URL=b.DNS=void 0;var l=s(e("./stringify.js")),o=s(e("./parse.js"));function s(n){return n&&n.__esModule?n:{default:n}}let r="6ba7b810-9dad-11d1-80b4-00c04fd430c8";b.DNS=r;let t="6ba7b811-9dad-11d1-80b4-00c04fd430c8";b.URL=t},{"./parse.js":531,"./stringify.js":535}],539:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l=s(e("./rng.js")),o=s(e("./stringify.js"));function s(t){return t&&t.__esModule?t:{default:t}}var r=function(t,n,c){let i=(t=t||{}).random||(t.rng||l.default)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){c=c||0;for(let a=0;a<16;++a)n[c+a]=i[a];return n}return(0,o.default)(i)};b.default=r},{"./rng.js":533,"./stringify.js":535}],540:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l=s(e("./v35.js")),o=s(e("./sha1.js"));function s(t){return t&&t.__esModule?t:{default:t}}var r=(0,l.default)("v5",80,o.default);b.default=r},{"./sha1.js":534,"./v35.js":538}],541:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l,o=(l=e("./regex.js"))&&l.__esModule?l:{default:l},s=function(r){return typeof r=="string"&&o.default.test(r)};b.default=s},{"./regex.js":532}],542:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var l,o=(l=e("./validate.js"))&&l.__esModule?l:{default:l},s=function(r){if(!(0,o.default)(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)};b.default=s},{"./validate.js":541}],543:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CHAR=`
27
27
  \r -\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}`,b.S=` \r
28
28
  `,b.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NAME_CHAR="-"+b.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.CHAR_RE=new RegExp("^["+b.CHAR+"]$","u"),b.S_RE=new RegExp("^["+b.S+"]+$","u"),b.NAME_START_CHAR_RE=new RegExp("^["+b.NAME_START_CHAR+"]$","u"),b.NAME_CHAR_RE=new RegExp("^["+b.NAME_CHAR+"]$","u"),b.NAME_RE=new RegExp("^["+b.NAME_START_CHAR+"]["+b.NAME_CHAR+"]*$","u"),b.NMTOKEN_RE=new RegExp("^["+b.NAME_CHAR+"]+$","u");function l(o){return o>=65&&o<=90||o>=97&&o<=122||o===58||o===95||o===8204||o===8205||o>=192&&o<=214||o>=216&&o<=246||o>=248&&o<=767||o>=880&&o<=893||o>=895&&o<=8191||o>=8304&&o<=8591||o>=11264&&o<=12271||o>=12289&&o<=55295||o>=63744&&o<=64975||o>=65008&&o<=65533||o>=65536&&o<=983039}b.S_LIST=[32,10,13,9],b.isChar=function(o){return o>=32&&o<=55295||o===10||o===13||o===9||o>=57344&&o<=65533||o>=65536&&o<=1114111},b.isS=function(o){return o===32||o===10||o===13||o===9},b.isNameStartChar=l,b.isNameChar=function(o){return l(o)||o>=48&&o<=57||o===45||o===46||o===183||o>=768&&o<=879||o>=8255&&o<=8256}},{}],544:[function(e,h,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CHAR="-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}",b.RESTRICTED_CHAR="-\b\v\f-\x7F-\x84\x86-\x9F",b.S=` \r
29
- `,b.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NAME_CHAR="-"+b.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.CHAR_RE=new RegExp("^["+b.CHAR+"]$","u"),b.RESTRICTED_CHAR_RE=new RegExp("^["+b.RESTRICTED_CHAR+"]$","u"),b.S_RE=new RegExp("^["+b.S+"]+$","u"),b.NAME_START_CHAR_RE=new RegExp("^["+b.NAME_START_CHAR+"]$","u"),b.NAME_CHAR_RE=new RegExp("^["+b.NAME_CHAR+"]$","u"),b.NAME_RE=new RegExp("^["+b.NAME_START_CHAR+"]["+b.NAME_CHAR+"]*$","u"),b.NMTOKEN_RE=new RegExp("^["+b.NAME_CHAR+"]+$","u");function l(o){return o>=65&&o<=90||o>=97&&o<=122||o===58||o===95||o===8204||o===8205||o>=192&&o<=214||o>=216&&o<=246||o>=248&&o<=767||o>=880&&o<=893||o>=895&&o<=8191||o>=8304&&o<=8591||o>=11264&&o<=12271||o>=12289&&o<=55295||o>=63744&&o<=64975||o>=65008&&o<=65533||o>=65536&&o<=983039}b.S_LIST=[32,10,13,9],b.isChar=function(o){return o>=1&&o<=55295||o>=57344&&o<=65533||o>=65536&&o<=1114111},b.isRestrictedChar=function(o){return o>=1&&o<=8||o===11||o===12||o>=14&&o<=31||o>=127&&o<=132||o>=134&&o<=159},b.isCharAndNotRestricted=function(o){return o===9||o===10||o===13||o>31&&o<127||o===133||o>159&&o<=55295||o>=57344&&o<=65533||o>=65536&&o<=1114111},b.isS=function(o){return o===32||o===10||o===13||o===9},b.isNameStartChar=l,b.isNameChar=function(o){return l(o)||o>=48&&o<=57||o===45||o===46||o===183||o>=768&&o<=879||o>=8255&&o<=8256}},{}],545:[function(e,h,b){"use strict";function l(o){return o>=65&&o<=90||o===95||o>=97&&o<=122||o>=192&&o<=214||o>=216&&o<=246||o>=248&&o<=767||o>=880&&o<=893||o>=895&&o<=8191||o>=8204&&o<=8205||o>=8304&&o<=8591||o>=11264&&o<=12271||o>=12289&&o<=55295||o>=63744&&o<=64975||o>=65008&&o<=65533||o>=65536&&o<=983039}Object.defineProperty(b,"__esModule",{value:!0}),b.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NC_NAME_CHAR="-"+b.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.NC_NAME_START_CHAR_RE=new RegExp("^["+b.NC_NAME_START_CHAR+"]$","u"),b.NC_NAME_CHAR_RE=new RegExp("^["+b.NC_NAME_CHAR+"]$","u"),b.NC_NAME_RE=new RegExp("^["+b.NC_NAME_START_CHAR+"]["+b.NC_NAME_CHAR+"]*$","u"),b.isNCNameStartChar=l,b.isNCNameChar=function(o){return l(o)||o===45||o===46||o>=48&&o<=57||o===183||o>=768&&o<=879||o>=8255&&o<=8256}},{}]},{},[15])(15)}))});var Od="waiting",bT="replied";var io={basis:"count",default_capacity:0,by_account:{}};function xT(e){let h=e&&typeof e=="object"&&!Array.isArray(e)?e:{},b=h.basis==="points"?"points":"count",l=Math.max(0,Math.floor(Number(h.default_capacity)||0)),o={},s=h.by_account&&typeof h.by_account=="object"?h.by_account:{};for(let[r,t]of Object.entries(s)){let n=Number(r)||0,c=Math.max(0,Math.floor(Number(t)||0));n>0&&c>0&&(o[n]=c)}return{basis:b,default_capacity:l,by_account:o}}import{createContext as eg,useContext as tg,useMemo as Dd}from"react";import{Box as rg}from"@mui/material";var ic="--app-mobile-font-offset";function kr(e,h=0){return`calc(${e}px + max(0px, var(${ic}, 0px) - ${h}px))`}import{jsx as Ad}from"react/jsx-runtime";var Pd=eg({});function ng({config:e,children:h}){let b=Dd(()=>e??{},[e]),l=b.mobileFontOffsetPx;return Ad(Pd.Provider,{value:b,children:l===void 0?h:Ad(rg,{sx:{display:"contents",[ic]:`${l}px`},children:h})})}function Sr(){return tg(Pd)}function ps(){let{buildFileUrl:e}=Sr();return Dd(()=>e||((h,b)=>{let l=[];return b?.thumb&&l.push(`thumb=${b.thumb}`),b?.download&&l.push("download=1"),`/api/v1/files/${h}${l.length?`?${l.join("&")}`:""}`}),[e])}function ms(){let{uploadMaxMb:e}=Sr();return e??50}import{useGlobalForm as q1}from"@ehfuse/forma";import Nd from"@mui/icons-material/DoNotDisturbAltOutlined";import Ld from"@mui/icons-material/BookmarkBorderOutlined";import og from"@mui/icons-material/LabelOutlined";import ig from"@mui/icons-material/FlagOutlined";import sg from"@mui/icons-material/StarBorderOutlined";import ag from"@mui/icons-material/FolderOutlined";import lg from"@mui/icons-material/EventOutlined";import cg from"@mui/icons-material/BuildOutlined";import ug from"@mui/icons-material/LocalShippingOutlined";import dg from"@mui/icons-material/StorefrontOutlined";import fg from"@mui/icons-material/GroupsOutlined";import hg from"@mui/icons-material/LightbulbOutlined";import pg from"@mui/icons-material/FavoriteBorderOutlined";import mg from"@mui/icons-material/AssignmentOutlined";import gg from"@mui/icons-material/HomeOutlined";import bg from"@mui/icons-material/WorkOutline";import yg from"@mui/icons-material/SchoolOutlined";import xg from"@mui/icons-material/LocalHospitalOutlined";import vg from"@mui/icons-material/RestaurantOutlined";import wg from"@mui/icons-material/LocalFloristOutlined";import _g from"@mui/icons-material/DirectionsCarOutlined";import kg from"@mui/icons-material/CampaignOutlined";import Sg from"@mui/icons-material/SavingsOutlined";import Tg from"@mui/icons-material/Inventory2Outlined";import Cg from"@mui/icons-material/CleaningServicesOutlined";import jd from"@mui/icons-material/HandymanOutlined";import Bg from"@mui/icons-material/LocalPhoneOutlined";import Ig from"@mui/icons-material/EmailOutlined";import Eg from"@mui/icons-material/ShoppingCartOutlined";import Mg from"@mui/icons-material/BarChartOutlined";import Rg from"@mui/icons-material/PrintOutlined";import Og from"@mui/icons-material/SecurityOutlined";import Ag from"@mui/icons-material/AlarmOutlined";import Dg from"@mui/icons-material/AttachFileOutlined";import Pg from"@mui/icons-material/PhotoCameraOutlined";import Ng from"@mui/icons-material/ImageOutlined";import Lg from"@mui/icons-material/MenuBookOutlined";import jg from"@mui/icons-material/EditOutlined";import zg from"@mui/icons-material/KeyOutlined";import Fg from"@mui/icons-material/LockOutlined";import qg from"@mui/icons-material/LockOpenOutlined";import $g from"@mui/icons-material/SettingsOutlined";import Hg from"@mui/icons-material/CloudOutlined";import Wg from"@mui/icons-material/WifiOutlined";import Ug from"@mui/icons-material/ComputerOutlined";import Vg from"@mui/icons-material/SmartphoneOutlined";import Kg from"@mui/icons-material/TvOutlined";import Gg from"@mui/icons-material/AccessTimeOutlined";import Yg from"@mui/icons-material/TimerOutlined";import Xg from"@mui/icons-material/MapOutlined";import Zg from"@mui/icons-material/PlaceOutlined";import Jg from"@mui/icons-material/NavigationOutlined";import Qg from"@mui/icons-material/FlightOutlined";import eb from"@mui/icons-material/TrainOutlined";import tb from"@mui/icons-material/DirectionsBusOutlined";import rb from"@mui/icons-material/DirectionsBikeOutlined";import nb from"@mui/icons-material/DirectionsWalkOutlined";import ob from"@mui/icons-material/DirectionsRunOutlined";import ib from"@mui/icons-material/FitnessCenterOutlined";import sb from"@mui/icons-material/SportsSoccerOutlined";import ab from"@mui/icons-material/EmojiEventsOutlined";import lb from"@mui/icons-material/CardGiftcardOutlined";import cb from"@mui/icons-material/CakeOutlined";import zd from"@mui/icons-material/CoffeeOutlined";import ub from"@mui/icons-material/LocalPizzaOutlined";import db from"@mui/icons-material/ShoppingBagOutlined";import Fd from"@mui/icons-material/CreditCardOutlined";import fb from"@mui/icons-material/AccountBalanceOutlined";import hb from"@mui/icons-material/AccountBalanceWalletOutlined";import pb from"@mui/icons-material/AttachMoneyOutlined";import mb from"@mui/icons-material/ReceiptLongOutlined";import gb from"@mui/icons-material/CalculateOutlined";import bb from"@mui/icons-material/TrendingUpOutlined";import yb from"@mui/icons-material/ListAltOutlined";import xb from"@mui/icons-material/TaskAltOutlined";import vb from"@mui/icons-material/DoneAllOutlined";import wb from"@mui/icons-material/WarningAmberOutlined";import _b from"@mui/icons-material/InfoOutlined";import kb from"@mui/icons-material/HelpOutlined";import Sb from"@mui/icons-material/SupportAgentOutlined";import Tb from"@mui/icons-material/PersonOutlined";import Cb from"@mui/icons-material/PersonAddOutlined";import Bb from"@mui/icons-material/BadgeOutlined";import Ib from"@mui/icons-material/WbSunnyOutlined";import Eb from"@mui/icons-material/DarkModeOutlined";import Mb from"@mui/icons-material/LocalFireDepartmentOutlined";import Rb from"@mui/icons-material/WaterDropOutlined";import Ob from"@mui/icons-material/BoltOutlined";import Ab from"@mui/icons-material/AutorenewOutlined";import Db from"@mui/icons-material/ScienceOutlined";import Pb from"@mui/icons-material/MedicalServicesOutlined";import Nb from"@mui/icons-material/NotificationsOutlined";import Lb from"@mui/icons-material/SendOutlined";import jb from"@mui/icons-material/LinkOutlined";import zb from"@mui/icons-material/PublicOutlined";import qd from"@mui/icons-material/ApartmentOutlined";import Fb from"@mui/icons-material/PlumbingOutlined";import qb from"@mui/icons-material/ElectricalServicesOutlined";import $b from"@mui/icons-material/ChatOutlined";import Hb from"@mui/icons-material/DescriptionOutlined";import Wb from"@mui/icons-material/FactCheckOutlined";import Ub from"@mui/icons-material/RocketLaunchOutlined";import Vb from"@mui/icons-material/PaletteOutlined";import Kb from"@mui/icons-material/MusicNoteOutlined";import Gb from"@mui/icons-material/VideocamOutlined";import Yb from"@mui/icons-material/ThumbUpOutlined";import Xb from"@mui/icons-material/PushPinOutlined";import Zb from"@mui/icons-material/SearchOutlined";import Jb from"@mui/icons-material/VisibilityOutlined";import Qb from"@mui/icons-material/VerifiedOutlined";import e1 from"@mui/icons-material/TrackChangesOutlined";import t1 from"@mui/icons-material/ExtensionOutlined";import r1 from"@mui/icons-material/CodeOutlined";import n1 from"@mui/icons-material/BugReportOutlined";import o1 from"@mui/icons-material/SmartToyOutlined";import i1 from"@mui/icons-material/StorageOutlined";import s1 from"@mui/icons-material/QrCode2Outlined";import a1 from"@mui/icons-material/FileDownloadOutlined";import l1 from"@mui/icons-material/FileUploadOutlined";import c1 from"@mui/icons-material/MicOutlined";import u1 from"@mui/icons-material/HeadphonesOutlined";import d1 from"@mui/icons-material/MovieOutlined";import f1 from"@mui/icons-material/SportsEsportsOutlined";import h1 from"@mui/icons-material/BrushOutlined";import p1 from"@mui/icons-material/ArchitectureOutlined";import m1 from"@mui/icons-material/EngineeringOutlined";import g1 from"@mui/icons-material/FactoryOutlined";import b1 from"@mui/icons-material/AgricultureOutlined";import y1 from"@mui/icons-material/DirectionsBoatOutlined";import x1 from"@mui/icons-material/TwoWheelerOutlined";import v1 from"@mui/icons-material/HandshakeOutlined";import w1 from"@mui/icons-material/GavelOutlined";import _1 from"@mui/icons-material/BalanceOutlined";import k1 from"@mui/icons-material/TranslateOutlined";import S1 from"@mui/icons-material/PsychologyOutlined";import T1 from"@mui/icons-material/PetsOutlined";import C1 from"@mui/icons-material/CelebrationOutlined";import B1 from"@mui/icons-material/BeachAccessOutlined";import I1 from"@mui/icons-material/AcUnitOutlined";import E1 from"@mui/icons-material/ForestOutlined";import M1 from"@mui/icons-material/LandscapeOutlined";import R1 from"@mui/icons-material/HotelOutlined";import O1 from"@mui/icons-material/LocalLaundryServiceOutlined";import A1 from"@mui/icons-material/ChairOutlined";import D1 from"@mui/icons-material/LocalBarOutlined";import P1 from"@mui/icons-material/LunchDiningOutlined";import N1 from"@mui/icons-material/IcecreamOutlined";import L1 from"@mui/icons-material/WorkspacePremiumOutlined";import j1 from"@mui/icons-material/DiamondOutlined";import z1 from"@mui/icons-material/VaccinesOutlined";var sc="bookmark",so="label",or="notifications",ar="event",gs="warning",bs="#e53e3e",$d="none",ac=[{key:$d,Icon:Nd},{key:"label",Icon:og},{key:"bookmark",Icon:Ld},{key:"flag",Icon:ig},{key:"star",Icon:sg},{key:"folder",Icon:ag},{key:"event",Icon:lg},{key:"build",Icon:cg},{key:"shipping",Icon:ug},{key:"store",Icon:dg},{key:"groups",Icon:fg},{key:"idea",Icon:hg},{key:"heart",Icon:pg},{key:"assignment",Icon:mg},{key:"home",Icon:gg},{key:"work",Icon:bg},{key:"school",Icon:yg},{key:"hospital",Icon:xg},{key:"restaurant",Icon:vg},{key:"flower",Icon:wg},{key:"car",Icon:_g},{key:"campaign",Icon:kg},{key:"savings",Icon:Sg},{key:"inventory",Icon:Tg},{key:"cleaning",Icon:Cg},{key:"handyman",Icon:jd},{key:"phone",Icon:Bg},{key:"email",Icon:Ig},{key:"cart",Icon:Eg},{key:"chart",Icon:Mg},{key:"print",Icon:Rg},{key:"security",Icon:Og},{key:"alarm",Icon:Ag},{key:"attach",Icon:Dg},{key:"camera",Icon:Pg},{key:"image",Icon:Ng},{key:"book",Icon:Lg},{key:"edit",Icon:jg},{key:"key",Icon:zg},{key:"lock",Icon:Fg},{key:"unlock",Icon:qg},{key:"settings",Icon:$g},{key:"cloud",Icon:Hg},{key:"wifi",Icon:Wg},{key:"computer",Icon:Ug},{key:"smartphone",Icon:Vg},{key:"tv",Icon:Kg},{key:"clock",Icon:Gg},{key:"timer",Icon:Yg},{key:"map",Icon:Xg},{key:"place",Icon:Zg},{key:"navigation",Icon:Jg},{key:"flight",Icon:Qg},{key:"train",Icon:eb},{key:"bus",Icon:tb},{key:"bike",Icon:rb},{key:"walk",Icon:nb},{key:"run",Icon:ob},{key:"fitness",Icon:ib},{key:"soccer",Icon:sb},{key:"trophy",Icon:ab},{key:"gift",Icon:lb},{key:"cake",Icon:cb},{key:"coffee",Icon:zd},{key:"pizza",Icon:ub},{key:"bag",Icon:db},{key:"card",Icon:Fd},{key:"bank",Icon:fb},{key:"wallet",Icon:hb},{key:"money",Icon:pb},{key:"receipt",Icon:mb},{key:"calculate",Icon:gb},{key:"trending",Icon:bb},{key:"listalt",Icon:yb},{key:"task",Icon:xb},{key:"doneall",Icon:vb},{key:"warning",Icon:wb},{key:"info",Icon:_b},{key:"help",Icon:kb},{key:"support",Icon:Sb},{key:"person",Icon:Tb},{key:"personadd",Icon:Cb},{key:"badge",Icon:Bb},{key:"sun",Icon:Ib},{key:"moon",Icon:Eb},{key:"fire",Icon:Mb},{key:"water",Icon:Rb},{key:"bolt",Icon:Ob},{key:"renew",Icon:Ab},{key:"science",Icon:Db},{key:"medical",Icon:Pb},{key:"notifications",Icon:Nb},{key:"send",Icon:Lb},{key:"link",Icon:jb},{key:"public",Icon:zb},{key:"apartment",Icon:qd},{key:"plumbing",Icon:Fb},{key:"electrical",Icon:qb},{key:"chat",Icon:$b},{key:"description",Icon:Hb},{key:"factcheck",Icon:Wb},{key:"rocket",Icon:Ub},{key:"palette",Icon:Vb},{key:"music",Icon:Kb},{key:"video",Icon:Gb},{key:"thumbup",Icon:Yb},{key:"pin",Icon:Xb},{key:"search",Icon:Zb},{key:"eye",Icon:Jb},{key:"verified",Icon:Qb},{key:"target",Icon:e1},{key:"extension",Icon:t1},{key:"code",Icon:r1},{key:"bug",Icon:n1},{key:"robot",Icon:o1},{key:"storage",Icon:i1},{key:"qrcode",Icon:s1},{key:"download",Icon:a1},{key:"upload",Icon:l1},{key:"mic",Icon:c1},{key:"headphones",Icon:u1},{key:"movie",Icon:d1},{key:"game",Icon:f1},{key:"brush",Icon:h1},{key:"architecture",Icon:p1},{key:"engineering",Icon:m1},{key:"factory",Icon:g1},{key:"agriculture",Icon:b1},{key:"boat",Icon:y1},{key:"motorcycle",Icon:x1},{key:"handshake",Icon:v1},{key:"gavel",Icon:w1},{key:"balance",Icon:_1},{key:"translate",Icon:k1},{key:"psychology",Icon:S1},{key:"pets",Icon:T1},{key:"celebration",Icon:C1},{key:"beach",Icon:B1},{key:"snow",Icon:I1},{key:"forest",Icon:E1},{key:"mountain",Icon:M1},{key:"hotel",Icon:R1},{key:"laundry",Icon:O1},{key:"chair",Icon:A1},{key:"bar",Icon:D1},{key:"burger",Icon:P1},{key:"icecream",Icon:N1},{key:"medal",Icon:L1},{key:"diamond",Icon:j1},{key:"vaccine",Icon:z1}],F1={cafe:zd,payment:Fd,business:qd,construction:jd};function wt(e){return e===$d?null:ac.find(h=>h.key===e)?.Icon??F1[String(e??"")]??Ld}function m9(e){return wt(e)??Nd}var lc={title:"",icon:so,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,visibility:"involved",visibility_group_seq:0,repeat_rule:"",repeat_until:"",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:"",reminders:[],priority:"medium",label_keys:[],note:"",content:"",checklist:[],tab_key:""},cc={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function $1(e){let{formId:h="taskbox-create-form",initialValues:b,onValidate:l,onSubmit:o}=e;return q1({formId:h,initialValues:{...lc,...b},onValidate:l,onSubmit:o})}import{useGlobalFormaState as H1}from"@ehfuse/forma";var Hd="taskbox-ui-state";function ao(){return H1({stateId:Hd,initialValues:cc})}import{useMemo as W1}from"react";import{useTheme as U1}from"@mui/material";function Bi(e,h){let b=Math.max(0,Math.min(1,h));if(b<=0)return"transparent";let l=e.trim().replace("#",""),o=l.length===3?l.split("").map(n=>n+n).join(""):l;if(!/^[0-9a-fA-F]{6}$/.test(o))return e;let s=Number.parseInt(o.slice(0,2),16),r=Number.parseInt(o.slice(2,4),16),t=Number.parseInt(o.slice(4,6),16);return`rgba(${s}, ${r}, ${t}, ${b})`}function Wd(e,h){let b=Math.max(0,Math.min(1,h)),l=e.trim().replace("#",""),o=l.length===3?l.split("").map(c=>c+c).join(""):l;if(!/^[0-9a-fA-F]{6}$/.test(o))return e;let s=c=>Math.round(c+(255-c)*b),r=s(Number.parseInt(o.slice(0,2),16)),t=s(Number.parseInt(o.slice(2,4),16)),n=s(Number.parseInt(o.slice(4,6),16));return`#${[r,t,n].map(c=>c.toString(16).padStart(2,"0")).join("")}`}function uc(e,h,b){return b==="dark"?{accent:e,accentContrast:h,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",surfaceHoverStrong:"#323a45",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:h,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:"#f8f8f7",surfaceHoverStrong:"#efefed",border:"#e6e6e3",borderStrong:"#dedddb"}}function V1(e,h){let b=h==="dark";return{bg:b?Wd(e.accent,.45):e.accent,color:b?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function Ud(e,h){return{...e,...h??{}}}function ka(e,h="light"){let b=h==="dark",l=V1(e,h),o=e.accentOnSurface;return{mode:h,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:o,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:h==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHoverStrong,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:h==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:h==="dark"?400:700,minHeight:48,badge:{...l,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...l,borderRadius:4,width:34}},summary:{gaugeTrackColor:h==="dark"?e.borderStrong:"#ececea",gaugeBarColor:o,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:o,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:h==="dark"?e.surfaceSubtle:e.surface,color:h==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:h==="dark"?e.border:e.borderStrong,selectedBg:h==="dark"?e.surfaceHover:e.textStrong,selectedColor:h==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:b?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:b?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:b?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:b?"#232a33":e.surface,borderColor:b?"#333c47":e.border,hoverBg:b?"#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:h==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:h==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function dc(e,h){if(!h)return e;let b=h.mode??e.mode,o={...b===e.mode?e.colors:uc(e.colors.accent,e.colors.accentContrast,b),...h.colors??{}},s=ka(o,b),{groupHeader:r,...t}=h.table??{},{badge:n,...c}=h.board??{},{badge:i,...a}=r??{};return{mode:b,colors:o,table:{...s.table,...t,groupHeader:{...s.table.groupHeader,...a,badge:Ud(s.table.groupHeader.badge,i)}},board:{...s.board,...c,badge:Ud(s.board.badge,n)},summary:{...s.summary,...h.summary??{}},chip:{...s.chip,...h.chip??{}},actionButton:{...s.actionButton,...h.actionButton??{}},tabs:{...s.tabs,...h.tabs??{}},avatar:{...s.avatar,...h.avatar??{}},calendar:{...s.calendar,...h.calendar??{}},card:{...s.card,...h.card??{}},timeline:{...s.timeline,...h.timeline??{}}}}function K1(e={}){let{mode:h="light",accent:b="#2563eb",accentContrast:l="#ffffff",input:o}=e;return dc(ka(uc(b,l,h),h),o)}function ct(){let e=U1(),{theme:h}=Sr(),b=e.palette.primary.main,l=e.palette.primary.contrastText,o=e.palette.mode==="dark"?"dark":"light";return W1(()=>dc(ka(uc(b,l,o),o),h),[b,l,o,h])}import{useCallback as Fn,useEffect as Ha,useMemo as qn,useRef as Lx,useState as $n}from"react";import{Box as Er,Divider as jx,IconButton as zx,ListItemIcon as Fx,Menu as Ef,MenuItem as Wa}from"@mui/material";import Mf from"@mui/icons-material/Add";import qx from"@mui/icons-material/ArrowUpward";import $x from"@mui/icons-material/ArrowDownward";import Hx from"@mui/icons-material/KeyboardArrowDown";import Wx from"@mui/icons-material/KeyboardArrowRight";import zc from"@mui/icons-material/Check";import Ux from"@mui/icons-material/FilterList";import Vx from"@mui/icons-material/InboxOutlined";import{Virtuoso as Kx}from"react-virtuoso";import Gx from"@ehfuse/overlay-scrollbar";import{Box as Vd}from"@mui/material";import{jsx as Y1,jsxs as X1}from"react/jsx-runtime";var G1={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 Lr({priority:e,small:h=!1,plain:b=!1}){let l=G1[e],o=ct(),s=o.mode==="dark",r=b||e==="low";return X1(Vd,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:h?.5:.75,px:r?0:h?.9:1.25,py:r?0:h?.25:.5,borderRadius:.75,fontSize:h?11.5:13,fontWeight:500,bgcolor:r?"transparent":s?Bi(l.dot,o.chip.darkBgAlpha):l.bgcolor,color:r?s?o.chip.plainColor:l.color:s?o.chip.darkTextSource==="fg"?l.color:l.dot:l.color,whiteSpace:"nowrap"},children:[Y1(Vd,{component:"span",sx:{width:h?6:8,height:h?6:8,borderRadius:"50%",bgcolor:l.dot}}),l.label]})}import{Menu as ty,MenuItem as ry}from"@mui/material";import ny from"@mui/icons-material/Check";function Nn(){return{}}var fc=[{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"}],hc=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],pc=[{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 Kd(e){return fc.find(h=>h.key===e)?.name??""}function Gd(e){return hc.find(h=>h.key===e)?.name??""}function Sa(e){return pc.find(h=>h.key===e)?.name??""}function mc(e,h=new Date){if(!e.is_event)return!1;let b=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(b))return!1;let l=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(l)){let s=new Date(`${b}T${l}:00`);return!Number.isNaN(s.getTime())&&s.getTime()<=h.getTime()}let o=new Date(`${b}T00:00:00`);return Number.isNaN(o.getTime())?!1:(o.setDate(o.getDate()+1),o.getTime()<=h.getTime())}function Ta(e,h=new Date){return e.is_event?mc(e,h):!!e.completed}var nn=[{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:"review_waiting",name:"\uAC80\uD1A0\uB300\uAE30",bg:"#ede9fe",fg:"#5b3fa8",dot:"#8b5cf6"},{key:"hold",name:"\uBCF4\uB958",bg:"#fbeee0",fg:"#8a5a2b",dot:"#d9730d"}],xs=nn;function Ca(e){return nn.find(h=>h.key===e)??nn[0]}var gc={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function lr(e){if(e.is_notice)return Yd(e.status);if(e.is_bug&&e.completed){let h=Sa(e.resolution)||"\uC644\uB8CC";return{...gc,name:h}}return e.completed&&e.status!=="hold"?gc:e.is_bug?J1(e.status):Ca(e.status)}var Z1={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function vs(e){return mc(e)?Z1:null}var ys=[{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 Yd(e){return ys.find(h=>h.key===e)??ys[1]}var bc="__closed__",ni=[{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"}],H9=[...ni.filter(e=>e.key!=="bug_hold"),{key:bc,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...ni.filter(e=>e.key==="bug_hold")];function J1(e){return ni.find(h=>h.key===e)??ni[0]}function Ba(e){return e.is_notice?ys:e.is_bug?ni:xs}function W9(e){return e.status===Od}var Q1={in_progress:0,not_started:2,hold:3};function U9(e){return e.completed?9:Q1[String(e.status??"")]??2}function Ii(e,h){let b=new Map(h.map(o=>[o.key,o])),l=(e.label_keys??[]).map(o=>b.get(o)).filter(o=>!!o);if(e.is_event){let o=vs({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return o?[o,...l]:l}return e.is_notice?String(e.status??"")==="notice_active"?l:[Yd(e.status),...l]:e.is_bug?[lr({...e,is_notice:!1}),...l]:e.completed?[gc,...l]:[Ca(e.status),...l]}function Xd(e){return{bg:`${e}1f`,fg:e,dot:e}}function Ia(e,h){return e.includes(h)?e.filter(b=>b!==h):[...e,h]}import{Box as Ea}from"@mui/material";import{jsx as ws,jsxs as ey}from"react/jsx-runtime";function At({option:e,small:h=!1}){let b=ct(),l=b.mode==="dark",o=e.key==="not_started";return ey(Ea,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:h?.5:.75,px:o?0:h?.9:1.25,py:o?0:h?.25:.5,borderRadius:1.25,fontSize:h?11.5:13,fontWeight:500,bgcolor:o?"transparent":l?Bi(e.dot,b.chip.darkBgAlpha):e.bg,color:o?l?b.chip.plainColor:e.fg:l?b.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[ws(Ea,{component:"span",sx:{width:h?6:8,height:h?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function Z9({task:e,statusOptions:h,small:b=!1}){let l=Ii(e,h);return l.length===0?null:ws(Ea,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:l.map(o=>ws(At,{option:o,small:b},o.key))})}function No({labelKeys:e,labelOptions:h}){let b=new Map(h.map(o=>[o.key,o])),l=e.map(o=>b.get(o)).filter(o=>!!o);return l.length===0?null:ws(Ea,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:l.map(o=>ws(At,{option:o,small:!0},o.key))})}import{jsx as yc,jsxs as oy}from"react/jsx-runtime";function Ei({anchorEl:e,value:h,options:b=nn,onSelect:l,onClose:o}){let s=Nn();return yc(ty,{anchorEl:e,open:!!e,onClose:o,transitionDuration:0,...s,children:b.map(r=>oy(ry,{onClick:()=>{l(r.key),o()},sx:{fontSize:14,minWidth:150,gap:1},children:[yc(At,{option:r}),h===r.key?yc(ny,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},r.key))})}function xc(e){let h=String(e??"").trim().replace("T"," "),b=h.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return b?new Date(Number(b[1]),Number(b[2])-1,Number(b[3]),Number(b[4]??0),Number(b[5]??0),Number(b[6]??0)):new Date(h)}function gr(e,h="YYYY-MM-DD"){let b=typeof e=="string"?xc(e):e;if(!e||e===""||isNaN(b.getTime()))return"";let l=b.getFullYear(),o=(b.getMonth()+1).toString().padStart(2,"0"),s=b.getDate().toString().padStart(2,"0"),r=l.toString().slice(-2);switch(h){case"YYYY-MM-DD":return`${l}-${o}-${s}`;case"YY.MM.DD":return`${r}.${o}.${s}`;case"MM/DD/YYYY":return`${o}/${s}/${l}`;case"DD.MM.YYYY":return`${s}.${o}.${l}`;case"YYYYMMDD":return`${l}${o}${s}`;default:return h.replace(/YYYY/g,l.toString()).replace(/YY/g,r).replace(/MM/g,o).replace(/DD/g,s)}}function Zd(){return gr(new Date)}var vc=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uC77C\uC2DC"},{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 iy(e){let h=new Date(`${e}T00:00:00`);return h.setDate(h.getDate()+(6-h.getDay())),gr(h)}var sy=[{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 ay(e,h,b){let l=e.due_date.slice(0,10);return l?l<h?"overdue":l===h?"today":l<=b?"this_week":"later":"no_due"}function wc(e,h,b,l=[],o=[],s="",r){let t=e.filter(d=>d.is_notice);if(t.length>0){let d=wc(e.filter(f=>!f.is_notice),h,b,l,o,s,r);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:t},...d]}let n=new Map,c=(d,f)=>{let u=n.get(d);u?u.push(f):n.set(d,[f])},i;if(h==="due"){let d=iy(b);for(let f of e)c(ay(f,b,d),f);i=sy}else if(h==="status"){for(let d of e)c(Ca(d.status).key,d);i=nn.map(d=>({key:d.key,label:d.name}))}else if(h==="tab"){for(let d of e)c(d.tab_key?.trim()||"__none__",d);i=[...l.filter(d=>!d.archived).map(d=>({key:d.key,label:d.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...l.filter(d=>d.archived).map(d=>({key:d.key,label:`${d.label} (\uBCF4\uAD00\uB428)`}))]}else if(r?.enabled){let d=Number(r.myAccountSeq??0),f=s.trim();for(let u of e){if(!(Number(u.manager_account_seq??0)>0||String(u.manager_name??"").trim()!=="")){c("__none__",u);continue}let m=d>0&&Number(u.manager_account_seq??0)===d||!!f&&String(u.manager_name??"").trim()===f;c(m?"__manager__":"__reference__",u)}i=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let m of e)c(String(m.manager_name??"").trim()||"__none__",m);let d=s.trim(),f=[...n.keys()].filter(m=>m!=="__none__").sort((m,x)=>{if(d){if(m===d)return-1;if(x===d)return 1}return m.localeCompare(x)}),u=!!d&&f.includes(d),g=f.filter(m=>m!==d);i=[...u?[{key:d,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...g.map(m=>({key:m,label:m}))]}let a=[];for(let d of i){let f=n.get(d.key);!f||f.length===0||a.push({key:d.key,label:d.label,tasks:f})}return a}import ly from"@mui/icons-material/NotesOutlined";import cy from"@mui/icons-material/AutorenewOutlined";import uy from"@mui/icons-material/CalendarTodayOutlined";import dy from"@mui/icons-material/EventOutlined";import fy from"@mui/icons-material/PersonOutlineOutlined";import Qd from"@mui/icons-material/PeopleAltOutlined";import Sc from"@mui/icons-material/CheckCircleOutlineOutlined";import hy from"@mui/icons-material/FlagOutlined";import ef from"@mui/icons-material/AccessTimeOutlined";import py from"@mui/icons-material/StickyNote2Outlined";import my from"@mui/icons-material/ViewKanbanOutlined";import gy from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as Br}from"react/jsx-runtime";var by={completed:"50px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"132px",manager_name:"110px",receiver_names:"170px",targets:"170px",priority:"84px",ack:"104px",confirm:"100px",project:"150px",request:"100px",deleted_time:"150px",completed_time:"150px",note:"minmax(140px, 0.7fr)"};function tf(e){return Tc(e).map(h=>by[h.id]).join(" ")}var yy={id:"deleted_time",label:"\uC0AD\uC81C\uC77C\uC2DC",icon:Br(ef,{sx:{fontSize:15}}),align:"center",sortable:!0},xy={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:Br(ef,{sx:{fontSize:15}}),align:"center",sortable:!0},vy={id:"ticket_no",label:"\uD2F0\uCF13",icon:Br(gy,{sx:{fontSize:15}}),align:"center"},wy={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:Br(my,{sx:{fontSize:15}}),projectFilter:!0},_y={id:"targets",label:"\uB300\uC0C1\uC790",icon:Br(Qd,{sx:{fontSize:15}})},Jd={id:"priority",label:"\uC911\uC694\uB3C4",icon:Br(hy,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},ky={id:"ack",label:"\uD655\uC778",icon:Br(Sc,{sx:{fontSize:15}}),align:"center",ackFilter:!0},Sy={id:"confirm",label:"\uD655\uC778",icon:Br(Sc,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function _c(e){let h=e.findIndex(l=>l.id==="receiver_names"||l.id==="targets"),b=h>=0?h+1:e.findIndex(l=>l.id==="note");return b<0?[...e,Jd]:[...e.slice(0,b),Jd,...e.slice(b)]}function Tc(e){let{showProject:h=!1,showManager:b=!0,showActions:l=!0,showRequest:o=!0,notice:s=!1,bug:r=!1,trash:t=!1,confirmMode:n="none"}=e??{},c=d=>{if(!r)return d;let f=d.filter(m=>m.id!=="note"),u=f.findIndex(m=>m.id==="completed"),g=u>=0?u+1:0;return[...f.slice(0,g),vy,...f.slice(g)]};if(s)return c(_c(kc.filter(d=>!["manager_name","receiver_names","request"].includes(d.id)).flatMap(d=>d.id==="due_date"?[d,_y]:d.id==="note"?[ky,d]:[d])));let i=b?kc:kc.filter(d=>d.id!=="manager_name");if(l)o||(i=i.filter(d=>d.id!=="request"));else{i=i.filter(f=>f.id!=="request");let d=i.findIndex(f=>f.id==="note");i=[...i.slice(0,d),t?yy:xy,...i.slice(d)]}if(n==="action"){let d=i.findIndex(f=>f.id==="note");i=[...i.slice(0,d),Sy,...i.slice(d)]}if(!h)return c(_c(i));let a=i.findIndex(d=>d.id==="receiver_names");return c(_c([...i.slice(0,a+1),wy,...i.slice(a+1)]))}var kc=[{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:Br(ly,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:Br(cy,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC",icon:Br(uy,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC",icon:Br(dy,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:Br(fy,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:Br(Qd,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:Br(Sc,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:Br(py,{sx:{fontSize:15}})}];import{Button as rf,ClickAwayListener as By,Dialog as Iy,Paper as Ey,Popper as My,Typography as Ry,Box as Oy}from"@mui/material";import{useMediaQuery as Ty,useTheme as Cy}from"@mui/material";function Lt(){let{isMobile:e}=Sr(),h=Cy(),b=Ty(h.breakpoints.up("lg"));return e!==void 0?e:!b}import{Fragment as Dy,jsx as Lo,jsxs as of}from"react/jsx-runtime";function nf(){if(typeof document>"u")return;let e=0,h=l=>{l.stopPropagation(),l.preventDefault(),b()},b=()=>{window.clearTimeout(e),document.removeEventListener("click",h,!0)};document.addEventListener("click",h,!0),e=window.setTimeout(b,350)}function Ay({title:e,content:h,confirmText:b,cancelText:l,titleFontSize:o,actionFontSize:s,actionMinHeight:r,onCancel:t,onConfirm:n}){return of(Dy,{children:[Lo(Ry,{component:"div",sx:{fontSize:o,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),h,of(Oy,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[Lo(rf,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{nf(),t()},fullWidth:!0,sx:{fontSize:s,minHeight:r,fontWeight:700},children:l}),Lo(rf,{size:"medium",variant:"contained",color:"primary",onClick:()=>{nf(),n()},fullWidth:!0,sx:{fontSize:s,minHeight:r,fontWeight:700},children:b})]})]})}function Dt({open:e,anchorEl:h,title:b="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:l,confirmText:o="\uD655\uC778",cancelText:s="\uCDE8\uC18C",placement:r="top",minWidth:t=160,minHeight:n,titleFontSize:c=17,actionFontSize:i=16,actionMinHeight:a=44,zIndex:d=1300,onCancel:f,onConfirm:u}){let g=Lt(),m=Lo(Ay,{title:b,content:l,confirmText:o,cancelText:s,titleFontSize:c,actionFontSize:i,actionMinHeight:a,onCancel:f,onConfirm:u});return g?Lo(Iy,{open:e,onClose:f,sx:{zIndex:d},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:m}):Lo(My,{open:e,anchorEl:h,placement:r,sx:{zIndex:d},children:Lo(By,{onClickAway:f,children:Lo(Ey,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:t,minHeight:n,justifyContent:n?"space-between":"flex-start"},onClick:x=>x.stopPropagation(),onMouseDown:x=>x.stopPropagation(),children:m})})})}import{memo as ix}from"react";function kn(e){let h=e.visibility;return h==="involved"||h==="group"||h==="all"?h:e.is_open?"all":"involved"}function Ma(e,h,b=0){if(h<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===h)return!0;let s=(e.target_account_seqs??[]).filter(r=>r>0);return s.length===0||s.includes(h)}if((e.author_account_seq??0)===h||(e.manager_account_seq??0)===h||(e.receiver_account_seqs??[]).includes(h))return!0;let o=kn(e);if(o==="all")return!0;if(o==="group"){let s=e.visibility_group_seq??0;return s>0&&b===s}return!1}function sf(e){return e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)!==0?!1:kn(e)!=="involved"}function Ra(e,h){return h<=0||(e.author_account_seq??0)===h?!1:sf(e)}function Oa(e,h){return h<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||(e.author_account_seq??0)===h||sf(e)?!1:(e.receiver_account_seqs??[]).includes(h)}function af(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function lf(e,h){if(h<=0)return!1;let b=(e.author_account_seq??0)===h;return e.is_notice?b:b||(e.manager_account_seq??0)===h}function lo(e,h){return h<=0?!1:e.is_notice?(e.author_account_seq??0)===h:(e.author_account_seq??0)===h||(e.manager_account_seq??0)===h||(e.receiver_account_seqs??[]).includes(h)}var OB=[119,121,141,143];import{memo as Gy,useEffect as Yy,useRef as Xy,useState as gf}from"react";import{Box as Et,Button as Zy,ButtonBase as Jy,Checkbox as Qy,Tooltip as ks}from"@mui/material";import ex from"@mui/icons-material/PublicOutlined";import tx from"@mui/icons-material/Group";import rx from"@mui/icons-material/CheckCircle";import nx from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as Py,useState as cf}from"react";import{Avatar as uf,Box as Ny}from"@mui/material";import Ly from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Aa}from"react/jsx-runtime";var Cc=new Set,df=e=>e.startsWith("data:")||e.startsWith("blob:");function jy(e){let h=e.trim();return h?([...h][0]??"").toUpperCase():""}function fn({src:e,name:h="",avatarSx:b,iconFontSize:l=40}){let[o,s]=cf(()=>e?df(e)||Cc.has(e):!1),[r,t]=cf(!1),n={position:"relative",overflow:"hidden",borderRadius:"15px"},c=b?[n,...Array.isArray(b)?b:[b]]:n;if(Py(()=>{t(!1),s(e?df(e)||Cc.has(e):!1)},[e]),!e||r){let i=jy(h);return Aa(uf,{sx:c,children:i?Aa(Ny,{component:"span",sx:{fontSize:"inherit",fontWeight:600,lineHeight:1,userSelect:"none"},children:i}):Aa(Ly,{sx:{fontSize:l}})})}return Aa(uf,{src:e,imgProps:{onLoad:()=>{Cc.add(e),s(!0)},onError:()=>t(!0),style:o?void 0:{opacity:0}},sx:c})}var zy=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Da=(e,h)=>{if(!h||!h.trim())return[{text:e,highlight:!1}];try{let b=zy(h.trim()),l=new RegExp(`(${b})`,"gi");return e.split(l).map(s=>s.toLowerCase()===h.trim().toLowerCase()?{text:s,highlight:!0}:{text:s,highlight:!1}).filter(s=>s.text)}catch{return[{text:e,highlight:!1}]}};var Fy=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function hn(e){let h=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(h))return"";let b=new Date(`${h}T00:00:00`);return Number.isNaN(b.getTime())?"":`${h.slice(2).replaceAll("-",".")} (${Fy[b.getDay()]})`}function Bc(e){let h=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(h))return"";let b=Number(h.slice(5,7)),l=Number(h.slice(8,10));return!b||!l?"":`${b}\uC6D4 ${l}\uC77C`}function on(e){let h=String(e??"").trim(),[b,l=""]=h.split(" "),o=hn(b);return o?l?`${o} ${l.slice(0,5)}`:o:""}function Mi(e){let h=e.checklist??[];return h.length===0?"":`${h.filter(l=>l.checked).length}/${h.length}`}import{Box as ff,Tooltip as qy}from"@mui/material";import{jsx as Pa}from"react/jsx-runtime";var Ri=[{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 jr({names:e,size:h=22,ringFirst:b=!1,avatarSrcByName:l}){let o=ct();return Pa(ff,{sx:{display:"flex",alignItems:"center"},children:e.map((s,r)=>{let t=b&&r===0;return Pa(qy,{title:t?`\uCC45\uC784\uC790 \xB7 ${s}`:s,arrow:!0,children:Pa(ff,{sx:{ml:r===0?0:"-7px",zIndex:r,borderRadius:"50%",border:`2px solid ${t?o.avatar.ringColor:o.avatar.separatorColor}`,display:"inline-flex",...o.avatar.sx},children:Pa(fn,{src:l?.get(s)??"",name:s,avatarSx:{width:h,height:h,fontSize:Math.round(h/2),borderRadius:"50%",...Ri[r%Ri.length]},iconFontSize:Math.round(h*.6)})})},`${s}-${r}`)})})}import{Box as hf,Button as mf}from"@mui/material";import $y from"@mui/icons-material/CheckCircle";import{Fragment as Uy,jsx as _s,jsxs as pf}from"react/jsx-runtime";function Hy(e){let h=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,gap:.5,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:h?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:h?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function Wy(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 Ln({onClick:e,children:h,fullWidth:b=!1,sx:l}){let o=ct();return _s(mf,{size:"small",variant:"contained",color:"inherit",fullWidth:b,sx:[Wy(o),...Array.isArray(l)?l:l?[l]:[]],onClick:s=>{s.stopPropagation(),e(s)},children:h})}function Oi({canConfirm:e,count:h,total:b,myConfirmed:l=!1,onConfirm:o,onShowList:s}){let r=ct(),t=Hy(r);return e?_s(Ln,{onClick:()=>o(),children:"\uD655\uC778"}):pf(mf,{size:"small",variant:"outlined",color:"inherit",sx:t,onClick:n=>{n.stopPropagation(),s(n.currentTarget)},children:[l?_s($y,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,_s(hf,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:b>0&&h>=b?"\uD655\uC778\uC644\uB8CC":pf(Uy,{children:[h,_s(hf,{component:"span",sx:{mx:.15},children:"/"}),b]})})]})}import{SvgIcon as Vy}from"@mui/material";import{jsx as Na,jsxs as Ky}from"react/jsx-runtime";function jo({sx:e,...h}){return Ky(Vy,{viewBox:"0 0 48 48",...h,sx:{fill:"none",...e},children:[Na("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"}),Na("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Na("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Na("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as xf,jsx as Ge,jsxs as Ss}from"react/jsx-runtime";function La(e){let h=String(e??"").trim();if(!h)return"-";let b=h.slice(2,10).replaceAll("-","."),l=h.slice(11,16);return/^\d{2}:\d{2}$/.test(l)?`${b} ${l}`:b}function ox(e){let h=String(e.event_time??"").trim();return e.is_event&&/^\d{2}:\d{2}$/.test(h)?La(`${String(e.due_date??"").slice(0,10)} ${h}`):La(e.due_date)}function Ic(e,h){let b=String(e??"").trim()||"-";return Da(b,h).map((l,o)=>Ge("span",{className:l.highlight?"font-semibold text-blue-600":void 0,children:l.text},`${l.text}-${o}`))}function ja({names:e,searchText:h,avatarSrcByName:b,emphasize:l=!1}){let o=e.filter(s=>s.trim());if(o.length===0)return null;if(o.length===1){let s=o[0]??"";return Ss(xf,{children:[Ge(fn,{src:b?.get(s)??"",name:s,avatarSx:{width:24,height:24,fontSize:12,borderRadius:"50%",...Ri[0]},iconFontSize:15}),Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...l?{fontWeight:500,color:"#2f80ed"}:{}},children:Ic(s,h)})]})}return Ge(jr,{names:o,size:22,avatarSrcByName:b})}function bf({display:e,summary:h,searchText:b,avatarSrcByName:l}){if(!e||e.kind==="everyone")return Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:o,individualNames:s}=e;if(o.length===0)return Ge(ja,{names:s,searchText:b,avatarSrcByName:l});let r=[...o,...s],t=r.join(", ");return r.length>2?Ge(ks,{title:t,arrow:!0,children:Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${r[0]}, ${r[1]} \uC678 ${r.length-2}\uBA85`})}):Ge(ks,{title:t,arrow:!0,children:Ss(Et,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[Ge(Et,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.join(", ")+(s.length>0?",":"")}),s.length>0?Ge(ja,{names:s,searchText:b,avatarSrcByName:l}):null]})})}var yf=Gy(function({task:h,gridTemplate:b,statusOptions:l,avatarSrcByName:o,searchText:s,myAccountSeq:r=0,todayStr:t,showProject:n=!1,showManager:c=!0,showActions:i=!0,showRequest:a=!0,confirmMode:d="none",bugMode:f=!1,trashMode:u=!1,dimCompleted:g=!0,confirmInfo:m,onConfirmTask:x,projectLabel:_="",projectIcon:B="",onProjectClick:A,onRequestToggleCompleted:j,onDateClick:D,onChangeNote:P,onMemberClick:N,onClaimClick:q,onVolunteerClick:z,onStatusClick:T,onOpenDetail:C,onTaskContextMenu:R,hideBottomBorder:p=!1,completeLocked:y=!1,unread:v=!1,notice:w=!1,noticeReadOnly:k=!1,readOnly:S=!1,onIconClick:E,lastColumnCentered:L=!1,noteLocked:$=!1,targetSummary:U="",targetDisplay:O,onArchiveTask:W,ackInfo:M,onAckConfirm:I,onAckListClick:F,onPriorityClick:V}){let[Y,K]=gf(!1),[H,Z]=gf(""),J=Xy(null);Yy(()=>{if(!Y)return;let de=Ve=>{let Pe=J.current;Pe&&(Ve.target instanceof Node&&Pe.contains(Ve.target)||Pe.blur())};return document.addEventListener("mousedown",de,!0),document.addEventListener("touchstart",de,!0),()=>{document.removeEventListener("mousedown",de,!0),document.removeEventListener("touchstart",de,!0)}},[Y]);let G=[h.manager_account_seq??0,...h.receiver_account_seqs??[]].some(de=>de>0&&de!==(h.author_account_seq??0)),X=k||S,ee=r>0&&!h.is_notice&&!h.is_event&&(h.manager_account_seq??0)===r,ne=X||!!h.is_notice,re=ct(),oe=!!q&&Ra(h,r),se=!!z&&Oa(h,r),ge=ne&&!af(h),ve=h.is_notice?Ge(Oi,{canConfirm:!!M?.canAck,count:M?.count??0,total:M?.total??0,myConfirmed:!!M?.acked,onConfirm:()=>I?.(h),onShowList:de=>F?.(h,de)}):null,_e=!h.is_notice&&!h.completed&&!!h.due_date&&h.due_date.slice(0,10)<=t,De=Mi(h),pe=h.completed?re.colors.textPrimary:_e?"#e5484d":"#2f80ed";return Ss(Et,{onContextMenu:de=>R(h,de),sx:{display:"grid",gridTemplateColumns:b,minHeight:48,position:"relative",fontSize:15,bgcolor:re.table.rowBg,color:re.table.rowColor,borderBottom:p?"none":`1px solid ${re.table.rowBorderColor}`,"&:hover":{bgcolor:re.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${re.table.rowBorderColor}`},"& > .cell:first-of-type":{px:1.5},"& > .cell:last-of-type":{borderRight:"none",pr:2,...L?{pl:2}:{}}},children:[Ge(Et,{className:"cell",sx:{justifyContent:"center"},children:h.is_event?(()=>{let de=wt(h.icon||ar);if(!de)return null;let Ve=Ge(de,{sx:{fontSize:19,color:h.icon_color||"#1e3a8a"}});return X||!E?Ve:Ge(ks,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Ge(Jy,{onClick:Pe=>{Pe.stopPropagation(),E(h,Pe.currentTarget)},sx:{p:.25,borderRadius:1,"&:hover":{bgcolor:re.table.cellHoverBg}},children:Ve})})})():!k&&!y&&!u?Ge(ks,{title:h.completed&&h.completed_by?`${h.completed_by} \xB7 ${on(h.completed_time)} \uC644\uB8CC`:h.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Ge(Qy,{checked:h.completed,inputProps:{"aria-label":h.completed?`${h.title} \uC644\uB8CC \uD574\uC81C`:`${h.title} \uC644\uB8CC \uCC98\uB9AC`},icon:Ge(nx,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:Ge(rx,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:de=>de.stopPropagation(),onChange:(de,Ve)=>j({anchorEl:de.currentTarget,task:h,nextCompleted:Ve}),sx:{p:.5}})}):null}),f?Ge(Et,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:h.ticket_no||"-"}):null,Ss(Et,{className:"cell",onClick:()=>C(h),sx:{gap:1,pl:2,cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}},children:[(()=>{if(!h.is_notice)return null;let de=wt(h.icon||or);return de?Ge(de,{sx:{fontSize:18,flexShrink:0,color:h.icon_color||"#e5484d"}}):null})(),(()=>{if(h.is_notice)return null;let de=kn(h);return de==="involved"?null:Ge(ks,{title:de==="all"?"\uC804\uCCB4\uACF5\uAC1C \u2014 \uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4":"\uBD80\uC11C\uACF5\uAC1C \u2014 \uC9C0\uC815\uD55C \uBD80\uC11C\uC758 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",arrow:!0,disableInteractive:!0,children:de==="all"?Ge(ex,{sx:{fontSize:15,flexShrink:0,color:"#2f80ed"}}):Ge(tx,{sx:{fontSize:15,flexShrink:0,color:"#d9730d"}})})})(),Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:h.completed&&g?400:re.table.rowTitleFontWeight,color:h.completed&&g?re.colors.textMuted:re.table.rowTitleColor,textDecoration:h.completed&&g?"line-through":"none"},children:Ic(h.title,s)}),De?Ge(Et,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:re.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:De}):null,(h.comment_count??h.comments?.length??0)>0?Ge(jo,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,Ge(Et,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:Ge(No,{labelKeys:h.label_keys??[],labelOptions:l})}),v&&!h.completed?Ge(Et,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,Ta(h)&&!h.archived&&!X&&W?Ge(Zy,{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:de=>{de.stopPropagation(),W(h)},children:"\uBCF4\uAD00"}):null]}),(()=>{let de=X||!!h.is_event||!!h.completed;return Ge(Et,{className:"cell",onClick:de?void 0:Ve=>T(h,Ve.currentTarget),sx:{py:.5,justifyContent:"center",...de?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:h.is_event?(()=>{let Ve=vs(h);return Ve?Ge(At,{option:Ve}):null})():Ge(At,{option:lr(h)})})})(),Ge(Et,{className:"cell",onClick:X?void 0:de=>D(h,"start_date",de.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:La(h.start_date)}),Ge(Et,{className:"cell",onClick:X?void 0:de=>D(h,"due_date",de.currentTarget),sx:{justifyContent:"center",color:pe,fontWeight:500,whiteSpace:"nowrap",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:h.due_date?ox(h):null}),w?Ge(Et,{className:"cell",onClick:X?void 0:()=>N(h,"targets"),sx:{gap:.75,...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(bf,{display:O,summary:U,searchText:s,avatarSrcByName:o})}):null,!w&&h.is_notice?Ge(Et,{className:"cell",onClick:X?void 0:()=>N(h,"targets"),sx:{gridColumn:c?"span 2":"auto",gap:.75,...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(bf,{display:O,summary:U,searchText:s,avatarSrcByName:o})}):null,!w&&!h.is_notice&&!h.is_event&&c?Ge(Et,{className:"cell",onClick:ge?void 0:()=>N(h,"manager"),sx:{gap:.75,...oe||se?{justifyContent:"center"}:{},...ge?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:oe?Ge(Ln,{onClick:de=>q?.(h,de.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):se?Ge(Ln,{onClick:de=>z?.(h,de.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):Ge(ja,{names:h.manager_name?[h.manager_name]:[],searchText:s,avatarSrcByName:o,emphasize:ee})}):null,!w&&!h.is_notice?Ge(Et,{className:"cell",onClick:ne?void 0:()=>N(h,"receivers"),sx:{gridColumn:h.is_event&&c?"span 2":"auto",gap:.75,...ne?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(ja,{names:h.receiver_names,searchText:s,avatarSrcByName:o})}):null,Ge(Et,{className:"cell",onClick:X?void 0:de=>V?.(h,de.currentTarget),sx:{py:.5,justifyContent:"center",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(Lr,{priority:h.priority,plain:!0})}),n?Ge(Et,{className:"cell",onClick:X?void 0:de=>A?.(h,de.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:_?Ss(xf,{children:[(()=>{let de=wt(B);return de?Ge(de,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_})]}):null}):null,w?Ge(Et,{className:"cell",sx:{justifyContent:"center"},children:ve}):null,!w&&i&&a?Ge(Et,{className:"cell",sx:{justifyContent:"center"},children:h.is_notice?ve:G?Ge(Oi,{canConfirm:!!m?.canConfirm,count:m?.count??0,total:m?.total??0,myConfirmed:!!m?.myTime,onConfirm:()=>x?.(h),onShowList:de=>F?.(h,de)}):null}):null,!w&&d==="action"?Ge(Et,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:re.table.rowSubColor},children:h.is_notice?ve:m&&m.total>0?Ge(Oi,{canConfirm:!!m.canConfirm,count:m.count,total:m.total,myConfirmed:!!m.myTime,onConfirm:()=>x?.(h),onShowList:de=>F?.(h,de)}):"-"}):null,!w&&!i?Ge(Et,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:u?re.colors.danger:g?re.table.rowSubColor:re.table.rowTitleColor},children:u?La(h.deleted_time):h.completed_time||"-"}):null,f?null:Ge(Et,{className:"cell",onClick:()=>{!$&&!Y&&(Z(h.note),K(!0))},sx:{color:"#6f6f6c",cursor:$?"default":"text"},children:Y?Ge(Et,{component:"input",ref:J,autoFocus:!0,spellCheck:!1,value:H,onChange:de=>Z(de.target.value),onBlur:()=>{K(!1),H.trim()!==h.note&&P(h.seq,H)},onKeyDown:de=>{de.key==="Enter"&&de.target.blur(),de.key==="Escape"&&(Z(h.note),K(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:re.table.rowTitleColor,caretColor:re.table.rowTitleColor,p:0,m:0}}):Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.note?Ic(h.note,s):""})}),ee?Ge(Et,{component:"span",sx:{position:"absolute",left:3,top:6,bottom:6,width:3,bgcolor:"#2f80ed",borderRadius:1.5,pointerEvents:"none"}}):null]})});import{jsx as sx}from"react/jsx-runtime";var vf=ix(function(h){let l=(h.useTaskItem?h.useTaskItem(h.task.seq):void 0)??h.task,{myAccountSeq:o}=h,s=h.projectByKey.get(l.tab_key??"");return sx(yf,{hideBottomBorder:h.hideBottomBorder,gridTemplate:h.gridTemplate,task:l,statusOptions:h.statusOptions,avatarSrcByName:h.avatarSrcByName,searchText:h.searchText,myAccountSeq:o,todayStr:h.todayStr,showProject:h.showProject,showManager:h.showManager,showActions:h.showActions,showRequest:h.showRequest,confirmMode:h.confirmMode,confirmInfo:l.is_notice?void 0:h.getConfirmInfo?.(l),onConfirmTask:h.onConfirmTask,projectLabel:s?.label??"",projectIcon:s?.icon??"",onProjectClick:h.onProjectClick,onRequestReply:h.onRequestReply,onRequestToggleCompleted:h.onRequestToggleCompleted,onDateClick:h.onDateClick,onChangeNote:h.onChangeNote,onMemberClick:h.onMemberClick,onClaimClick:h.onClaimClick,onVolunteerClick:h.onVolunteerClick,onStatusClick:h.onStatusClick,onOpenDetail:h.onOpenDetail,onTaskContextMenu:h.onTaskContextMenu,notice:h.notice,bugMode:h.bugMode,trashMode:h.trashMode,dimCompleted:h.dimCompleted,noticeReadOnly:!lo(l,o),readOnly:h.readOnly,noteLocked:h.readOnly||(l.is_notice?!Ma(l,o):!lo(l,o)),completeLocked:l.is_event?!0:l.is_notice?(l.author_account_seq??0)!==o:(l.author_account_seq??0)!==o&&(l.manager_account_seq??0)!==o,targetSummary:l.is_notice?h.getTargetSummary?.(l):void 0,targetDisplay:l.is_notice?h.getTargetDisplay?.(l):void 0,onArchiveTask:h.onArchiveTask,unread:h.isTaskUnread?.(l)??!1,ackInfo:l.is_notice?h.getAckInfo?.(l):void 0,onAckConfirm:h.onAckConfirm,onAckListClick:h.onAckListClick,onPriorityClick:h.onPriorityClick,onIconClick:h.onIconClick,lastColumnCentered:h.lastColumnCentered})});import{useMemo as wf,useState as Mc}from"react";import{Box as oi,Button as _f,ButtonBase as kf,Dialog as cx,Divider as Rc,Menu as ux,MenuItem as dx,Popover as fx}from"@mui/material";import Sf from"@mui/icons-material/ChevronRight";import hx from"@mui/icons-material/Check";import px from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as mx,TimePicker as gx}from"@ehfuse/mui-datetime-picker";import bx from"@mui/icons-material/TimerOutlined";import{useEffect as ax,useState as lx}from"react";function jn(e){let{loadHolidays:h}=Sr(),[b,l]=lx(()=>new Map),o=e.join(",");return ax(()=>{if(!h||!o){l(new Map);return}let s=!1;return h(o.split(",").map(Number)).then(r=>{if(s)return;let t=new Map;for(let n of r)t.has(n.date)||t.set(n.date,n.name);l(t)}).catch(()=>{}),()=>{s=!0}},[h,o]),b}var Ec=["min30_before","hour1_before","hour2_before","same_day","day_before","two_days_before","three_days_before","week_before"];function zn(e){let h=Array.isArray(e?.reminders)?e?.reminders:[e?.reminder],b=new Set;for(let l of h){let o=String(l??"").trim();Ec.includes(o)&&b.add(o)}return Ec.filter(l=>b.has(l))}function za(e,h){if(h==="none")return[];let b=e.includes(h)?e.filter(l=>l!==h):[...e,h];return Ec.filter(l=>b.includes(l))}import{Fragment as Tf,jsx as Ir,jsxs as Sn}from"react/jsx-runtime";var yx=9,xx=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],Cf=[{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"}],Bf=[{value:"none",label:"\uC5C6\uC74C"},...xx,...Cf];function Oc(e){return e?Bf:[{value:"none",label:"\uC5C6\uC74C"},...Cf]}function vx(e){return e==="same_day"?"\uB2F9\uC77C":Bf.find(h=>h.value===e)?.label??"\uC5C6\uC74C"}function Ac(e){if(e.length===0)return"\uC5C6\uC74C";let h=e.map(b=>vx(b));return h.length<=3?h.join(", "):`${h.slice(0,3).join(", ")} \uC678 ${h.length-3}`}function wx(e){let h=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(h.getTime())?new Date:h}function pn({anchorEl:e,open:h,date:b,reminders:l,hideReminder:o=!1,showTime:s=!1,centered:r=!1,onClose:t,onDateChange:n,onReminderChange:c}){let[i,a]=Mc(null),[d,f]=Mc(null),u=Nn(),g=String(b??"").trim().slice(0,10),m=String(b??"").trim().slice(11,16),x=/^\d{2}:\d{2}$/.test(m)?m:"",_=(T,C)=>n(C?`${T} ${C}`:T),{defaultDueHour:B}=Sr(),A=`${String(Number.isInteger(B)&&B>=0&&B<=23?B:yx).padStart(2,"0")}:00`,[j,D]=Mc(()=>{let T=Number(g.slice(0,4));return Number.isFinite(T)&&T>1900?T:new Date().getFullYear()}),P=wf(()=>[j-1,j,j+1],[j]),N=jn(P),q=wf(()=>{let T=[];for(let C of N.keys()){let R=new Date(`${C}T00:00:00`);Number.isNaN(R.getTime())||T.push(R)}return T},[N]),z=Sn(oi,{sx:{width:300,maxWidth:"100%"},children:[Ir(oi,{sx:{height:320},children:Ir(mx,{selectedDate:wx(g),onSelect:T=>{_(gr(T),s?x||A:x),s||t()},onClose:t,showFooter:!1,autoApply:!0,holidays:q,onYearChange:T=>D(T),onMonthChange:(T,C)=>{typeof C=="number"&&D(C)}})}),s?Sn(Tf,{children:[Ir(Rc,{sx:{borderColor:"#e6e6e3"}}),Sn(kf,{onClick:T=>f(T.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Ir(bx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC2DC\uAC01"]}),Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[x||"\uC5C6\uC74C",Ir(Sf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Ir(gx,{anchorEl:d,open:!!d,onClose:()=>f(null),centered:r,value:{hour:x.slice(0,2)||A.slice(0,2),minute:x.slice(3,5)||"00"},format:"HH:mm",minuteStep:5,autoApply:!0,locale:"ko",onChange:(T,C)=>{_(g||gr(new Date),`${T}:${C}`),f(null)}})]}):null,o?null:Sn(Tf,{children:[Ir(Rc,{sx:{borderColor:"#e6e6e3"}}),Sn(kf,{onClick:T=>a(T.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Ir(px,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC0AC\uC804\uC54C\uB9BC"]}),Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[Ac(l),Ir(Sf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Ir(ux,{transitionDuration:0,anchorEl:i,open:!!i,onClose:()=>a(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...u,children:Oc(!!x).map(T=>{let C=T.value==="none"?l.length===0:l.includes(T.value);return Sn(dx,{selected:C,onClick:()=>{c(za(l,T.value)),T.value==="none"&&a(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[T.label,C?Ir(hx,{sx:{fontSize:16,color:"#2f80ed"}}):null]},T.value)})})]}),Ir(Rc,{sx:{borderColor:"#e6e6e3"}}),Sn(oi,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[Ir(_f,{size:"small",onClick:()=>{_(gr(new Date),x),t()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),Ir(_f,{size:"small",onClick:t,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return r?Ir(cx,{open:h,onClose:t,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:z}):Ir(fx,{transitionDuration:0,open:h,anchorEl:e,onClose:t,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:z})}import{useEffect as Sx,useState as Pc}from"react";import{Box as ii,Button as Tx,Switch as Cx}from"@mui/material";import{FormDialog as Bx}from"@ehfuse/mui-form-dialog";import{ClearTextField as Ix}from"@ehfuse/mui-form-controls";import{ErrorAlert as Ex}from"@ehfuse/alerts";import{Box as _x,ButtonBase as kx}from"@mui/material";import{jsx as Dc}from"react/jsx-runtime";function Fa({value:e,onChange:h}){return Dc(_x,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:ac.map(({key:b,Icon:l})=>{let o=b===e;return Dc(kx,{onClick:()=>h(b),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:o?"2px solid #2563eb":"1px solid #dedddb",bgcolor:o?"#eef4ff":"#fff",color:o?"#1e3a8a":"#787774","&:hover":{bgcolor:o?"#eef4ff":"#f4f4f2"}},children:Dc(l,{sx:{fontSize:20}})},b)})})}import{jsx as co,jsxs as Nc}from"react/jsx-runtime";function qa({open:e,title:h="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:b="",initialIcon:l=sc,confirmText:o="\uCD94\uAC00",initialUseSprints:s=!1,onClose:r,onSubmit:t}){let[n,c]=Pc(""),[i,a]=Pc(sc),[d,f]=Pc(!1);Sx(()=>{e&&(c(b),a(l),f(s))},[e]);let u=()=>{let m=n.trim();if(!m){Ex("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(m,i,d),r()};return co(Bx,{open:e,onClose:r,maxWidth:"xs",title:h,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:Nc(ii,{children:[co(Ix,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:n,onChange:m=>c(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),u())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),co(ii,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),co(ii,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:co(Fa,{value:i,onChange:a})}),Nc(ii,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[Nc(ii,{children:[co(ii,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),co(ii,{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)"})]}),co(Cx,{checked:d,onChange:(m,x)=>f(x)})]})]})}],actions:{showCancelButton:!0,right:co(Tx,{variant:"contained",onClick:u,children:o})}})}import{Box as Mx}from"@mui/material";import{jsx as Rx}from"react/jsx-runtime";function $a({size:e=40}){return Rx(Mx,{sx:{boxSizing:"border-box",width:e,height:e,borderRadius:"50%",border:"4px solid rgba(28, 64, 125, 0.14)",borderTopColor:"#1c407d",animation:"taskbox-content-loading-spin 0.75s linear infinite","@keyframes taskbox-content-loading-spin":{to:{transform:"rotate(360deg)"}}}})}import{Box as Lc,ButtonBase as Ox,Divider as Ax,Popover as Dx}from"@mui/material";import Px from"@mui/icons-material/Check";import Nx from"@ehfuse/overlay-scrollbar";import{jsx as si,jsxs as If}from"react/jsx-runtime";var jc=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function zo({anchorEl:e,value:h,color:b="",onSelect:l,onSelectColor:o,onClose:s}){return si(Dx,{transitionDuration:0,open:!!e,anchorEl:e,onClose:s,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:If(Lc,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[si(Nx,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:si(Fa,{value:h||so,onChange:r=>{l(r),s()}})}),o?If(Lc,{sx:{px:1.25,pb:1.25},children:[si(Ax,{sx:{mb:1,borderColor:"#efefed"}}),si(Lc,{sx:{display:"grid",gridTemplateColumns:`repeat(${jc.length}, 1fr)`,justifyItems:"center"},children:jc.map(r=>{let t=(b||jc[0])===r;return si(Ox,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${r}`,onClick:()=>o(r),sx:{width:"100%",maxWidth:26,aspectRatio:"1 / 1",borderRadius:"50%",bgcolor:r,display:"flex",alignItems:"center",justifyContent:"center"},children:t?si(Px,{sx:{fontSize:15,color:"#ffffff"}}):null},r)})})]}):null]})})}import{jsx as gt,jsxs as Tn}from"react/jsx-runtime";var Rf=48,Yx=5;function Of({tasks:e,statusOptions:h,avatarSrcByName:b,searchText:l,todayStr:o,sortBy:s,sortDirection:r,onSort:t,onRequestReply:n,onToggleCompleted:c,onChangeTaskDate:i,onChangeTaskReminder:a,groupBy:d,collapsedGroupKeys:f,customTabs:u,onToggleGroup:g,hideCompleted:m=!1,loading:x=!1,dimCompleted:_=!0,readOnly:B=!1,onChangeTaskIcon:A,onChangeTaskIconColor:j,onAddInGroup:D,canAddInGroup:P,renderGroupSummary:N,renderGroupTitleSummary:q,onChangeTaskProject:z,onAddProject:T,onChangeNote:C,onMemberClick:R,onClaimTask:p,onChangeTaskStatus:y,onOpenDetail:v,onTaskContextMenu:w,onMemberFilterClick:k,activeMemberFilters:S=[],onStatusFilterClick:E,statusFilterActive:L=!1,onAckFilterClick:$,ackFilterActive:U=!1,onProjectFilterClick:O,projectFilterActive:W=!1,onPriorityFilterClick:M,priorityFilterActive:I=!1,columns:F,getConfirmInfo:V,onConfirmTask:Y,myAccountSeq:K=0,currentUserName:H="",groupManagerByMyRole:Z=!1,allowManagerVolunteer:J=!0,noticeAdmin:G=!1,getTargetSummary:X,getTargetDisplay:ee,onArchiveTask:ne,isTaskUnread:re,getAckInfo:oe,onAckConfirm:se,onAckListClick:ge,onChangeTaskPriority:ve,onEndReached:_e,useTaskItem:De}){let pe=ct(),de=qn(()=>({showManager:!0,showActions:!0,showRequest:!0,...F}),[F]),Ve=de.showManager??!0,Pe=de.showActions??!0,ie=de.showRequest??!0,Be=de.confirmMode??"none",ye=de.notice??!1,xe=de.bug??!1,Ze=de.trash??!1,Te=d!=="none",ce=qn(()=>Te?wc(e,d,o,u,h,H,{enabled:Z,myAccountSeq:K}):[],[Te,e,d,o,u,h,H,Z,K]),Re=qn(()=>m?e.filter(he=>!he.completed):e,[e,m]),Se=qn(()=>Re.filter(he=>he.completed||he.archived?!1:he.is_notice?!!oe?.(he).canAck:!!V?.(he).canConfirm),[Re,oe,V]),Ce=qn(()=>new Set(Se.map(he=>he.seq)),[Se]),lt=qn(()=>ce.map(he=>({section:he,visibleTasks:he.tasks.filter(Oe=>!Ce.has(Oe.seq)&&(!m||!Oe.completed))})).filter(he=>he.visibleTasks.length>0),[ce,m,Ce]),Le=qn(()=>new Set(f),[f]),qe=qn(()=>{let he=[];if(Te)for(let{section:Oe,visibleTasks:at}of lt){let sr=Le.has(Oe.key);if(he.push({kind:"header",section:Oe,visibleTasks:at,collapsed:sr}),!sr)for(let Xr of at)he.push({kind:"task",task:Xr,last:!1})}else for(let Oe of Re)Ce.has(Oe.seq)||he.push({kind:"task",task:Oe,last:!1});for(let Oe=he.length-1;Oe>=0;Oe-=1){let at=he[Oe];if(at.kind==="task"){at.last=!0;break}}return he},[Te,lt,Re,Le,Ce]),kt=de.showProject??(!ye&&d!=="tab"),$e=qn(()=>Tc({...de,showProject:kt}),[de,kt]),Ne=tf({...de,showProject:kt}),vt=$e[$e.length-1]?.align==="center",et=qn(()=>{let he=new Map;for(let Oe of u)he.set(Oe.key,{label:Oe.archived?`${Oe.label} (\uBCF4\uAD00\uB428)`:Oe.label,icon:Oe.icon});return he},[u]),Ke=Lx(null),[bt,tt]=$n(null),te=Re.length>0;Ha(()=>{if(!te){tt(null);return}let he=window.requestAnimationFrame(()=>{tt(Ke.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(he)},[te]);let ue=`${d}|${s}|${r}|${l}|${m?1:0}`;Ha(()=>{bt&&(bt.scrollTop=0)},[ue,bt]);let[me,ke]=$n(!1);Ha(()=>{if(!bt)return;let he=()=>ke(bt.scrollHeight-bt.clientHeight>4),Oe=window.requestAnimationFrame(he),at=new ResizeObserver(he);return at.observe(bt),bt.firstElementChild&&at.observe(bt.firstElementChild),()=>{window.cancelAnimationFrame(Oe),at.disconnect()}},[bt,qe.length,f.length]),Ha(()=>{if(!bt)return;let he=bt.clientHeight,Oe=new ResizeObserver(()=>{let at=bt.clientHeight;at!==he&&(he=at,bt.dispatchEvent(new Event("scroll")))});return Oe.observe(bt),()=>Oe.disconnect()},[bt]);let[Je,Me]=$n(null),[Ae,yt]=$n(null),[We,Ie]=$n(null),[Ue,rt]=$n(null),[dt,St]=$n(!1),[Rt,xt]=$n(null),Qt=Rt?e.find(he=>he.seq===Rt.taskSeq)??null:null,[Nt,Vt]=$n(null),Q=Nt?e.find(he=>he.seq===Nt.taskSeq)??null:null,[le,be]=$n(null),fe=le?e.find(he=>he.seq===le.taskSeq)??null:null,Ee=Fn((he,Oe)=>{be({anchorEl:Oe,taskSeq:he.seq})},[]),je=Fn((he,Oe)=>{Vt({anchorEl:Oe,taskSeq:he.seq})},[]),ze=Fn((he,Oe)=>{xt({anchorEl:Oe,taskSeq:he.seq})},[]),ae=Fn((he,Oe)=>{if(!Oe)return;t(he,s===he&&r==="asc"?"desc":"asc")},[t,s,r]),Fe=Fn((he,Oe,at)=>{Me({anchorEl:at,taskSeq:he.seq,field:Oe,date:he[Oe],isEvent:!!he.is_event,reminders:zn(he),completed:he.completed})},[]),Ye=Fn((he,Oe)=>{rt({anchorEl:Oe,task:he})},[]),Qe=Fn(he=>{Je&&(i(Je.taskSeq,Je.field,he),Me(Oe=>Oe&&{...Oe,date:he}))},[Je,i]),qt=Fn(he=>{Je&&(a(Je.taskSeq,he),Me(Oe=>Oe&&{...Oe,reminders:he}))},[Je,a]),Kt=Fn((he,Oe)=>{Ie({anchorEl:Oe,taskSeq:he.seq,title:he.title,kind:"claim"})},[]),Tt=Fn((he,Oe)=>{Ie({anchorEl:Oe,taskSeq:he.seq,title:he.title,kind:"volunteer"})},[]),It=(he,Oe)=>gt(vf,{task:he,hideBottomBorder:Oe,gridTemplate:Ne,useTaskItem:De,statusOptions:h,avatarSrcByName:b,searchText:l,myAccountSeq:K,todayStr:o,showProject:kt,showManager:Ve,showActions:Pe,showRequest:ie,confirmMode:Be,notice:ye,bugMode:xe,trashMode:Ze,dimCompleted:_,readOnly:B,projectByKey:et,getConfirmInfo:V,onConfirmTask:Y,onProjectClick:Ye,onRequestReply:n,onRequestToggleCompleted:yt,onDateClick:Fe,onChangeNote:C,onMemberClick:R,onClaimClick:p?Kt:void 0,onVolunteerClick:J?Tt:void 0,onStatusClick:ze,onOpenDetail:v,onTaskContextMenu:w,onPriorityClick:je,onIconClick:A?Ee:void 0,lastColumnCentered:vt,getTargetSummary:X,getTargetDisplay:ee,getAckInfo:oe,isTaskUnread:re,onArchiveTask:ne,onAckConfirm:se,onAckListClick:ge},he.seq);return Tn(Er,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${pe.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:pe.table.bg,color:pe.table.rowColor,...pe.table.sx},children:[gt(Er,{sx:{display:"grid",gridTemplateColumns:Ne,borderBottom:`1px solid ${pe.table.borderColor}`,flexShrink:0,bgcolor:pe.table.headerBg,"& > *":{borderRight:`1px solid ${pe.table.rowBorderColor}`},"& > *:first-of-type":{px:1.5},"& > *:last-child":{borderRight:"none",pr:2,...vt?{pl:2}:{}},...pe.table.headerSx},children:$e.map(he=>{let Oe=s===he.id,at=!!he.memberFilter,sr=at&&S.includes(he.memberFilter),Xr=at||!!he.statusFilter||!!he.ackFilter||!!he.projectFilter||!!he.priorityFilter,no=sr||!!he.statusFilter&&L||!!he.ackFilter&&U||!!he.projectFilter&&W||!!he.priorityFilter&&I;return Tn(Er,{onClick:dn=>{he.memberFilter?k(he.memberFilter,dn.currentTarget):he.statusFilter?E(dn.currentTarget):he.ackFilter?$?.(dn.currentTarget):he.projectFilter?O?.(dn.currentTarget):he.priorityFilter?M?.(dn.currentTarget):ae(he.id,he.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:he.align==="center"?"center":"flex-start",gap:.5,px:1,...he.id==="title"?{pl:2}:{},py:1,minWidth:0,fontSize:pe.table.headerFontSize,color:he.sortable||Xr?pe.table.headerActiveColor:pe.table.headerColor,whiteSpace:"nowrap",cursor:he.sortable||Xr?"pointer":"default",userSelect:"none",...Oe?{color:pe.table.headerFilteredColor}:{},...no?{color:pe.table.headerFilteredColor,fontWeight:600}:{}},children:[he.icon,he.label,no?gt(Ux,{sx:{fontSize:14}}):null,Oe?r==="asc"?gt(qx,{sx:{fontSize:13}}):gt($x,{sx:{fontSize:13}}):null]},he.id)})}),Se.length>0?Tn(Er,{sx:{flexShrink:0,maxHeight:`${pe.table.groupHeader.minHeight+1+Rf*Yx}px`,overflowY:"auto",borderBottom:"1px solid #000"},children:[Tn(Er,{sx:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:pe.table.groupHeader.minHeight,bgcolor:"#fdf3f2",borderBottom:"1px solid #f2d7d4"},children:[gt(Er,{component:"span",sx:{fontSize:pe.table.groupHeader.labelFontSize,fontWeight:pe.table.groupHeader.labelFontWeight,color:pe.table.groupHeader.labelColor},children:"\uBBF8\uD655\uC778"}),gt(Er,{sx:{ml:"auto",display:"flex",alignItems:"center",pr:.5},children:gt(Er,{component:"span",sx:{flexShrink:0,width:pe.table.groupHeader.badge.width,py:pe.table.groupHeader.badge.paddingY,borderRadius:`${pe.table.groupHeader.badge.borderRadius}px`,bgcolor:"#e5484d",color:"#fff",fontSize:pe.table.groupHeader.badge.fontSize,fontWeight:pe.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:Se.length})})]}),Se.map((he,Oe)=>It(he,Oe===Se.length-1))]}):null,Re.length===0&&x?gt(Er,{role:"status","aria-live":"polite","aria-label":"\uC5C5\uBB34 \uBAA9\uB85D\uC744 \uBD88\uB7EC\uC624\uB294 \uC911\uC785\uB2C8\uB2E4.",sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",py:8},children:gt($a,{})}):Re.length===0?gt(Er,{role:"status","aria-live":"polite",sx:{py:8,textAlign:"center",color:pe.table.emptyColor,fontSize:14},children:e.length>0?`\uC644\uB8CC\uB41C \uC5C5\uBB34 ${e.length}\uAC74\uC774 "\uC644\uB8CC \uC228\uAE30\uAE30"\uB85C \uAC10\uCDB0\uC838 \uC788\uC2B5\uB2C8\uB2E4.`:xe?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":ye?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):gt(Er,{sx:{flex:1,minHeight:0},children:gt(Gx,{ref:Ke,style:{height:"100%"},thumb:{width:8},scrollTopFab:!0,children:bt?gt(Kx,{customScrollParent:bt,data:qe,computeItemKey:(he,Oe)=>Oe.kind==="header"?`group:${Oe.section.key}`:Oe.task.seq,endReached:Te?void 0:_e,defaultItemHeight:Rf,increaseViewportBy:{top:600,bottom:600},itemContent:(he,Oe)=>{if(Oe.kind==="task")return It(Oe.task,Oe.last&&me);let{section:at,visibleTasks:sr,collapsed:Xr}=Oe;return Tn(Er,{onClick:()=>g(at.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:pe.table.groupHeader.minHeight,bgcolor:pe.table.groupHeader.bg,borderBottom:`1px solid ${pe.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:pe.table.groupHeader.hoverBg},...pe.table.groupHeader.sx},children:[Xr?gt(Wx,{sx:{fontSize:20,color:pe.colors.textMuted}}):gt(Hx,{sx:{fontSize:20,color:pe.colors.textMuted}}),gt(Er,{component:"span",sx:{fontSize:pe.table.groupHeader.labelFontSize,fontWeight:pe.table.groupHeader.labelFontWeight,color:pe.table.groupHeader.labelColor},children:at.label}),q?gt(Er,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:q(at.key,at.tasks)}):null,D&&(!P||P(at.key))?gt(zx,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:no=>{no.stopPropagation(),D(at.key,at.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:pe.colors.textSecondary,"&:hover":{bgcolor:pe.colors.surfaceHover,color:pe.colors.accentOnSurface}},children:gt(Mf,{sx:{fontSize:21}})}):null,Tn(Er,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[N?N(at.key,at.tasks):null,gt(Er,{component:"span",sx:{flexShrink:0,width:pe.table.groupHeader.badge.width,py:pe.table.groupHeader.badge.paddingY,borderRadius:`${pe.table.groupHeader.badge.borderRadius}px`,bgcolor:pe.table.groupHeader.badge.bg,border:pe.table.groupHeader.badge.border,color:pe.table.groupHeader.badge.color,fontSize:pe.table.groupHeader.badge.fontSize,fontWeight:pe.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:sr.length})]})]})}},ue):null})}),gt(Ei,{anchorEl:Rt?.anchorEl??null,value:Qt?.status??"",options:Qt?Ba(Qt):xs,onSelect:he=>{Qt&&y(Qt.seq,he)},onClose:()=>xt(null)}),gt(Ef,{transitionDuration:0,anchorEl:Nt?.anchorEl??null,open:!!Nt,onClose:()=>Vt(null),children:["high","medium","low"].map(he=>Tn(Wa,{selected:Q?.priority===he,onClick:()=>{Q&&ve?.(Q.seq,he),Vt(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[gt(Lr,{priority:he,small:!0}),Q?.priority===he?gt(zc,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},he))}),Tn(Ef,{anchorEl:Ue?.anchorEl??null,open:!!Ue,onClose:()=>rt(null),transitionDuration:0,children:[Tn(Wa,{selected:!Ue?.task.tab_key,onClick:()=>{Ue&&z(Ue.task.seq,""),rt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[gt(Vx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",Ue?.task.tab_key?null:gt(zc,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),u.filter(he=>!he.archived).map(he=>{let Oe=wt(he.icon),at=Ue?.task.tab_key===he.key;return Tn(Wa,{selected:at,onClick:()=>{Ue&&z(Ue.task.seq,he.key),rt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Oe?gt(Oe,{sx:{fontSize:17,color:"#1e3a8a"}}):null,he.label,at?gt(zc,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},he.key)}),T?[gt(jx,{},"add-project-divider"),Tn(Wa,{onClick:()=>St(!0),sx:{fontSize:14,color:"#787774"},children:[gt(Fx,{children:gt(Mf,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),T?gt(qa,{open:dt,onClose:()=>St(!1),onSubmit:(he,Oe)=>{let at=Ue?.task.seq??0;(async()=>{let sr=await T(he,Oe);sr&&at&&z(at,sr)})(),rt(null)}}):null,gt(zo,{anchorEl:le?.anchorEl??null,value:fe?.icon??"",color:fe?.icon_color??"",onSelect:he=>{le&&A?.(le.taskSeq,he),be(null)},onSelectColor:j?he=>{le&&j(le.taskSeq,he)}:void 0,onClose:()=>be(null)}),gt(pn,{anchorEl:Je?.anchorEl??null,open:!!Je&&Je?.field==="start_date",date:Je?.date??"",reminders:[],hideReminder:!0,showTime:!Je?.isEvent,onClose:()=>Me(null),onDateChange:Qe,onReminderChange:()=>{}}),gt(pn,{anchorEl:Je?.anchorEl??null,open:!!Je&&Je?.field==="due_date",date:Je?.date??"",showTime:!Je?.isEvent,reminders:Je?.reminders??[],hideReminder:!!Je?.completed,onClose:()=>Me(null),onDateChange:Qe,onReminderChange:qt}),gt(Dt,{open:!!We,anchorEl:We?.anchorEl??null,title:We?.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:()=>Ie(null),onConfirm:()=>{We&&p?.(We.taskSeq),Ie(null)}}),gt(Dt,{open:!!Ae,anchorEl:Ae?.anchorEl??null,title:Ae?.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:Ae?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>yt(null),onConfirm:()=>{Ae&&c(Ae.task,Ae.nextCompleted),yt(null)}})]})}import{useCallback as Wn,useMemo as fo,useRef as y2,useState as ho}from"react";import{Box as jt,ButtonBase as Vf,Divider as Nf,IconButton as Lf,Menu as jf,MenuItem as Fo}from"@mui/material";import Hc from"@mui/icons-material/Add";import zf from"@mui/icons-material/MoreVert";import Ff from"@mui/icons-material/EditOutlined";import qf from"@mui/icons-material/ArchiveOutlined";import $f from"@mui/icons-material/UnarchiveOutlined";import x2 from"@mui/icons-material/NotificationsOutlined";import v2 from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as Xx}from"@mui/material";import{jsx as Af}from"react/jsx-runtime";function cr({sx:e,...h}){return Af(Xx,{viewBox:"0 0 24 24",...h,sx:{fill:"none",...e},children:Af("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 w2,DragOverlay as _2,PointerSensor as k2,pointerWithin as S2,rectIntersection as T2,useDroppable as C2,useSensor as B2,useSensors as I2}from"@dnd-kit/core";import{SortableContext as Kf,arrayMove as Hf,horizontalListSortingStrategy as E2,useSortable as M2,verticalListSortingStrategy as R2}from"@dnd-kit/sortable";import{CSS as O2}from"@dnd-kit/utilities";import Wc from"@ehfuse/overlay-scrollbar";import{useState as n2}from"react";import{Box as uo,ButtonBase as o2,Checkbox as i2,Tooltip as s2}from"@mui/material";import a2 from"@mui/icons-material/AlarmOutlined";import l2 from"@mui/icons-material/TimerOutlined";import{Box as Cn,Button as Zx,Popover as Jx}from"@mui/material";import Qx from"@mui/icons-material/CheckCircle";import{Fragment as e2,jsx as Hn,jsxs as ai}from"react/jsx-runtime";function Ua({anchorEl:e,open:h,acks:b,total:l,avatarSrcByName:o,pendingNames:s=[],onRequestConfirm:r,onClose:t}){let n=Lt();return Hn(Jx,{open:h&&(n||!!e),anchorEl:e,onClose:t,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...n?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:ai(Cn,{sx:{minWidth:240,maxWidth:320,py:1},children:[ai(Cn,{sx:{px:2,pb:.75,fontSize:kr(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",b.length,"/",l]}),s.length>0&&b.length>0?ai(Cn,{sx:{px:2,pt:1,pb:.5,fontSize:kr(12.5),fontWeight:600,color:"#9a9a97"},children:["\uD655\uC778 ",b.length]}):null,b.length===0?s.length>0?null:Hn(Cn,{sx:{px:2,py:1.5,fontSize:kr(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(c=>ai(Cn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[Hn(jr,{names:[c.name],size:22,avatarSrcByName:o}),Hn(Cn,{component:"span",sx:{fontSize:kr(14),color:"#37352f",whiteSpace:"nowrap"},children:c.name}),Hn(Cn,{component:"span",sx:{ml:"auto",fontSize:kr(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:on(c.time)}),Hn(Qx,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},c.account_seq)),s.length>0?ai(e2,{children:[ai(Cn,{sx:{mt:b.length>0?.75:0,px:2,pt:1,pb:.5,borderTop:b.length>0?"1px solid #efefed":"none",fontSize:kr(12.5),fontWeight:600,color:"#9a9a97"},children:["\uBBF8\uD655\uC778 ",s.length]}),s.map(c=>ai(Cn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[Hn(jr,{names:[c],size:22,avatarSrcByName:o}),Hn(Cn,{component:"span",sx:{fontSize:kr(14),color:"#37352f",whiteSpace:"nowrap"},children:c})]},c))]}):null,r?Hn(Cn,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:Hn(Zx,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{r(),t()},sx:{fontSize:kr(13)},children:"\uD655\uC778 \uC694\uCCAD"})}):null]})})}function t2(e){let h=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(b=>b>0&&b!==h))]}function r2(e){let h=new Map,b=Number(e.manager_account_seq??0);b>0&&h.set(b,String(e.manager_name??"").trim());let l=e.receiver_account_seqs??[],o=e.receiver_names??[];return l.forEach((s,r)=>{s>0&&!h.has(s)&&h.set(s,String(o[r]??"").trim())}),h}function Va(e,h){let b=t2(e),l=e.acks??[],o=h>0?l.find(t=>t.account_seq===h):void 0,s=new Set(l.map(t=>t.account_seq)),r=r2(e);return{myTime:o?.time??"",canConfirm:h>0&&b.includes(h)&&!o,count:l.filter(t=>b.includes(t.account_seq)).length,total:b.length,pendingNames:b.filter(t=>!s.has(t)).map(t=>r.get(t)??"").filter(t=>t.length>0)}}function eM(e){let h=String(e??"").trim();return h?h.slice(5,16).replaceAll("-","."):""}import{Fragment as f2,jsx as zr,jsxs as li}from"react/jsx-runtime";function Ka(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}}var c2=3;function u2(e){let h=e.trim();return h?h.slice(2,10).replaceAll("-","."):"-"}function d2(){let e=new Date,h=String(e.getMonth()+1).padStart(2,"0"),b=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${h}-${b}`}function Ts({task:e,statusOptions:h,showDueDate:b=!1,onRequestArchiveToggle:l,onRequestReply:o,onDueDateClick:s,titleFontSize:r=13}){let t=ct(),n=Mi(e),i=!!e.due_date&&e.due_date.slice(0,10)<=d2()?t.colors.danger:t.colors.accentOnSurface,a=Va(e,0),[d,f]=n2(null),u=Ii(e,h),g=new Set(e.label_keys??[]),m=u.filter(_=>!g.has(_.key)),x=u.filter(_=>g.has(_.key));return li(f2,{children:[li(uo,{sx:{display:"flex",alignItems:"flex-start",gap:.5},children:[zr(i2,{size:"small",checked:e.completed,inputProps:{"aria-label":e.completed?`${e.title} \uC644\uB8CC \uD574\uC81C`:`${e.title} \uC644\uB8CC \uCC98\uB9AC`},onPointerDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),onChange:(_,B)=>l?.({anchorEl:_.currentTarget,taskSeq:e.seq,nextCompleted:B}),sx:{p:0}}),zr(s2,{title:e.title,arrow:!0,enterDelay:300,children:li(uo,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:r,fontWeight:t.mode==="dark"||e.completed?400:500,color:t.mode==="dark"?t.colors.textStrong:t.colors.textPrimary,lineHeight:1.35,overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:c2,overflowWrap:"anywhere",textDecoration:e.completed?"line-through":"none"},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})}),n?zr(uo,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:t.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:n}):null,(e.comment_count??e.comments?.length??0)>0?zr(jo,{sx:{fontSize:15,flexShrink:0,color:t.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?zr(uo,{sx:{pl:3,mt:-.5,fontSize:12.5,color:t.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,li(uo,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[li(uo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[m.map(_=>zr(At,{option:_,small:!0},_.key)),zr(Lr,{priority:e.priority,small:!0}),x.map(_=>zr(At,{option:_,small:!0},_.key))]}),b&&String(e.due_date??"").trim()?li(o2,{disabled:!s,onPointerDown:_=>_.stopPropagation(),onClick:_=>{_.stopPropagation(),s?.(e,_.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:i,whiteSpace:"nowrap","&:hover":s?{bgcolor:t.colors.border}:void 0},children:[u2(e.due_date),zr(a2,{sx:{fontSize:15}})]}):null]}),b&&(e.due_date.slice(11,16)||e.estimated_time)?li(uo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:t.colors.textSecondary},children:[zr(l2,{sx:{fontSize:14}}),e.due_date.slice(11,16)||e.estimated_time]}):null,zr(jr,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),a.total>0?zr(uo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:zr(uo,{sx:{flexShrink:0,width:64},onPointerDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),children:zr(Oi,{canConfirm:!1,count:a.count,total:a.total,onConfirm:()=>{},onShowList:_=>f(_)})})}):null,zr(Ua,{anchorEl:d,open:!!d,acks:e.acks??[],total:a.total,pendingNames:a.pendingNames,onRequestConfirm:o&&a.count<a.total?()=>{o(e),f(null)}:void 0,onClose:()=>f(null)})]})}import{Box as h2}from"@mui/material";import{useSortable as p2}from"@dnd-kit/sortable";import{CSS as m2}from"@dnd-kit/utilities";import{jsx as Df}from"react/jsx-runtime";function g2(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function Pf({task:e,statusOptions:h,variant:b="card",showDueDate:l=!1,onRequestArchiveToggle:o,onRequestReply:s,onDueDateClick:r,onCardClick:t,onCardContextMenu:n,titleFontSize:c}){let i=ct(),{attributes:a,listeners:d,setNodeRef:f,transform:u,transition:g,isDragging:m}=p2({id:String(e.seq)}),x=b==="list";return Df(h2,{ref:f,...a,...d,onClick:t?()=>t(e):void 0,onContextMenu:n?_=>n(e,_):void 0,sx:{...x?g2(i.card):Ka(i.card),opacity:m?.35:e.completed?.55:1,transform:m2.Translate.toString(u),transition:g,position:"relative",cursor:"default",touchAction:"none","&:hover":x?{bgcolor:i.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:Df(Ts,{task:e,statusOptions:h,showDueDate:l,onRequestArchiveToggle:o,onRequestReply:s,onDueDateClick:r,titleFontSize:c})})}function b2(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function mn(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let h=b2(e.end_date);return h?`${e.name} (~${h})`:e.name}import{jsx as nt,jsxs as Ht}from"react/jsx-runtime";var Wf=2,Ga="group-",gn="colmove-",Fc="__default__",qc=bc,$c="__other__",Ya="sprint-",Uf=`${Ya}0`,A2={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function Gf(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 D2({column:e,tasks:h,statusOptions:b,onRequestArchiveToggle:l,onRequestReply:o,onDueDateClick:s,onAddTask:r,canAdd:t,onOpenMenu:n,onCardClick:c,onCardContextMenu:i,grow:a,summary:d,onOpenSprintMenu:f}){let u=ct(),{setNodeRef:g,isOver:m}=C2({id:`${Ga}${e.key}`}),{attributes:x,listeners:_,setNodeRef:B,transform:A,transition:j,isDragging:D}=M2({id:`${gn}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return Ht(jt,{ref:P=>{g(P),B(P)},sx:{flex:a?"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:m?u.colors.accentSoft:u.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:O2.Translate.toString(A),...j?{transition:`${j}, background-color 0.15s`}:{},opacity:D?.6:1},children:[Ht(jt,{...x,..._,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${u.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?nt(jt,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let P=wt(e.icon);return P?nt(P,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),nt(jt,{component:"span",sx:{fontSize:u.board.columnHeaderFontSize,fontWeight:700,color:u.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),nt(jt,{component:"span",sx:{...Gf(u.board.badge),ml:"auto"},children:h.length}),e.sprint&&f?nt(Lf,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>f(P.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:nt(zf,{sx:{fontSize:18}})}):e.locked?null:nt(Lf,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>n({anchorEl:P.currentTarget,column:e}),sx:{color:"#9a9a97"},children:nt(zf,{sx:{fontSize:18}})})]}),d?nt(jt,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${u.card.borderColor}`,flexShrink:0},children:d}):null,nt(jt,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:nt(Wc,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Ht(jt,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[nt(Kf,{items:h.map(P=>String(P.seq)),strategy:R2,children:h.map(P=>nt(Pf,{task:P,statusOptions:b,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:l,onRequestReply:o,onDueDateClick:s,onCardClick:c,onCardContextMenu:i},P.seq))}),h.length===0&&!t?nt(jt,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,h.length===0&&t?nt(jt,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:Ht(Vf,{className:"taskbox-board-add",onClick:()=>r(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${u.card.borderColor}`,bgcolor:u.card.bg,color:u.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:u.card.hoverBg}},children:[nt(Hc,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function Uc({tasks:e,statusOptions:h,customTabs:b,mode:l="active",onToggleCompleted:o,onRequestReply:s,onChangeDueDate:r,onChangeReminder:t,onMoveTask:n,columnAxis:c="project",statusColumns:i=[],onMoveTaskStatus:a,sprintColumns:d=[],onMoveTaskSprint:f,onAddGroup:u,onAddTask:g,canAdd:m=!0,onRequestRename:x,onArchiveProject:_,onDeleteProject:B,onReorderProjects:A,onOpenDetail:j,onTaskContextMenu:D,hideCompleted:P=!1,renderColumnSummary:N,onEditSprint:q,onChangeSprintStatus:z,onRemoveSprint:T}){let C=ct(),[R,p]=ho(null),[y,v]=ho(null),[w,k]=ho(null),[S,E]=ho(null),[L,$]=ho(null),[U,O]=ho(null),[W,M]=ho(null),[I,F]=ho(null),[V,Y]=ho(null),K=y2(!1),H=fo(()=>new Map(e.map(ce=>[ce.seq,ce])),[e]),Z=fo(()=>{let ce=e.filter(Re=>Re.is_notice);return ce.sort((Re,Se)=>Re.completed!==Se.completed?Re.completed?1:-1:Se.seq-Re.seq),ce},[e]),J=fo(()=>b.filter(ce=>!ce.archived),[b]),G=fo(()=>b.filter(ce=>ce.archived),[b]),X=ce=>({key:ce.key,label:ce.label,icon:ce.icon,isDefault:!1,isArchived:ce.archived}),ee=fo(()=>new Set(i.map(ce=>ce.key)),[i]),ne=fo(()=>new Set(d.map(ce=>ce.seq)),[d]),re=fo(()=>{if(c==="sprint")return[{key:Uf,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...d.map(ce=>({key:`${Ya}${ce.seq}`,label:mn(ce),icon:"",isDefault:!1,isArchived:!1,dot:A2[ce.status],locked:!0,sprint:ce}))];if(c==="status"){let ce=i.map(Re=>({key:Re.key,label:Re.name,icon:"",isDefault:!1,isArchived:!1,dot:Re.dot,locked:!0}));return ce.some(Re=>Re.key===qc)?ce:[...ce,{key:qc,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return l==="archived"?G.map(X):[{key:Fc,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...J.map(X)]},[c,i,d,l,J,G]),oe=I2(B2(k2,{activationConstraint:{distance:5}})),se=Wn(ce=>{let Re=String(ce.active.id).startsWith(gn),Se=S2(ce),Ce=Se.length>0?Se:T2(ce);if(Re)return Ce.filter(qe=>String(qe.id).startsWith(gn));let lt=Ce.filter(qe=>!String(qe.id).startsWith(gn)),Le=lt.filter(qe=>!String(qe.id).startsWith(Ga));return Le.length>0?Le:lt},[]),ge=fo(()=>{let ce=new Map;for(let Re of e){if(Re.is_notice)continue;let Se;if(c==="sprint"){let lt=Re.sprint_seq??0;Se=ne.has(lt)?`${Ya}${lt}`:Uf}else Se=c==="status"?Re.completed?qc:ee.has(String(Re.status??""))?String(Re.status??""):$c:Re.tab_key?.trim()||Fc;let Ce=ce.get(Se);Ce?Ce.push(Re):ce.set(Se,[Re])}for(let Re of ce.values())Re.sort((Se,Ce)=>{if(Se.completed!==Ce.completed)return Se.completed?1:-1;let lt=(Se.group_sort_no??0)>0,Le=(Ce.group_sort_no??0)>0;return lt&&Le?(Se.group_sort_no??0)-(Ce.group_sort_no??0):lt!==Le?lt?-1:1:Se.due_date!==Ce.due_date?Se.due_date<Ce.due_date?-1:1:Se.seq-Ce.seq});return ce},[e,c,ee,ne]),ve=fo(()=>c!=="status"||(ge.get($c)??[]).length===0?re:[...re,{key:$c,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[c,re,ge]),_e=Wn(ce=>W?(W.get(ce)??[]).map(Re=>H.get(Re)).filter(Re=>!!Re):ge.get(ce)??[],[W,H,ge]),De=Wn(ce=>{let Re=_e(ce);return P?Re.filter(Se=>!Se.completed):Re},[_e,P]),pe=Wn(ce=>{let Re=String(ce.active.id);if(Re.startsWith(gn)){Y(Re.slice(gn.length));return}F(Number(Re)),M(new Map(re.map(Se=>[Se.key,(ge.get(Se.key)??[]).map(Ce=>Ce.seq)])))},[re,ge]),de=Wn((ce,Re)=>{if(ce.startsWith(Ga))return{key:ce.slice(Ga.length),overSeq:null};let Se=Number(ce);for(let[Ce,lt]of Re)if(lt.includes(Se))return{key:Ce,overSeq:Se};return null},[]),Ve=Wn(ce=>{let{active:Re,over:Se}=ce;!Se||String(Re.id).startsWith(gn)||M(Ce=>{if(!Ce)return Ce;let lt=Number(Re.id),Le=de(String(Se.id),Ce);if(!Le)return Ce;let qe=[...Ce.entries()].find(([,vt])=>vt.includes(lt))?.[0];if(!qe||qe===Le.key)return Ce;let kt=new Map(Ce);kt.set(qe,(kt.get(qe)??[]).filter(vt=>vt!==lt));let $e=[...kt.get(Le.key)??[]],Ne=$e.length;if(Le.overSeq!==null){let vt=$e.indexOf(Le.overSeq);vt!==-1&&(Ne=vt)}return $e.splice(Ne,0,lt),kt.set(Le.key,$e),kt})},[de]),Pe=Wn(ce=>{let Re=String(ce.active.id);if(Re.startsWith(gn)){Y(null);let Ne=String(ce.over?.id??"");if(!Ne.startsWith(gn))return;let vt=Re.slice(gn.length),et=Ne.slice(gn.length);if(vt===et)return;let Ke=b.map(te=>te.key),bt=Ke.indexOf(vt),tt=Ke.indexOf(et);if(bt===-1||tt===-1)return;A(Hf(Ke,bt,tt));return}let Se=W;if(M(null),F(null),K.current=!0,!Se||!ce.over)return;let Ce=Number(Re),lt=[...Se.entries()].find(([,Ne])=>Ne.includes(Ce));if(!lt)return;let[Le,qe]=lt,kt=[...qe],$e=de(String(ce.over.id),Se);if($e&&$e.key===Le&&$e.overSeq!==null&&$e.overSeq!==Ce){let Ne=kt.indexOf(Ce),vt=kt.indexOf($e.overSeq);Ne!==-1&&vt!==-1&&(kt=Hf(kt,Ne,vt))}if(c==="status"){a?.(Ce,Le);return}if(c==="sprint"){f?.(Ce,Number(Le.slice(Ya.length))||0);return}n(Ce,Le===Fc?"":Le,kt)},[b,W,de,n,A,c,a,f]),ie=Wn(()=>{M(null),F(null),Y(null),K.current=!0},[]),Be=Wn(ce=>{if(K.current){K.current=!1;return}j(ce)},[j]),ye=I!==null?H.get(I)??null:null,xe=V!==null?re.find(ce=>ce.key===V)??null:null,Ze=Wn((ce,Re)=>{O({anchorEl:Re,taskSeq:ce.seq,date:ce.due_date,reminders:zn(ce)})},[]),Te=y?.column??null;return Ht(jt,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${C.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:Wf,bgcolor:C.colors.surfaceSubtle},children:[Ht(w2,{sensors:oe,collisionDetection:se,onDragStart:pe,onDragOver:Ve,onDragEnd:Pe,onDragCancel:ie,children:[nt(jt,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:l==="archived"&&re.length===0?nt(jt,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):nt(Wc,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:Ht(jt,{sx:{display:"flex",alignItems:"flex-start",gap:Wf,height:"100%",minWidth:"min-content",pb:.5},children:[l==="active"&&Z.length>0?Ht(jt,{sx:{flex:c!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:ce=>ce.shadows[1],bgcolor:C.card.bg,overflow:"hidden"},children:[Ht(jt,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${C.card.borderColor}`,flexShrink:0,minHeight:48},children:[nt(x2,{sx:{fontSize:17,color:"#e8763a"}}),nt(jt,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:C.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),Ht(jt,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",Z.length,")"]})]}),nt(jt,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:nt(Wc,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:nt(jt,{sx:{display:"flex",flexDirection:"column"},children:Z.map(ce=>Ht(jt,{onClick:()=>Be(ce),onContextMenu:Re=>D(ce,Re),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${C.card.borderColor}`,bgcolor:C.card.bg,cursor:"pointer","&:hover":{bgcolor:C.card.hoverBg}},children:[nt(Ts,{task:ce,statusOptions:h,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:p}),(()=>{let Re=(ce.target_names??[]).filter(Ce=>Ce.trim());if(Re.length===0)return null;let Se=Re.length>2?`${Re[0]}, ${Re[1]} \uC678 ${Re.length-2}`:Re.join(", ");return Ht(jt,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[nt(v2,{sx:{fontSize:14,flexShrink:0}}),nt(jt,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:Se})]})})()]},ce.seq))})})})]}):null,nt(Kf,{items:J.map(ce=>`${gn}${ce.key}`),strategy:E2,children:ve.map(ce=>nt(D2,{column:ce,tasks:De(ce.key),summary:N?.(ce.key,_e(ce.key)),onOpenSprintMenu:q||z||T?(Re,Se)=>k({anchorEl:Re,sprint:Se}):void 0,statusOptions:h,onRequestArchiveToggle:p,onRequestReply:s,onDueDateClick:Ze,onAddTask:g,canAdd:m&&c==="project",onOpenMenu:v,onCardClick:Be,onCardContextMenu:D,grow:c!=="project"},ce.key))}),l==="active"&&c==="project"?Ht(Vf,{onClick:u,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:[nt(Hc,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,l==="active"&&ve.length===0&&Z.length===0?nt(jt,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:c==="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]})})}),nt(_2,{children:ye?nt(jt,{sx:{...Ka,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:nt(Ts,{task:ye,statusOptions:h,showDueDate:!0,titleFontSize:15})}):xe?Ht(jt,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:C.card.bg,border:`1px solid ${C.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let ce=wt(xe.icon);return ce?nt(ce,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),nt(jt,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:C.board.columnHeaderColor},children:xe.label}),nt(jt,{component:"span",sx:Gf(C.board.badge),children:(ge.get(xe.key)??[]).length})]}):null})]}),Ht(jf,{transitionDuration:0,anchorEl:y?.anchorEl??null,open:!!y,onClose:()=>v(null),children:[Te&&!Te.isArchived&&m?Ht(Fo,{onClick:()=>{Te&&g(Te.isDefault?"":Te.key),v(null)},sx:{fontSize:14,gap:1},children:[nt(Hc,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,Te&&!Te.isDefault&&!Te.isArchived?Ht(Fo,{onClick:()=>{x(Te.key,Te.label,Te.icon),v(null)},sx:{fontSize:14,gap:1},children:[nt(Ff,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,Te&&!Te.isDefault&&!Te.isArchived?Ht(Fo,{onClick:()=>{_(Te.key,!0),v(null)},sx:{fontSize:14,gap:1},children:[nt(qf,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,Te&&Te.isArchived?Ht(Fo,{onClick:()=>{_(Te.key,!1),v(null)},sx:{fontSize:14,gap:1},children:[nt($f,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,Te&&!Te.isDefault?nt(Nf,{}):null,Te&&!Te.isDefault?Ht(Fo,{onClick:()=>{y&&$(y),v(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[nt(cr,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),Ht(jf,{transitionDuration:0,anchorEl:w?.anchorEl??null,open:!!w,onClose:()=>k(null),children:[q?Ht(Fo,{onClick:()=>{w&&q(w.sprint.seq),k(null)},sx:{fontSize:14,gap:1},children:[nt(Ff,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,z?Ht(Fo,{onClick:()=>{w&&z(w.sprint.seq,w.sprint.status==="closed"?"active":"closed"),k(null)},sx:{fontSize:14,gap:1},children:[w?.sprint.status==="closed"?nt($f,{sx:{fontSize:18,color:"#787774"}}):nt(qf,{sx:{fontSize:18,color:"#787774"}}),w?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,T?nt(Nf,{}):null,T?Ht(Fo,{onClick:()=>{w&&E(w),k(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[nt(cr,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),nt(Dt,{open:!!S,anchorEl:S?.anchorEl??null,title:`"${S?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>E(null),onConfirm:()=>{S&&T?.(S.sprint.seq),E(null)}}),nt(pn,{anchorEl:U?.anchorEl??null,open:!!U,date:U?.date??"",reminders:U?.reminders??[],onClose:()=>O(null),onDateChange:ce=>{U&&(r(U.taskSeq,ce),O(Re=>Re&&{...Re,date:ce}))},onReminderChange:ce=>{U&&(t(U.taskSeq,ce),O(Re=>Re&&{...Re,reminders:ce}))}}),nt(Dt,{open:!!L,anchorEl:L?.anchorEl??null,title:`"${L?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
30
- \uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>$(null),onConfirm:()=>{L&&B(L.column.key),$(null)}}),nt(Dt,{open:!!R,anchorEl:R?.anchorEl??null,title:R?.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:R?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>p(null),onConfirm:()=>{R&&o(R.taskSeq,R.nextCompleted),p(null)}})]})}import{useCallback as mo,useMemo as Cs,useRef as Zf,useState as Bs}from"react";import{Box as mr,Button as W2,ButtonBase as Qf,IconButton as Jf}from"@mui/material";import U2 from"@mui/icons-material/Add";import V2 from"@mui/icons-material/ChevronLeft";import K2 from"@mui/icons-material/ChevronRight";import G2 from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Y2}from"@ehfuse/mui-datetime-picker";import{DndContext as X2,DragOverlay as Z2,PointerSensor as J2,pointerWithin as Q2,rectIntersection as ev,useDroppable as tv,useSensor as rv,useSensors as nv}from"@dnd-kit/core";import{SortableContext as ov,arrayMove as iv,useSortable as sv,verticalListSortingStrategy as av}from"@dnd-kit/sortable";import{CSS as lv}from"@dnd-kit/utilities";import cv from"@ehfuse/overlay-scrollbar";function P2(e){let[h,b,l]=e.split("-").map(Number),o=new Date(Date.UTC(h,b-1,l+1)),s=r=>String(r).padStart(2,"0");return`${o.getUTCFullYear()}-${s(o.getUTCMonth()+1)}-${s(o.getUTCDate())}`}function Ai(e){let h=new Map;for(let b of e){let l=b.start_date;for(let o=0;o<62&&l<=b.end_date;o+=1){let s=h.get(l);s?s.push(b):h.set(l,[b]),l=P2(l)}}for(let b of h.values())b.sort((l,o)=>(l.time||"99:99").localeCompare(o.time||"99:99")||l.title.localeCompare(o.title));return h}function Di(e){let h=String((e.is_event?e.event_time:e.due_date.slice(11,16)||e.estimated_time)??"").trim();return/^\d{1,2}:\d{2}$/.test(h)?h:""}function Pi(e,h){if(e.completed!==h.completed)return e.completed?1:-1;let b=Di(e),l=Di(h);if(!!b!=!!l)return b?-1:1;if(b&&l&&b!==l)return b<l?-1:1;let o=e.sort_no>0,s=h.sort_no>0;return o&&s?e.sort_no-h.sort_no:o!==s?o?-1:1:e.seq-h.seq}import{Box as Vc,Tooltip as N2}from"@mui/material";import{jsx as Kc,jsxs as L2}from"react/jsx-runtime";function Ni({event:e,small:h=!1}){let b=e.time?`${e.time} ${e.title}`:e.title,l=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",o=s=>{s.stopPropagation();let[r,t,n]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${r}/${t}/${n}`,"_blank")};return Kc(N2,{title:`(${l}) ${b}`,arrow:!0,enterDelay:300,children:L2(Vc,{onClick:o,onPointerDown:s=>s.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:h?.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:[Kc(Vc,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),Kc(Vc,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:b})]})})}import{useCallback as F2}from"react";import{Box as qo,Checkbox as q2}from"@mui/material";import{useLayoutEffect as j2,useState as Yf}from"react";var Yc=new WeakMap,Gc=null;function z2(){return typeof ResizeObserver>"u"?null:(Gc||(Gc=new ResizeObserver(e=>{for(let h of e){let b=Yc.get(h.target);if(!b)continue;let l=h.borderBoxSize?.[0]?.inlineSize??h.target.getBoundingClientRect().width;b(l)}})),Gc)}function Xf(){let[e,h]=Yf(null),[b,l]=Yf(0);return j2(()=>{if(!e)return;l(e.getBoundingClientRect().width);let o=z2();if(o)return Yc.set(e,s=>l(r=>Math.abs(r-s)<1?r:s)),o.observe(e),()=>{o.unobserve(e),Yc.delete(e)}},[e]),{ref:h,width:b}}import{jsx as po,jsxs as Xc}from"react/jsx-runtime";var Zc={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"},Li=15,$2=150,H2=3;function $o({task:e,statusOptions:h,onOpenDetail:b,onContextMenu:l,isPreview:o=!1,isDragging:s=!1,isMine:r=!1,avatarSrcByName:t,showManagerAvatar:n=!1,onOpenMembers:c,setNodeRef:i,dragProps:a,trailing:d,showCheckbox:f=!1,onRequestToggleCompleted:u,showTime:g=!0,wrapTitle:m=!1}){let x=ct(),_=x.mode==="dark",[B]=Ii(e,h),A=String(e.manager_name??"").trim(),j=g?Di(e):"",D=Mi(e),P=!e.completed&&!e.is_event&&!e.due_date.slice(0,10),N=e.is_notice||e.is_event?wt(e.icon||(e.is_notice?or:ar)):null,q=!e.completed&&!e.is_event&&!!e.due_date&&e.due_date.slice(0,10)<Zd(),{ref:z,width:T}=Xf(),C=T>0&&T<$2,R=C||m,p=F2(v=>{z(v),i?.(v)},[z,i]),y=n&&!r&&!C&&!!A;return Xc(qo,{ref:p,...a??{},onClick:v=>{v.stopPropagation(),b(e)},onContextMenu:l?v=>l(e,v):void 0,sx:{display:"flex",alignItems:R?"flex-start":"center",gap:.5,py:.6,px:1,flexShrink:0,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:B?_?Bi(B.dot,x.chip.darkBgAlpha):B.bg:_?x.card.bg:x.colors.surfaceHover,color:B?_?x.chip.darkTextSource==="fg"?B.fg:B.dot:B.fg:x.colors.textPrimary,fontSize:Li,fontWeight:_||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:o?.5:s?.35:e.completed?.6:P?.75:1,border:o?`1px dashed ${x.colors.accent}`:"1px solid transparent",pointerEvents:o?"none":"auto",cursor:"pointer",touchAction:a?"none":"auto",overflow:"hidden","&:hover":{filter:"brightness(0.96)"},...q?{borderLeft:`3px solid ${x.colors.danger}`,pl:.75}:r?{borderLeft:"3px solid #2f80ed",pl:.75}:{}},children:[po(qo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,...R?{mt:"7px"}:{},bgcolor:Zc[e.priority]??x.colors.accentOnSurface}}),f&&!C&&u?po(q2,{size:"small",checked:e.completed,onPointerDown:v=>v.stopPropagation(),onClick:v=>v.stopPropagation(),onChange:(v,w)=>u({anchorEl:v.currentTarget,taskSeq:e.seq,nextCompleted:w}),sx:{p:0,flexShrink:0}}):null,N&&!C?po(N,{sx:{fontSize:15,flexShrink:0,opacity:.75,...R?{mt:"3px"}:{}}}):null,Xc(qo,{sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",color:_?x.colors.textStrong:x.colors.textPrimary,...P&&!_?{color:x.colors.textSecondary}:{}},children:[C&&j?po(qo,{component:"span",sx:{lineHeight:1.35,fontSize:Li-1,color:e.completed?x.colors.textPrimary:x.colors.danger},children:j}):null,Xc(qo,{component:"span",sx:{minWidth:0,overflow:"hidden",...R?{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:H2,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.35}:{textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:[!C&&j?po(qo,{component:"span",sx:{mr:.5,fontSize:Li-1,color:e.completed?x.colors.textPrimary:x.colors.danger},children:j}):null,e.title,!C&&D?po(qo,{component:"span",sx:{ml:.5,fontSize:Li-2,color:x.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:D}):null,!C&&(e.comment_count??e.comments?.length??0)>0?po(jo,{sx:{fontSize:15,ml:.5,verticalAlign:"-2px",color:x.colors.textMuted}}):null]})]}),d??null,!d&&y?po(qo,{component:"span",onClick:c?v=>{v.stopPropagation(),c(e)}:void 0,sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:po(fn,{src:t?.get(A)??"",name:A,avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}import{jsx as Mt,jsxs as go}from"react/jsx-runtime";var eh=36,uv=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Za="day-";function Jc(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(h.getDate()-h.getDay()),h}function Xa(e,h){let b=new Date(e);return b.setDate(b.getDate()+h),b}function dv(e){let h=e[0],b=e[e.length-1];return h.getMonth()===b.getMonth()?`${h.getFullYear()}\uB144 ${h.getMonth()+1}\uC6D4`:h.getFullYear()===b.getFullYear()?`${h.getFullYear()}\uB144 ${h.getMonth()+1}\uC6D4 - ${b.getMonth()+1}\uC6D4`:`${h.getFullYear()}\uB144 ${h.getMonth()+1}\uC6D4 - ${b.getFullYear()}\uB144 ${b.getMonth()+1}\uC6D4`}function fv(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function hv({task:e,statusOptions:h,isMine:b,avatarSrcByName:l,onCardClick:o,onCardContextMenu:s,onRequestArchiveToggle:r,dragDisabled:t=!1}){let{attributes:n,listeners:c,setNodeRef:i,transform:a,transition:d,isDragging:f}=sv({id:String(e.seq),disabled:t});return Mt($o,{task:e,statusOptions:h,isMine:b,avatarSrcByName:l,showManagerAvatar:!0,wrapTitle:!0,onOpenDetail:u=>o?.(u),onContextMenu:s,showCheckbox:!0,onRequestToggleCompleted:r,isDragging:f,setNodeRef:i,dragProps:t?void 0:{...n,...c,style:{transform:lv.Translate.toString(a),transition:d}}})}function pv({dayKey:e,isToday:h,dayLabel:b,holidayName:l,tasks:o,googleEvents:s,statusOptions:r,onRequestArchiveToggle:t,onRequestReply:n,onAddSchedule:c,canAdd:i,onCardClick:a,onCardContextMenu:d,summary:f,myAccountSeq:u,avatarSrcByName:g,dragDisabled:m=!1}){let x=ct(),{setNodeRef:_}=tv({id:`${Za}${e}`,disabled:m});return go(mr,{ref:_,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:h?x.calendar.todayBg:x.calendar.cellBg},children:[go(mr,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:eh,bgcolor:h?x.calendar.todayBg:x.calendar.dateBandBg,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0},children:[l?Mt(mr,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:x.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l}):null,h?Mt(mr,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:x.colors.danger,color:x.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Mt(mr,{component:"span",sx:{fontSize:13.5,fontWeight:h?700:400,color:l?x.colors.danger:x.mode==="dark"?x.colors.textStrong:x.colors.textPrimary,flexShrink:0},children:b})]}),f?Mt(mr,{sx:{px:1,py:1,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0},children:f}):null,Mt(mr,{sx:{flex:1,minHeight:0,bgcolor:h?x.calendar.todayBg:x.colors.surfaceSubtle},children:Mt(cv,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:go(mr,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[s.length>0?Mt(mr,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:s.map(B=>Mt(Ni,{event:B},B.uid))}):null,Mt(ov,{items:o.map(B=>String(B.seq)),strategy:av,children:Mt(mr,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75},children:o.map(B=>Mt(hv,{task:B,statusOptions:r,isMine:u>0&&Number(B.manager_account_seq??0)===u,avatarSrcByName:g,onCardClick:a,onCardContextMenu:d,onRequestArchiveToggle:t,dragDisabled:m},B.seq))})}),Mt(mr,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...i?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:go(Qf,{className:"taskbox-add-schedule",onClick:()=>c(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.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:[Mt(U2,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function th({tasks:e,googleEvents:h=[],statusOptions:b,fallbackToStartDate:l=!1,myAccountSeq:o=0,avatarSrcByName:s,todayStr:r,onToggleCompleted:t,onMoveTask:n,onRequestReply:c,onAddSchedule:i,canAdd:a=!0,disableDrag:d=!1,onOpenDetail:f,onTaskContextMenu:u,hideCompleted:g=!1,renderColumnSummary:m}){let x=ct(),[_,B]=Bs(()=>Jc(new Date)),[A,j]=Bs(null),[D,P]=Bs(null),[N,q]=Bs(null),[z,T]=Bs(null),C=Zf(!1),R=Cs(()=>Array.from({length:7},(K,H)=>Xa(_,H)),[_]),p=Cs(()=>new Map(e.map(K=>[K.seq,K])),[e]),y=Cs(()=>[...new Set(R.map(K=>K.getFullYear()))],[R]),v=jn(y),w=nv(rv(J2,{activationConstraint:{distance:5}})),k=mo(K=>{let H=Q2(K),Z=H.length>0?H:ev(K),J=Z.filter(G=>!String(G.id).startsWith(Za));return J.length>0?J:Z},[]),S=Cs(()=>Ai(h),[h]),E=Cs(()=>{let K=new Map;for(let H of e){let Z=H.due_date.slice(0,10)||(l?H.start_date.slice(0,10)||String(H.created_time??"").slice(0,10):"");if(!Z)continue;let J=K.get(Z);J?J.push(H):K.set(Z,[H])}for(let H of K.values())H.sort(Pi);return K},[e,l]),L=mo(K=>N?(N.get(K)??[]).map(H=>p.get(H)).filter(H=>!!H):E.get(K)??[],[N,p,E]),$=mo(K=>{let H=L(K);return g?H.filter(Z=>!Z.completed):H},[L,g]),U=mo(K=>{T(Number(K.active.id)),q(new Map(R.map(H=>{let Z=gr(H);return[Z,(E.get(Z)??[]).map(J=>J.seq)]})))},[R,E]),O=mo((K,H)=>{if(K.startsWith(Za))return{day:K.slice(Za.length),overSeq:null};let Z=Number(K);for(let[J,G]of H)if(G.includes(Z))return{day:J,overSeq:Z};return null},[]),W=mo(K=>{let{active:H,over:Z}=K;Z&&q(J=>{if(!J)return J;let G=Number(H.id),X=O(String(Z.id),J);if(!X)return J;let ee=[...J.entries()].find(([,se])=>se.includes(G))?.[0];if(!ee||ee===X.day)return J;let ne=new Map(J);ne.set(ee,(ne.get(ee)??[]).filter(se=>se!==G));let re=[...ne.get(X.day)??[]],oe=re.length;if(X.overSeq!==null){let se=re.indexOf(X.overSeq);se!==-1&&(oe=se)}return re.splice(oe,0,G),ne.set(X.day,re),ne})},[O]),M=mo(K=>{let{active:H,over:Z}=K,J=N;if(q(null),T(null),C.current=!0,!J||!Z)return;let G=Number(H.id),X=[...J.entries()].find(([,se])=>se.includes(G));if(!X)return;let[ee,ne]=X,re=[...ne],oe=O(String(Z.id),J);if(oe&&oe.day===ee&&oe.overSeq!==null&&oe.overSeq!==G){let se=re.indexOf(G),ge=re.indexOf(oe.overSeq);se!==-1&&ge!==-1&&(re=iv(re,se,ge))}n(G,ee,re)},[N,n,O]),I=mo(()=>{q(null),T(null),C.current=!0},[]),F=mo(K=>{if(C.current){C.current=!1;return}f(K)},[f]),V=z!==null?p.get(z)??null:null,Y=Zf(null);return go(mr,{onTouchStart:K=>{let H=K.touches[0];Y.current=H?{x:H.clientX,y:H.clientY}:null},onTouchEnd:K=>{let H=Y.current;Y.current=null;let Z=K.changedTouches[0];if(!H||!Z||z!==null)return;let J=Z.clientX-H.x,G=Z.clientY-H.y;Math.abs(J)<60||Math.abs(J)<=Math.abs(G)||B(Xa(_,J<0?7:-7))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${x.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[go(mr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:x.calendar.bg,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0},children:[go(mr,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Mt(Jf,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>B(Xa(_,-7)),children:Mt(V2,{sx:{fontSize:24,color:x.colors.textSecondary}})}),Mt(W2,{size:"small",color:"inherit",onClick:()=>B(Jc(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:x.mode==="dark"?400:500,color:x.mode==="dark"?x.colors.textStrong:x.colors.textPrimary},children:"\uC624\uB298"}),Mt(Jf,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>B(Xa(_,7)),children:Mt(K2,{sx:{fontSize:24,color:x.colors.textSecondary}})})]}),go(Qf,{onClick:K=>P(K.currentTarget),sx:{ml:"auto",display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:x.mode==="dark"?400:700,color:x.mode==="dark"?x.colors.textStrong:x.colors.textPrimary,"&:hover":{bgcolor:x.colors.surfaceHover}},children:[dv(R),Mt(G2,{sx:{fontSize:18,color:x.colors.textMuted}})]})]}),Mt(mr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:x.calendar.headerBg,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${x.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:R.map(K=>{let H=K.getDay(),Z=v.has(gr(K));return Mt(mr,{sx:{height:eh,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:H===0||Z?x.colors.danger:H===6?x.colors.accentOnSurface:x.colors.textSecondary},children:uv[H]},gr(K))})}),Mt(mr,{sx:{flex:1,minHeight:0},children:go(X2,{sensors:w,collisionDetection:k,onDragStart:U,onDragOver:W,onDragEnd:M,onDragCancel:I,children:[Mt(mr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${x.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:R.map(K=>{let H=gr(K);return Mt(pv,{dayKey:H,isToday:H===r,dayLabel:fv(K),holidayName:v.get(H)??"",summary:m?.(H,L(H)),tasks:$(H),googleEvents:S.get(H)??[],statusOptions:b,onRequestArchiveToggle:j,onRequestReply:c,onAddSchedule:i,canAdd:a,onCardClick:F,onCardContextMenu:u,myAccountSeq:o,avatarSrcByName:s,dragDisabled:d},H)})}),Mt(Z2,{children:V?Mt(mr,{sx:{boxShadow:"0 8px 20px rgba(0,0,0,0.18)",borderRadius:.75,cursor:"grabbing"},children:Mt($o,{task:V,statusOptions:b,onOpenDetail:()=>{},isMine:o>0&&Number(V.manager_account_seq??0)===o})}):null})]})}),Mt(Y2,{anchorEl:D,open:!!D,onClose:()=>P(null),selectedDate:_,onDateChange:K=>{B(Jc(K)),P(null)}}),Mt(Dt,{open:!!A,anchorEl:A?.anchorEl??null,title:A?.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:A?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>j(null),onConfirm:()=>{A&&t(A.taskSeq,A.nextCompleted),j(null)}})]})}import{useCallback as Is,useMemo as ci,useRef as mv,useState as Es}from"react";import{Box as Fr,Button as gv,ButtonBase as nh,IconButton as rh,Tooltip as bv}from"@mui/material";import yv from"@mui/icons-material/Add";import xv from"@mui/icons-material/ChevronLeft";import vv from"@mui/icons-material/ChevronRight";import wv from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as _v}from"@ehfuse/mui-datetime-picker";import{DndContext as kv,DragOverlay as Sv,PointerSensor as Tv,pointerWithin as Cv,rectIntersection as Bv,useDraggable as Iv,useDroppable as oh,useSensor as Ev,useSensors as Mv}from"@dnd-kit/core";import Rv from"@ehfuse/overlay-scrollbar";import{jsx as $t,jsxs as bo}from"react/jsx-runtime";var Ov=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ja="mday-",Qa="mchip-",ih=36;function Av(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(h.getDate()-h.getDay()),h}function el(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(1),h}function Dv(e,h){let b=new Date(e);return b.setDate(b.getDate()+h),b}function Qc(e,h){let b=el(e);return b.setMonth(b.getMonth()+h),b}function Pv({task:e,statusOptions:h,isPreview:b=!1,isMine:l=!1,avatarSrcByName:o,onOpenDetail:s,onContextMenu:r,onRequestToggleCompleted:t,dragDisabled:n=!1}){let{attributes:c,listeners:i,setNodeRef:a,isDragging:d}=Iv({id:String(e.seq),disabled:b||n}),{setNodeRef:f}=oh({id:`${Qa}${e.seq}`,disabled:b||n});return $t(bv,{title:e.title,arrow:!0,enterDelay:400,children:$t($o,{task:e,statusOptions:h,onOpenDetail:s,onContextMenu:r,showCheckbox:!!t,onRequestToggleCompleted:t,isPreview:b,isDragging:d,isMine:l,avatarSrcByName:o,showManagerAvatar:!0,wrapTitle:!0,setNodeRef:u=>{a(u),f(u)},dragProps:n?void 0:{...c,...i}})})}function Nv({dayKey:e,dayNumber:h,isToday:b,isOtherMonth:l,weekday:o,holidayName:s,tasks:r,googleEvents:t,statusOptions:n,previewSeq:c,myAccountSeq:i,avatarSrcByName:a,onRequestToggleCompleted:d,onOpenDetail:f,onTaskContextMenu:u,onAddSchedule:g,canAdd:m,dragDisabled:x=!1}){let _=ct(),B=_.mode==="dark",{setNodeRef:A,isOver:j}=oh({id:`${Ja}${e}`,disabled:x}),D=r,P=!!s||o===0;return bo(Fr,{ref:A,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:j?_.colors.accentSoft:b?_.calendar.todayBg:l?_.calendar.otherMonthBg:_.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...m?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[bo(Fr,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:ih,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:b?_.calendar.todayBg:_.calendar.dateBandBg,borderBottom:`1px solid ${_.calendar.borderColor}`},children:[s?$t(Fr,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:_.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}):null,b?$t(Fr,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:_.colors.danger,color:_.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,$t(Fr,{component:"span",sx:{fontSize:13.5,fontWeight:b?700:400,color:l?_.colors.textMuted:P?_.colors.danger:o===6?_.colors.accentOnSurface:B?_.colors.textStrong:_.colors.textPrimary,flexShrink:0},children:h})]}),t.map(N=>$t(Ni,{event:N,small:!0},N.uid)),D.map(N=>$t(Pv,{task:N,statusOptions:n,isPreview:N.seq===c,isMine:i>0&&Number(N.manager_account_seq??0)===i,avatarSrcByName:a,onRequestToggleCompleted:d,onOpenDetail:f,onContextMenu:u,dragDisabled:x},N.seq)),$t(Fr,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:bo(nh,{className:"taskbox-month-add",onClick:()=>g(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${_.calendar.borderColor}`,bgcolor:_.calendar.cellBg,color:_.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:_.calendar.hoverBg}},children:[$t(yv,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function sh({tasks:e,googleEvents:h=[],statusOptions:b,fallbackToStartDate:l=!1,myAccountSeq:o=0,avatarSrcByName:s,onToggleCompleted:r,todayStr:t,onMoveTask:n,onAddSchedule:c,canAdd:i=!0,disableDrag:a=!1,onOpenDetail:d,onTaskContextMenu:f}){let u=ct(),g=u.mode==="dark",[m,x]=Es(()=>el(new Date)),[_,B]=Es(null),[A,j]=Es(null),[D,P]=Es(null),[N,q]=Es(null),z=ci(()=>{let F=Av(m);return Array.from({length:42},(V,Y)=>Dv(F,Y))},[m]),T=ci(()=>new Map(e.map(F=>[F.seq,F])),[e]),C=ci(()=>Ai(h),[h]),R=ci(()=>[...new Set(z.map(F=>F.getFullYear()))],[z]),p=jn(R),y=ci(()=>{let F=new Map;for(let V of e){let Y=V.due_date.slice(0,10)||(l?V.start_date.slice(0,10)||String(V.created_time??"").slice(0,10):"");if(!Y)continue;let K=F.get(Y);K?K.push(V):F.set(Y,[V])}for(let V of F.values())V.sort(Pi);return F},[e,l]),v=Mv(Ev(Tv,{activationConstraint:{distance:5}})),w=Is(F=>{let V=Cv(F),Y=V.length>0?V:Bv(F),K=Y.filter(H=>String(H.id).startsWith(Qa));return K.length>0?K:Y.filter(H=>String(H.id).startsWith(Ja))},[]),k=Is(F=>{P(Number(F.active.id))},[]),S=Is(F=>{q(F.over?String(F.over.id):null)},[]),E=ci(()=>{let F=new Map;for(let[V,Y]of y)for(let K of Y)F.set(K.seq,V);return F},[y]),L=D!==null?T.get(D)?.due_date.slice(0,10)??"":"",$=ci(()=>{if(D===null||!N)return null;if(N.startsWith(Qa)){let F=Number(N.slice(Qa.length)),V=E.get(F);if(!V)return null;let Y=(y.get(V)??[]).filter(H=>H.seq!==D),K=Y.findIndex(H=>H.seq===F);return{day:V,index:K===-1?Y.length:K}}if(N.startsWith(Ja)){let F=N.slice(Ja.length),V=(y.get(F)??[]).filter(Y=>Y.seq!==D);return{day:F,index:V.length}}return null},[D,E,N,y]),U=Is(F=>{let V=y.get(F)??[];if(D===null||!$)return V;let Y=T.get(D);if(!Y)return V;let K=V.filter(H=>H.seq!==D);return F===$.day?[...K.slice(0,$.index),Y,...K.slice($.index)]:F===L?K:V},[D,L,$,T,y]),O=Is(F=>{let V=D,Y=$;if(P(null),q(null),V===null||!Y)return;let K=(y.get(Y.day)??[]).filter(Z=>Z.seq!==V),H=[...K.slice(0,Y.index).map(Z=>Z.seq),V,...K.slice(Y.index).map(Z=>Z.seq)];n(V,Y.day,H)},[D,$,n,y]),W=D!==null?T.get(D)??null:null,M=`${m.getFullYear()}\uB144 ${m.getMonth()+1}\uC6D4`,I=mv(null);return bo(Fr,{onTouchStart:F=>{let V=F.touches[0];I.current=V?{x:V.clientX,y:V.clientY}:null},onTouchEnd:F=>{let V=I.current;I.current=null;let Y=F.changedTouches[0];if(!V||!Y||D!==null)return;let K=Y.clientX-V.x,H=Y.clientY-V.y;Math.abs(K)<60||Math.abs(K)<=Math.abs(H)||x(Qc(m,K<0?1:-1))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${u.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[bo(Fr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:u.calendar.bg,borderBottom:`1px solid ${u.calendar.borderColor}`,flexShrink:0},children:[bo(Fr,{sx:{display:"flex",alignItems:"center",gap:.25},children:[$t(rh,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>x(Qc(m,-1)),children:$t(xv,{sx:{fontSize:24,color:u.colors.textSecondary}})}),$t(gv,{size:"small",color:"inherit",onClick:()=>x(el(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:u.mode==="dark"?400:500,color:u.mode==="dark"?u.colors.textStrong:u.colors.textPrimary},children:"\uC624\uB298"}),$t(rh,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>x(Qc(m,1)),children:$t(vv,{sx:{fontSize:24,color:u.colors.textSecondary}})})]}),bo(nh,{onClick:F=>B(F.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:u.mode==="dark"?400:700,color:u.mode==="dark"?u.colors.textStrong:u.colors.textPrimary,"&:hover":{bgcolor:u.colors.surfaceHover}},children:[M,$t(wv,{sx:{fontSize:18,color:u.colors.textMuted}})]})]}),$t(Fr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:u.calendar.headerBg,borderBottom:`1px solid ${u.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${u.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Ov.map((F,V)=>$t(Fr,{sx:{height:ih,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:V===0?u.colors.danger:V===6?u.colors.accentOnSurface:u.colors.textSecondary},children:F},F))}),$t(Fr,{sx:{flex:1,minHeight:0},children:bo(kv,{sensors:v,collisionDetection:w,onDragStart:k,onDragOver:S,onDragEnd:O,onDragCancel:()=>{P(null),q(null)},children:[$t(Rv,{style:{height:"100%"},thumb:{width:8},children:$t(Fr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${u.calendar.borderColor}`,borderBottom:`1px solid ${u.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:z.map(F=>{let V=gr(F);return $t(Nv,{dayKey:V,dayNumber:F.getDate(),isToday:V===t,isOtherMonth:F.getMonth()!==m.getMonth(),weekday:F.getDay(),holidayName:p.get(V)??"",tasks:U(V),googleEvents:C.get(V)??[],statusOptions:b,previewSeq:$?.day===V?D:null,myAccountSeq:o,avatarSrcByName:s,onRequestToggleCompleted:r?j:void 0,onOpenDetail:d,onTaskContextMenu:f,onAddSchedule:c,canAdd:i,dragDisabled:a},V)})})}),$t(Sv,{children:W?bo(Fr,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:u.calendar.cellBg,border:`1px solid ${u.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:Li,fontWeight:500,color:u.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[$t(Fr,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:Zc[W.priority]}}),W.title]}):null})]})}),$t(Dt,{open:!!A,anchorEl:A?.anchorEl??null,title:A?.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:A?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>j(null),onConfirm:()=>{A&&r?.(A.taskSeq,A.nextCompleted),j(null)}}),$t(_v,{anchorEl:_,open:!!_,onClose:()=>B(null),selectedDate:m,onDateChange:F=>{x(el(F)),B(null)}})]})}import{useEffect as zv,useMemo as Ms,useRef as tu,useState as ru}from"react";import{Box as Mr,Button as Fv,IconButton as lh,useMediaQuery as qv}from"@mui/material";import $v from"@mui/icons-material/ChevronLeft";import Hv from"@mui/icons-material/ChevronRight";import Wv from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Uv}from"@ehfuse/mui-datetime-picker";import{Box as yo,Button as Lv,Dialog as jv}from"@mui/material";import{jsx as xo,jsxs as eu}from"react/jsx-runtime";function ah({task:e,avatarSrcByName:h,onClose:b}){let l=ct(),o=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 xo(jv,{open:!!e,onClose:b,maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:e?eu(yo,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:l.colors.surface},children:[xo(yo,{sx:{fontSize:15.5,fontWeight:600,color:l.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),o.map(s=>{let r=s.names.filter(t=>!!t);return eu(yo,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[xo(yo,{sx:{width:56,flexShrink:0,fontSize:13.5,color:l.colors.textSecondary,pt:.5},children:s.label}),xo(yo,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:r.length===0?xo(yo,{sx:{fontSize:14,color:l.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):r.map(t=>eu(yo,{sx:{display:"flex",alignItems:"center",gap:.75},children:[xo(fn,{src:h?.get(t)??"",name:t,avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),xo(yo,{sx:{fontSize:14.5,color:l.colors.textPrimary},children:t})]},`${s.label}-${t}`))})]},s.label)}),xo(yo,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:xo(Lv,{size:"small",color:"inherit",onClick:b,children:"\uB2EB\uAE30"})})]}):null})}import{jsx as br,jsxs as Un}from"react/jsx-runtime";var Vv=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function ch(e){let h=e?.parentElement??null;for(;h;){let b=window.getComputedStyle(h);if(/(auto|scroll)/.test(b.overflowY)&&h.scrollHeight>h.clientHeight)return h;h=h.parentElement}return null}var Kv="(min-width:600px)";function nu(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(1),h}function uh(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function dh({tasks:e,googleEvents:h=[],statusOptions:b,todayStr:l,onOpenDetail:o,onAddSchedule:s,myAccountSeq:r=0,avatarSrcByName:t,fallbackToStartDate:n=!1}){let c=ct(),i=qv(Kv),[a,d]=ru(()=>nu(new Date)),[f,u]=ru(!1),g=Ms(()=>{let C=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();return Array.from({length:C},(R,p)=>{let y=new Date(a.getFullYear(),a.getMonth(),p+1);return{ymd:uh(y),dayNumber:p+1,weekday:y.getDay()}})},[a]),m=Ms(()=>{let C=new Map;for(let R of e){let p=R.due_date.slice(0,10)||(n?R.start_date.slice(0,10)||String(R.created_time??"").slice(0,10):"");if(!p)continue;let y=C.get(p);y?y.push(R):C.set(p,[R])}for(let R of C.values())R.sort(Pi);return C},[e,n]),x=Ms(()=>n?e.filter(C=>!C.due_date.slice(0,10)&&!C.start_date.slice(0,10)&&!String(C.created_time??"").slice(0,10)).sort((C,R)=>C.completed!==R.completed?C.completed?1:-1:C.seq-R.seq):[],[e,n]),[_,B]=ru(null),A=Ms(()=>Ai(h),[h]),j=Ms(()=>[a.getFullYear()],[a]),D=jn(j),P=tu(null),N=l.slice(0,7)===uh(a).slice(0,7);zv(()=>{if(!N)return;let C=()=>{let y=P.current,v=ch(y);if(!v||!y)return;let w=y.getBoundingClientRect().top-v.getBoundingClientRect().top+v.scrollTop;v.scrollTop=Math.max(0,w-v.clientHeight/2+y.clientHeight/2)},R=setTimeout(C,100),p=setTimeout(C,400);return()=>{clearTimeout(R),clearTimeout(p)}},[N,a]);let q=tu(null),z=tu(null),T=C=>{d(p=>new Date(p.getFullYear(),p.getMonth()+C,1));let R=ch(q.current);R&&R.scrollTo({top:0,behavior:"auto"})};return Un(Mr,{ref:q,onTouchStart:C=>{let R=C.touches[0];z.current=R?{x:R.clientX,y:R.clientY}:null},onTouchEnd:C=>{let R=z.current;z.current=null;let p=C.changedTouches[0];if(!R||!p)return;let y=p.clientX-R.x,v=p.clientY-R.y;Math.abs(y)<60||Math.abs(y)<=Math.abs(v)||T(y<0?1:-1)},sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:c.colors.surface},children:[Un(Mr,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[br(lh,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>T(-1),children:br($v,{sx:{fontSize:24,color:c.colors.textSecondary}})}),br(Fv,{size:"small",color:"inherit",onClick:()=>d(nu(new Date)),sx:{minWidth:0,px:1,fontSize:15.5,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),br(lh,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>T(1),children:br(Hv,{sx:{fontSize:24,color:c.colors.textSecondary}})}),Un(Mr,{onClick:()=>u(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,cursor:"pointer"},children:[a.getFullYear(),"\uB144 ",a.getMonth()+1,"\uC6D4",br(Wv,{sx:{fontSize:20,color:c.colors.textMuted}})]})]}),Un(Mr,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${c.calendar.borderColor}`},children:[x.length>0?Un(Mr,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${c.calendar.borderColor}`},children:[Un(Mr,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:c.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",br("br",{}),"\uC5C6\uC74C"]}),br(Mr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:x.map(C=>br($o,{task:C,statusOptions:b,onOpenDetail:o,isMine:r>0&&Number(C.manager_account_seq??0)===r,avatarSrcByName:t,showManagerAvatar:!0,onOpenMembers:B},C.seq))})]}):null,g.map(({ymd:C,dayNumber:R,weekday:p})=>{let y=D.get(C)??"",v=C===l,w=!!y||p===0,k=m.get(C)??[],S=A.get(C)??[],E=k.length>0||S.length>0;return Un(Mr,{ref:v?P:void 0,onClick:s?()=>s(C):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:E?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${c.calendar.borderColor}`,...s?{cursor:"pointer"}:{}},children:[br(Mr,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:Un(Mr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.25,"@media (min-width:600px)":{flexDirection:"row",gap:.75}},children:[br(Mr,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:40,height:32,borderRadius:1,px:1.25,fontSize:22,fontWeight:500,color:v?c.colors.surface:w?c.colors.danger:p===6?c.colors.accentOnSurface:c.colors.textPrimary,bgcolor:v?c.colors.accentOnSurface:"transparent"},children:R}),br(Mr,{component:"span",sx:{fontSize:13,color:w?c.colors.danger:p===6?c.colors.accentOnSurface:c.colors.textSecondary},children:Vv[p]})]})}),Un(Mr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[S.map(L=>br(Ni,{event:L},L.uid)),k.map(L=>{let $=Di(L),U=br($o,{task:L,statusOptions:b,onOpenDetail:o,isMine:r>0&&Number(L.manager_account_seq??0)===r,avatarSrcByName:t,showManagerAvatar:!0,onOpenMembers:B,showTime:!i,wrapTitle:!0},L.seq);return i?Un(Mr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[br(Mr,{component:"span",sx:{width:44,flexShrink:0,textAlign:"right",fontSize:13.5,fontWeight:400,opacity:1,color:$?L.completed?c.colors.textPrimary:c.colors.danger:"transparent"},children:$||"00:00"}),br(Mr,{sx:{flex:1,minWidth:0},children:U})]},L.seq):U})]})]},C)})]}),br(ah,{task:_,avatarSrcByName:t,onClose:()=>B(null)}),br(Uv,{open:f,centered:!0,monthOnly:!0,onClose:()=>u(!1),selectedDate:a,onDateChange:C=>{d(nu(C)),u(!1)}})]})}import{useCallback as fh,useEffect as hh,useMemo as ou,useRef as rl,useState as nl}from"react";import{Box as ir,Tooltip as gh}from"@mui/material";import Gv from"@ehfuse/overlay-scrollbar";import Yv from"@mui/icons-material/CheckCircle";import Xv from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as Zv,PointerSensor as Jv,closestCenter as Qv,useSensor as ew,useSensors as tw}from"@dnd-kit/core";import{SortableContext as rw,arrayMove as nw,useSortable as ow,verticalListSortingStrategy as iw}from"@dnd-kit/sortable";import sw from"@mui/icons-material/DragIndicator";import{jsx as Gt,jsxs as Ho}from"react/jsx-runtime";var iu=36,aw=48,ph=40,lw=24,cw=4,uw=14,mh=36,dw=12.5,ji=220,fw={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function ui(e){let h=String(e??"").trim();if(!h)return null;let b=new Date(`${h}T00:00:00`);return Number.isNaN(b.getTime())?null:b}function tl(e,h){let b=new Date(e);return b.setDate(b.getDate()+h),b}function su(e,h){return Math.round((h.getTime()-e.getTime())/864e5)}function hw({task:e,dragHandle:h,onPointerDown:b,onClick:l}){let o=ct(),s=rl(null),[r,t]=nl("");return Gt(gh,{title:r,arrow:!0,enterDelay:300,children:Ho(ir,{onPointerDown:b,onClick:n=>l(e,n),onMouseEnter:()=>{let n=s.current;t(n&&n.scrollWidth>n.clientWidth?e.title:"")},sx:{width:ji,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:o.timeline.bg,borderRight:`1px solid ${o.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:o.mode==="dark"||e.completed?400:500,color:e.completed?o.colors.textMuted:o.mode==="dark"?o.colors.textStrong:o.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:o.colors.surfaceHover}},children:[h,Gt(ir,{ref:s,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function pw({id:e,showIndicator:h,children:b}){let l=ct(),{attributes:o,listeners:s,setNodeRef:r}=ow({id:e});return Ho(ir,{ref:r,sx:{position:"relative"},children:[h?Gt(ir,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:l.colors.accentOnSurface,zIndex:5}}):null,b({...o,...s})]})}function bh({tasks:e,todayStr:h,onOpenDetail:b,onToggleChecklist:l,onReorderTasks:o,onTaskContextMenu:s}){let r=ct(),t=ou(()=>[...e].sort((R,p)=>{let y=(R.timeline_sort_no??0)>0,v=(p.timeline_sort_no??0)>0;if(y&&v)return(R.timeline_sort_no??0)-(p.timeline_sort_no??0);if(y!==v)return y?-1:1;let w=R.due_date||R.start_date,k=p.due_date||p.start_date;return w!==k?w<k?-1:1:R.seq-p.seq}),[e]),[n,c]=nl(null),[i,a]=nl(null),d=tw(ew(Jv,{activationConstraint:{distance:4}})),f=fh(R=>{c(R.over?Number(R.over.id):null)},[]),u=fh(R=>{c(null),a(null);let{active:p,over:y}=R;if(!y||p.id===y.id)return;let v=t.map(S=>S.seq),w=v.indexOf(Number(p.id)),k=v.indexOf(Number(y.id));w===-1||k===-1||o(nw(v,w,k))},[t,o]),g=ou(()=>{let R=ui(h)??new Date,p=R,y=tl(R,21);for(let k of t){let S=ui(k.start_date)??ui(k.due_date),E=ui(k.due_date)??S;S&&S<p&&(p=S),E&&E>y&&(y=E)}let v=tl(p,-3),w=su(v,tl(y,3))+1;return Array.from({length:w},(k,S)=>tl(v,S))},[t,h]),m=g[0],x=g.findIndex(R=>gr(R)===h),{dayWidths:_,dayOffsets:B,gridWidth:A}=ou(()=>{let R=g.map((v,w)=>v.getDate()===1||w===0?aw:iu),p=[],y=0;for(let v of R)p.push(y),y+=v;return{dayWidths:R,dayOffsets:p,gridWidth:y}},[g]),j=ji+A,D=rl(null),P=R=>{D.current={x:R.clientX,y:R.clientY}},N=(R,p)=>{let y=D.current;D.current=null,!(y&&(Math.abs(p.clientX-y.x)>5||Math.abs(p.clientY-y.y)>5))&&b(R)},q=rl(null),[z,T]=nl(!1);hh(()=>{let R=q.current?.getScrollContainer();if(!R)return;let p=()=>T(R.scrollHeight>R.clientHeight);p();let y=new ResizeObserver(p);return y.observe(R),()=>y.disconnect()},[t.length]);let C=rl(!1);return hh(()=>{if(t.length===0||C.current)return;C.current=!0;let R=window.requestAnimationFrame(()=>{let p=q.current?.getScrollContainer();!p||x<0||(p.scrollLeft=Math.max(0,B[x]-iu*3))});return()=>window.cancelAnimationFrame(R)},[t.length]),Gt(ir,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${r.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:r.timeline.headerBg},children:Gt(ir,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:Gt(Gv,{ref:q,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:Ho(ir,{sx:{width:j,position:"relative",bgcolor:r.timeline.bg},children:[Ho(ir,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:r.timeline.headerBg,borderBottom:`1px solid ${r.timeline.gridColor}`},children:[Gt(ir,{sx:{width:ji,height:mh,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:r.timeline.headerBg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:r.colors.textSecondary},children:"\uC81C\uBAA9"}),g.map((R,p)=>{let y=R.getDay(),v=p===x,w=R.getDate()===1||p===0;return Gt(ir,{sx:{width:_[p],height:mh,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:dw,fontWeight:v&&r.mode!=="dark"?700:400,color:v?r.timeline.bg:y===0?r.colors.danger:y===6?r.colors.accentOnSurface:r.colors.textSecondary,bgcolor:v?r.colors.danger:"transparent",borderRight:`1px solid ${r.timeline.gridColor}`,whiteSpace:"nowrap"},children:w?`${R.getMonth()+1}/${R.getDate()}`:R.getDate()},gr(R))})]}),Gt(Zv,{sensors:d,collisionDetection:Qv,onDragStart:R=>a(Number(R.active.id)),onDragOver:f,onDragEnd:u,onDragCancel:()=>{c(null),a(null)},children:Gt(rw,{items:t.map(R=>String(R.seq)),strategy:iw,children:Ho(ir,{sx:{position:"relative"},children:[g.map((R,p)=>{let y=R.getDay(),v=p===x;return!v&&y!==0&&y!==6?null:Gt(ir,{sx:{position:"absolute",top:0,bottom:0,left:ji+B[p],width:_[p],bgcolor:v?"rgba(229,72,77,0.07)":r.colors.surfaceSubtle,zIndex:0}},`stripe-${gr(R)}`)}),t.map((R,p)=>{let y=ui(R.start_date)??ui(R.due_date),v=ui(R.due_date)??y,w=y?Math.min(g.length-1,Math.max(0,su(m,y))):0,k=v?Math.min(g.length-1,Math.max(w,su(m,v))):w,S=fw[R.priority],E=ji+B[w]+2,L=B[k]+_[k]-B[w]-4,$=R.checklist??[];return Gt(pw,{id:String(R.seq),showIndicator:n===R.seq&&i!==R.seq,children:U=>Ho(ir,{sx:{borderBottom:p===t.length-1&&z?"none":`1px solid ${r.timeline.gridColor}`,position:"relative",zIndex:1,opacity:i===R.seq?.45:1},children:[Ho(ir,{onContextMenu:O=>s(R,O),sx:{display:"flex",height:ph,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[Gt(hw,{task:R,dragHandle:Gt(ir,{component:"span",className:"taskbox-timeline-handle",...U,onClick:O=>O.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:r.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:r.colors.accentOnSurface}},children:(()=>{let O=(R.is_notice||R.is_event?wt(R.icon||(R.is_notice?or:ar)):null)??sw;return Gt(O,{sx:{fontSize:17}})})()}),onPointerDown:P,onClick:N}),Gt(gh,{title:`${R.title} (${R.start_date||"?"} ~ ${R.due_date||"?"})`,arrow:!0,enterDelay:300,children:Gt(ir,{onPointerDown:P,onClick:O=>N(R,O),sx:{position:"absolute",top:(ph-20)/2,left:E,width:Math.max(iu-4,L),height:20,borderRadius:1,bgcolor:S.bg,border:`1px solid ${S.border}`,opacity:R.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),$.map((O,W)=>Gt(ir,{sx:{display:"flex",height:lw,position:"relative",mt:W===0?`${cw}px`:0,mb:W===$.length-1?`${uw}px`:0},children:Gt(ir,{sx:{width:ji,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:O.checked?r.colors.textMuted:r.colors.textPrimary},children:Ho(ir,{onClick:()=>l(R.seq,W,!O.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[O.checked?Gt(Yv,{sx:{fontSize:17,color:r.colors.accentOnSurface,flexShrink:0}}):Gt(Xv,{sx:{fontSize:17,color:r.colors.textMuted,flexShrink:0}}),Gt(ir,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:O.checked?"line-through":"none"},children:O.label})]})})},`${R.seq}-check-${W}`))]})},R.seq)}),t.length===0?Gt(ir,{sx:{py:8,textAlign:"center",color:r.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as di}from"react/jsx-runtime";function UO(e){switch(e.view){case"card":case"kanban":{let{view:h,...b}=e;return di(Uc,{...b,columnAxis:h==="kanban"?"status":"project"})}case"sprint":{let{view:h,...b}=e;return di(Uc,{...b,columnAxis:"sprint"})}case"calendar":{let{view:h,...b}=e;return di(th,{...b})}case"month":{let{view:h,...b}=e;return di(sh,{...b})}case"agenda":{let{view:h,...b}=e;return di(dh,{...b})}case"timeline":{let{view:h,...b}=e;return di(bh,{...b})}default:{let{view:h,...b}=e;return di(Of,{...b})}}}var VO=["list","card","kanban","calendar","month","timeline"];import{Box as sn}from"@mui/material";import{Fragment as mw,jsx as fi,jsxs as Vn}from"react/jsx-runtime";function yh(e,h){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return null;let b=new Date(`${e}T00:00:00`),l=new Date(`${h}T00:00:00`);return Math.round((b.getTime()-l.getTime())/864e5)}function xh({tasks:e,todayStr:h,showProgress:b=!0,dday:l=null,workdaysLeft:o=null,showPoints:s=!0,showHours:r=!0,showOverdue:t=!0,showInfo:n=!0,inline:c=!1}){let i=ct(),a=e.filter(P=>!P.archived),d=a.filter(P=>P.completed).length,f=a.length>0?Math.round(d/a.length*100):0,u=a.filter(P=>!P.completed&&!P.is_event&&!!P.due_date&&P.due_date.slice(0,10)<h).length,g=a.reduce((P,N)=>N.completed?P:P+(N.story_points??0),0),m=b?fi(sn,{sx:{flex:c?"0 0 110px":"1 1 auto",minWidth:0,height:i.summary.gaugeHeight,borderRadius:3,bgcolor:i.summary.gaugeTrackColor},children:fi(sn,{sx:{height:"100%",borderRadius:3,width:`${f}%`,bgcolor:f>=100?i.summary.gaugeCompleteColor:i.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,x=b?Vn(sn,{component:"span",sx:{flexShrink:0,fontSize:c?14:13,color:i.summary.textColor},children:[f,"%"]}):null,_={color:i.summary.numberColor,fontWeight:700,fontSize:c?15:14},B=a.length-d,A=Vn(mw,{children:[c?null:Vn("span",{children:["\uB0A8\uC740 ",fi(sn,{component:"span",sx:_,children:B}),"\uAC74"]}),t&&u>0?Vn(sn,{component:"span",sx:{color:i.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",fi(sn,{component:"span",sx:{fontWeight:700,fontSize:c?15:14},children:u}),"\uAC74"]}):null,s&&g>0?Vn("span",{children:[fi(sn,{component:"span",sx:_,children:g}),"SP"]}):null]}),j=typeof o=="number"&&Number.isFinite(o)?Vn("span",{children:["\uADFC\uBB34\uC77C ",fi(sn,{component:"span",sx:_,children:o}),"\uC77C"]}):null,D=typeof l=="number"&&Number.isFinite(l)?fi(sn,{component:"span",sx:{ml:c?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:i.summary.overdueColor,color:i.colors.textInverse,lineHeight:1.6},children:l===0?"D-day":l>0?`D-${l}`:`D+${-l}`}):null;return c?Vn(sn,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:i.summary.textColor,whiteSpace:"nowrap",...i.summary.sx},children:[n?A:null,n?j:null,n?D:null,m,x]}):Vn(sn,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[b?Vn(sn,{sx:{display:"flex",alignItems:"center",gap:1},children:[m,x]}):null,Vn(sn,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:i.summary.textColor},children:[A,j,D]})]})}import{useMemo as bw}from"react";function gw(e){let h=String(e??"").trim();if(!h)return 0;let b=0,l=!1;for(let o of h.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let s=parseFloat(o[1]),r=o[2].toLowerCase();l=!0,r==="m"||r==="\uBD84"?b+=s/60:r==="d"||r==="\uC77C"?b+=s*8:b+=s}if(!l){let o=parseFloat(h);Number.isFinite(o)&&(b+=o)}return b}function QO(e){let h=Math.round(e*10)/10;return`${h%1===0?h.toFixed(0):h.toFixed(1)}\uC2DC\uAC04`}function vh(e,h,b){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return 0;let l=new Date(`${e}T00:00:00`),o=new Date(`${h}T00:00:00`);if(o<l||o.getTime()-l.getTime()>3660*864e5)return 0;let s=0;for(let r=new Date(l);r<=o;r.setDate(r.getDate()+1)){let t=r.getDay();if(t===0||t===6)continue;let n=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`;b.has(n)||(s+=1)}return s}function eA(e){return e.reduce((h,b)=>b.completed?h:h+gw(b.estimated_time),0)}import{jsx as yw}from"react/jsx-runtime";function sA({sprint:e,tasks:h,todayStr:b,...l}){let o=e.status==="closed"?null:yh(e.end_date,b),s=o!==null&&o>=0,r=bw(()=>{if(!s)return[];let c=Number(b.slice(0,4)),i=Number(e.end_date.slice(0,4))||c,a=[];for(let d=c;d<=Math.max(c,i);d+=1)a.push(d);return a},[s,b,e.end_date]),t=jn(r),n=s?vh(b,e.end_date,new Set(t.keys())):null;return yw(xh,{tasks:h,todayStr:b,dday:o,workdaysLeft:n,...l})}import{useEffect as Iw,useRef as Ew,useState as Mw}from"react";import{Box as lu}from"@mui/material";import{Children as xw}from"react";import{Box as au,CircularProgress as vw}from"@mui/material";import{jsx as ol}from"react/jsx-runtime";var wh={xs:2,md:3};function _h(){return ol(au,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:ol(vw,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function kh({children:e}){return ol(au,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:wh,pb:wh},children:xw.map(e,h=>h==null||h===!1?null:ol(au,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:h}))})}import{Box as wo,Button as Sw,Checkbox as Tw,Typography as Wo}from"@mui/material";import Th from"@mui/icons-material/CheckCircle";import Cw from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as kw,jsx as Sh}from"react/jsx-runtime";var ww="taskbox-search-highlight";function _w(e,h){let b=h?.keyPrefix??"hl";return e.map((l,o)=>Sh("span",{className:l.highlight?h?.highlightClassName??ww:h?.className,style:l.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:l.text},`${b}-${l.text}-${o}`))}function il({text:e,keyword:h,fallback:b="-",className:l,highlightClassName:o,keyPrefix:s}){let r=String(e??"").trim()||b,t=Da(r,h);return Sh(kw,{children:_w(t,{className:l,highlightClassName:o,keyPrefix:s})})}import{jsx as _t,jsxs as zi}from"react/jsx-runtime";var Bw={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:kr(12.5),fontWeight:500,lineHeight:1.4},vo={fontSize:kr(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function Kn({label:e,children:h}){return zi(wo,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[_t(wo,{sx:Bw,children:e}),_t(wo,{sx:{...vo,flex:1,pt:.2},children:h})]})}function Ch({task:e,statusOptions:h,projectLabel:b,searchText:l,todayStr:o,dimCompleted:s=!0,onRequestToggleCompleted:r,onOpenDetail:t,onTaskContextMenu:n,targetSummary:c="",ackInfo:i,completeLocked:a=!1,unread:d=!1,noticeReadOnly:f=!1,onAckConfirm:u,onAckListClick:g,myManaged:m=!1}){let x=e.is_event?vs(e):lr(e),_=String(e.due_date??"").slice(11,16),B=e.is_event?String(e.event_time??"").trim():/^\d{2}:\d{2}$/.test(_)?_:String(e.estimated_time??"").trim(),A=hn(e.start_date),j=hn(e.due_date),D=A&&B&&!j?`${A} ${B}`:A,P=j&&B?`${j} ${B}`:j,N=!e.is_notice&&!e.is_event&&!String(e.due_date??"").trim(),q=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<o,z=(e.receiver_names??[]).filter(Boolean);return zi(wo,{role:"button",tabIndex:0,onClick:()=>t(e),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),t(e))},onContextMenu:T=>n(e,T),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",opacity:N?.6:1,position:"relative"},children:[m?_t(wo,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,zi(wo,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[e.is_event?(()=>{let T=wt(e.icon||ar);return T?_t(T,{sx:{fontSize:21,flexShrink:0,mt:.2,color:e.icon_color||"#1e3a8a"}}):null})():!f&&!a?_t(Tw,{checked:e.completed,icon:_t(Cw,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:_t(Th,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:T=>T.stopPropagation(),onChange:(T,C)=>r({anchorEl:T.currentTarget,taskSeq:e.seq,nextCompleted:C}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{if(!e.is_notice)return null;let T=wt(e.icon||or);return T?_t(T,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:e.icon_color||"#e5484d"}}):null})(),_t(Wo,{sx:{fontSize:kr(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed&&s?"#9a9a97":N?"#5f5e5b":"#111827",textDecoration:e.completed&&s?"line-through":"none"},children:_t(il,{text:e.title,keyword:l})}),d&&!e.completed?_t(wo,{component:"span",sx:{flexShrink:0,px:.55,fontSize:kr(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),zi(wo,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[_t(Kn,{label:x?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:zi(wo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1.25},children:[x?_t(At,{option:x,small:!0}):null,_t(Lr,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?_t(Kn,{label:"\uB77C\uBCA8",children:_t(No,{labelKeys:e.label_keys,labelOptions:h})}):null,b?_t(Kn,{label:"\uD504\uB85C\uC81D\uD2B8",children:_t(Wo,{sx:vo,children:b})}):null,D?_t(Kn,{label:"\uC2DC\uC791",children:_t(Wo,{sx:vo,children:D})}):null,P?_t(Kn,{label:"\uB9C8\uAC10",children:zi(Wo,{sx:{...vo,color:q?"#e5484d":vo.color,fontWeight:q?600:400},children:[P,q?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?_t(Kn,{label:"\uB300\uC0C1\uC790",children:_t(Wo,{sx:vo,children:c||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&i?_t(Kn,{label:"\uD655\uC778",children:_t(Sw,{size:"small",variant:i.canAck?"contained":"outlined",color:"inherit",startIcon:i.acked?_t(Th,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:T=>{T.stopPropagation(),i.canAck?u?.(e):g?.(e,T.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:kr(13),...i.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:i.canAck?"\uD655\uC778":`${i.count}/${i.total}`})}):null,!e.is_notice&&e.manager_name?_t(Kn,{label:"\uCC45\uC784\uC790",children:_t(Wo,{sx:vo,children:_t(il,{text:e.manager_name,keyword:l})})}):null,!e.is_notice&&z.length>0?_t(Kn,{label:"\uCC38\uC870\uC790",children:_t(Wo,{sx:vo,children:z.join(", ")})}):null,e.note?_t(Kn,{label:"\uBE44\uACE0",children:_t(Wo,{sx:vo,children:_t(il,{text:e.note,keyword:l})})}):null]})]})}import{jsx as Fi,jsxs as Rw}from"react/jsx-runtime";function AA({tasks:e,statusOptions:h,customTabs:b,loading:l,dimCompleted:o=!0,searchText:s,todayStr:r,onToggleCompleted:t,onOpenDetail:n,onTaskContextMenu:c,getTargetSummary:i,getAckInfo:a,getNoticeReadOnly:d,isTaskUnread:f,getCompleteLocked:u,onAckConfirm:g,onAckListClick:m,onEndReached:x,myAccountSeq:_=0}){let B=new Map(b.map(P=>[P.key,P.label])),[A,j]=Mw(null),D=Ew(null);return Iw(()=>{let P=D.current;if(!x||!P)return;let N=new IntersectionObserver(q=>{q[0]?.isIntersecting&&x()});return N.observe(P),()=>N.disconnect()},[x,e.length]),e.length===0?l?Fi(_h,{}):Fi(lu,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Rw(lu,{sx:{minWidth:0},children:[Fi(kh,{children:e.map(P=>Fi(Ch,{dimCompleted:o,myManaged:_>0&&!P.is_notice&&!P.is_event&&(P.manager_account_seq??0)===_,task:P,statusOptions:h,projectLabel:P.tab_key?B.get(P.tab_key)??"":"",searchText:s,todayStr:r,onRequestToggleCompleted:j,onOpenDetail:n,onTaskContextMenu:c,targetSummary:P.is_notice?i?.(P):void 0,ackInfo:P.is_notice?a?.(P):void 0,noticeReadOnly:P.is_notice?d?.(P):!1,unread:f?.(P)??!1,completeLocked:u?.(P)??!1,onAckConfirm:g,onAckListClick:m},P.seq))}),x?Fi(lu,{ref:D,sx:{height:"1px"}}):null,Fi(Dt,{open:!!A,anchorEl:A?.anchorEl??null,title:A?.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:A?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>j(null),onConfirm:()=>{A&&t(A.taskSeq,A.nextCompleted),j(null)}})]})}import{useState as Rs}from"react";import{Box as er,Checkbox as Ow,Menu as Aw,MenuItem as Bh,Tooltip as Dw}from"@mui/material";import Pw from"@mui/icons-material/CheckCircle";import Nw from"@mui/icons-material/CheckCircleOutlineOutlined";import Lw from"@mui/icons-material/NotesOutlined";import jw from"@mui/icons-material/AutorenewOutlined";import zw from"@mui/icons-material/CalendarTodayOutlined";import Fw from"@mui/icons-material/EventOutlined";import qw from"@mui/icons-material/PersonOutlineOutlined";import $w from"@mui/icons-material/PeopleAltOutlined";import Hw from"@mui/icons-material/StickyNote2Outlined";import{Fragment as Vw,jsx as mt,jsxs as Uo}from"react/jsx-runtime";var cu={completed:{label:"\uC644\uB8CC",width:"44px",align:"center",icon:null},title:{label:"\uC81C\uBAA9",width:"1fr",align:"left",icon:mt(Lw,{sx:{fontSize:15}})},manager_name:{label:"\uCC45\uC784\uC790",width:"112px",align:"center",icon:mt(qw,{sx:{fontSize:15}})},receiver_names:{label:"\uCC38\uC870\uC790",width:"120px",align:"center",icon:mt($w,{sx:{fontSize:15}})},status:{label:"\uC0C1\uD0DC",width:"104px",align:"center",icon:mt(jw,{sx:{fontSize:15}})},priority:{label:"\uC911\uC694\uB3C4",width:"88px",align:"center",icon:null},start_date:{label:"\uC2DC\uC791\uC77C\uC2DC",width:"110px",align:"center",icon:mt(zw,{sx:{fontSize:15}})},due_date:{label:"\uB9C8\uAC10\uC77C\uC2DC",width:"110px",align:"center",icon:mt(Fw,{sx:{fontSize:15}})},note:{label:"\uBE44\uACE0",width:"1fr",align:"left",icon:mt(Hw,{sx:{fontSize:15}})}},Ww=[{id:"completed"},{id:"title"},{id:"manager_name"},{id:"due_date"},{id:"status"}],Uw=new Set(["manager_name","status","due_date"]);function Ih(e){let h=String(e??"").trim();return h?h.slice(2,10).replaceAll("-","."):""}function iD(e,h){return h>0?e.filter(b=>!b.is_notice&&!b.completed&&!b.archived&&kn(b)==="group"&&Number(b.visibility_group_seq??0)===h).sort((b,l)=>{let o=String(b.due_date??"").trim(),s=String(l.due_date??"").trim();return o!==s?o?s?o.localeCompare(s):-1:1:Number(b.seq)-Number(l.seq)}):[]}function sD({tasks:e,columns:h=Ww,loading:b=!1,emptyText:l="\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",myAccountSeq:o=0,avatarSrcByName:s,managerCandidates:r=[],canAssignManager:t,onOpenDetail:n,onToggleCompleted:c,onChangeStatus:i,onChangeDueDate:a,onChangeReminder:d,onChangeManager:f,onClaimTask:u}){let g=ct(),[m,x]=Rs(null),[_,B]=Rs(null),[A,j]=Rs(null),[D,P]=Rs(null),[N,q]=Rs(null),z=h.map(R=>R.width??cu[R.id].width).join(" "),T=(R,p)=>mt(fn,{src:s?.get(R)??"",name:R,avatarSx:{width:p,height:p,fontSize:Math.round(p/2),flexShrink:0,borderRadius:"50%"},iconFontSize:Math.round(p*.6)}),C=(R,p)=>{let v=cu[R.id].align==="center";switch(R.id){case"completed":if(p.is_event){let w=wt(p.icon||ar);return mt(er,{className:"cell",sx:{justifyContent:"center"},children:w?mt(w,{sx:{fontSize:19,color:p.icon_color||"#1e3a8a"}}):null},R.id)}return mt(er,{className:"cell",sx:{justifyContent:"center",...c?{"&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:mt(Dw,{title:p.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,children:mt(Ow,{checked:!!p.completed,icon:mt(Nw,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:mt(Pw,{sx:{fontSize:20,color:"#2f80ed"}}),onChange:w=>P({anchorEl:w.currentTarget,task:p}),sx:{p:.5}})})},R.id);case"title":{let w=p.is_notice?wt(p.icon||or):null,k=p.icon_color||"#e5484d";return Uo(er,{className:"cell",onClick:()=>n(p),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}},children:[w?mt(w,{sx:{fontSize:18,flexShrink:0,color:k}}):null,mt(er,{component:"span",sx:{fontSize:14.5,fontWeight:g.table.rowTitleFontWeight,color:g.table.rowTitleColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.title||"(\uC81C\uBAA9 \uC5C6\uC74C)"})]},R.id)}case"manager_name":{let w=t?t(p):!1,k=o>0&&Number(p.manager_account_seq??0)===o;return w&&f?Uo(er,{className:"cell",onClick:S=>j({anchorEl:S.currentTarget,task:p}),sx:{gap:.75,justifyContent:"center",cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}},children:[p.manager_name?T(p.manager_name,22):null,mt(er,{component:"span",sx:{fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.manager_name||""})]},R.id):mt(er,{className:"cell",sx:{gap:.75,justifyContent:"center"},children:p.manager_name?Uo(Vw,{children:[T(p.manager_name,22),mt(er,{component:"span",sx:{fontSize:14,fontWeight:k?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.manager_name})]}):u?mt(Ln,{onClick:S=>q({anchorEl:S.currentTarget,taskSeq:Number(p.seq)}),children:"\uAC00\uC838\uAC00\uAE30"}):null},R.id)}case"receiver_names":return mt(er,{className:"cell",sx:{justifyContent:"center",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(p.receiver_names??[]).join(", ")},R.id);case"status":return mt(er,{className:"cell",onClick:i?w=>x({anchorEl:w.currentTarget,task:p}):void 0,sx:{py:.5,justifyContent:"center",...i?{cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:mt(At,{option:lr(p)})},R.id);case"priority":return mt(er,{className:"cell",sx:{justifyContent:"center"},children:mt(Lr,{priority:p.priority,plain:!0})},R.id);case"start_date":return mt(er,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14},children:Ih(p.start_date)},R.id);case"due_date":return mt(er,{className:"cell",onClick:a?w=>B({anchorEl:w.currentTarget,taskSeq:Number(p.seq),date:String(p.due_date??"").slice(0,10),reminders:zn(p)}):void 0,sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14,...a?{cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:Ih(p.due_date)},R.id);case"note":return mt(er,{className:"cell",sx:{justifyContent:v?"center":"flex-start",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.note||""},R.id);default:return null}};return Uo(er,{sx:{border:`1px solid ${g.table.borderColor}`,borderRadius:1,overflow:"hidden",bgcolor:g.table.bg,color:g.table.rowColor},children:[mt(er,{sx:{display:"grid",gridTemplateColumns:z,borderBottom:`1px solid ${g.table.borderColor}`,bgcolor:g.table.headerBg,"& > *":{display:"flex",alignItems:"center",gap:.5,px:1,py:1,minWidth:0,fontSize:g.table.headerFontSize,whiteSpace:"nowrap",userSelect:"none",borderRight:`1px solid ${g.table.rowBorderColor}`},"& > *:first-of-type":{px:.5},"& > *:last-child":{borderRight:"none",pr:2}},children:h.map(R=>{let p=cu[R.id];return Uo(er,{sx:{justifyContent:p.align==="center"?"center":"flex-start",color:Uw.has(R.id)?g.table.headerActiveColor:g.table.headerColor},children:[p.icon,R.label??p.label]},R.id)})}),b?mt(er,{sx:{py:3,textAlign:"center",color:g.table.emptyColor,fontSize:14},children:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"}):e.length===0?mt(er,{sx:{py:3,textAlign:"center",color:g.table.emptyColor,fontSize:14},children:l}):e.map((R,p)=>mt(er,{sx:{display:"grid",gridTemplateColumns:z,minHeight:44,fontSize:15,bgcolor:g.table.rowBg,borderTop:p===0?"none":`1px solid ${g.table.rowBorderColor}`,"&:hover":{bgcolor:g.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${g.table.rowBorderColor}`},"& > .cell:first-of-type":{px:.5},"& > .cell:last-child":{borderRight:"none",pr:2}},children:h.map(y=>C(y,R))},R.seq)),mt(Ei,{anchorEl:m?.anchorEl??null,value:String(m?.task.status??""),options:m?Ba(m.task):void 0,onSelect:R=>{m&&i?.(Number(m.task.seq),R),x(null)},onClose:()=>x(null)}),Uo(Aw,{anchorEl:A?.anchorEl??null,open:!!A,onClose:()=>j(null),transitionDuration:0,children:[Uo(Bh,{onClick:()=>{A&&f?.(Number(A.task.seq),"",0),j(null)},sx:{fontSize:14,minWidth:170,gap:1,color:g.table.headerColor},children:[mt(er,{sx:{width:24,flexShrink:0}}),"\uC9C0\uC815 \uC548 \uD568"]}),r.map(R=>Uo(Bh,{selected:Number(A?.task.manager_account_seq??0)===Number(R.account_seq??0),onClick:()=>{A&&f?.(Number(A.task.seq),R.name,Number(R.account_seq??0)),j(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[T(R.name,24),R.name,R.role_name?mt(er,{component:"span",sx:{color:g.table.headerColor,fontSize:13},children:R.role_name}):null]},R.seq))]}),mt(pn,{anchorEl:_?.anchorEl??null,open:!!_,date:_?.date??"",reminders:_?.reminders??[],hideReminder:!d,onClose:()=>B(null),onDateChange:R=>{_&&(a?.(_.taskSeq,R),B(p=>p?{...p,date:R}:null))},onReminderChange:R=>{_&&(d?.(_.taskSeq,R),B(p=>p?{...p,reminders:R}:null))}}),mt(Dt,{open:!!D,anchorEl:D?.anchorEl??null,title:D?.task.completed?"\uC644\uB8CC\uB97C \uD574\uC81C\uD560\uAE4C\uC694?":"\uC644\uB8CC \uCC98\uB9AC\uD560\uAE4C\uC694?",confirmText:D?.task.completed?"\uD574\uC81C":"\uC644\uB8CC",onCancel:()=>P(null),onConfirm:()=>{D&&c?.(D.task,!D.task.completed),P(null)}}),mt(Dt,{open:!!N,anchorEl:N?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uB97C \uB9E1\uC744\uAE4C\uC694?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>q(null),onConfirm:()=>{N&&u?.(N.taskSeq),q(null)}})]})}var Os=[{value:"daily",label:"\uB9E4\uC77C"},{value:"weekly",label:"\uB9E4\uC8FC"},{value:"monthly",label:"\uB9E4\uC6D4"},{value:"yearly",label:"\uB9E4\uB144"}];function sl(e){return Os.find(h=>h.value===e)?.label??"\uC5C6\uC74C"}function Kw(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let h=new Date(`${e}T00:00:00`);return Number.isNaN(h.getTime())?null:h}function al(e,h){let b=Kw(e);if(!b)return"";let l=new Date(b);h==="daily"?l.setMonth(l.getMonth()+1):h==="weekly"?l.setMonth(l.getMonth()+3):h==="monthly"?l.setFullYear(l.getFullYear()+1):l.setFullYear(l.getFullYear()+3);let o=s=>String(s).padStart(2,"0");return`${l.getFullYear()}-${o(l.getMonth()+1)}-${o(l.getDate())}`}function Gw(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}function Eh(e,h){let b=String(e??"").slice(0,10);if(!Gw(b)||typeof h!="number"||!Number.isFinite(h))return"";let l=new Date(`${b}T12:00:00`);l.setDate(l.getDate()+Math.trunc(h));let o=l.getFullYear(),s=String(l.getMonth()+1).padStart(2,"0"),r=String(l.getDate()).padStart(2,"0");return`${o}-${s}-${r}`}function Yw(e,h,b){return{title:String(e.title??"").trim(),content:String(e.content??""),start_date:Eh(h,e.start_offset_days),due_date:Eh(h,e.due_offset_days),priority:e.priority??"medium",label_keys:[...e.label_keys??[]],manager_account_seq:Number(e.manager_account_seq)||0,manager_name:String(e.manager_name??""),checklist:(e.checklist??[]).map(l=>String(l??"").trim()).filter(l=>l.length>0).map(l=>({label:l,checked:!1})),group_seq:b}}function Mh(e,h){let b=Number(e.group_seq)||0;return(e.items??[]).map(l=>Yw(l,h,b)).filter(l=>l.title.length>0)}function uD(e){return typeof e!="number"||!Number.isFinite(e)?"-":e===0?"\uAE30\uC900\uC77C":e>0?`\uAE30\uC900\uC77C +${Math.trunc(e)}\uC77C`:`\uAE30\uC900\uC77C ${Math.trunc(e)}\uC77C`}import{useEffect as v5,useRef as w5,useState as dp}from"react";import{Box as ko,Button as Eu,ButtonBase as _5,Divider as fp,Drawer as k5,IconButton as S5,Tooltip as T5}from"@mui/material";import C5 from"@mui/icons-material/Close";import B5 from"@ehfuse/overlay-scrollbar";import{FormDialog as I5}from"@ehfuse/mui-form-dialog";import{useState as Ns}from"react";import{Box as mi,ButtonBase as c5,Divider as Ls,Menu as Cu,MenuItem as Bu,Tooltip as u5}from"@mui/material";import d5 from"@mui/icons-material/SubjectOutlined";import f5 from"@mui/icons-material/StickyNote2Outlined";import h5 from"@mui/icons-material/LabelOutlined";import p5 from"@mui/icons-material/DirectionsRunOutlined";import sp from"@mui/icons-material/LockOutlined";import ap from"@mui/icons-material/PublicOutlined";import lp from"@mui/icons-material/Group";import m5 from"@mui/icons-material/Repeat";import g5 from"@mui/icons-material/EventOutlined";import b5 from"@mui/icons-material/SpeedOutlined";import{TextField as y5}from"@ehfuse/mui-form-controls";import{InfoAlert as cp}from"@ehfuse/alerts";import{useState as hi}from"react";import{Box as Lh,Divider as p3,ListItemIcon as m3,Menu as fu,MenuItem as As}from"@mui/material";import g3 from"@mui/icons-material/Add";import cl from"@mui/icons-material/Check";import b3 from"@mui/icons-material/ViewKanbanOutlined";import y3 from"@mui/icons-material/CalendarTodayOutlined";import x3 from"@mui/icons-material/EventOutlined";import v3 from"@mui/icons-material/PersonOutlineOutlined";import Ph from"@mui/icons-material/PeopleAltOutlined";import w3 from"@mui/icons-material/FlagOutlined";import _3 from"@mui/icons-material/TimerOutlined";import k3 from"@mui/icons-material/NotificationsNoneOutlined";import S3 from"@mui/icons-material/InboxOutlined";import T3 from"@mui/icons-material/PlaceOutlined";import C3 from"@mui/icons-material/MapOutlined";import{TimePicker as B3}from"@ehfuse/mui-datetime-picker";import{InfoAlert as I3}from"@ehfuse/alerts";var Bn="@media (max-width: 719.95px)";function Gn(e){return{[Bn]:{order:e}}}import{useEffect as Xw,useState as Zw}from"react";import{Box as Jw}from"@mui/material";import{jsx as Qw}from"react/jsx-runtime";function _o({value:e,placeholder:h,readOnly:b,onCommit:l}){let o=ct(),[s,r]=Zw(e);return Xw(()=>r(e),[e]),Qw(Jw,{component:"input",spellCheck:!1,value:s,readOnly:b,placeholder:h,onChange:t=>r(t.target.value),onBlur:()=>{s.trim()!==e&&l(s.trim())},onKeyDown:t=>{t.key==="Enter"&&t.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:o.colors.textPrimary,caretColor:o.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as uu}from"@mui/material";import{jsx as e3,jsxs as Rh}from"react/jsx-runtime";function pt({icon:e,label:h,onClick:b,sx:l,children:o}){return Rh(uu,{sx:[{display:"flex",alignItems:"center",minHeight:32},...Array.isArray(l)?l:[l]],children:[Rh(uu,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,h]}),e3(uu,{onClick:b?s=>b(s.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:b?"pointer":"default","&:hover":b?{bgcolor:"#f2f2f0"}:void 0,[Bn]:{py:.25}},children:o})]})}import{Suspense as t3,lazy as r3,useEffect as n3,useState as Oh}from"react";import{Box as du,Dialog as o3,DialogContent as i3,DialogTitle as s3,IconButton as Ah,Tooltip as a3}from"@mui/material";import l3 from"@mui/icons-material/Close";import c3 from"@mui/icons-material/Search";import{Fragment as h3,jsx as In,jsxs as ll}from"react/jsx-runtime";function u3(e){return In(du,{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 d3=r3(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:u3})));function f3(e){if(e.addressType!=="R")return e.address;let h="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(h+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(h+=h!==""?`, ${e.buildingName}`:e.buildingName),h!==""?`${e.address} (${h})`:e.address}function Dh({value:e,placeholder:h="\uC8FC\uC18C \uC785\uB825",readOnly:b,onCommit:l}){let[o,s]=Oh(e),[r,t]=Oh(!1),n=Sr().slots?.addressSearch;n3(()=>s(e),[e]);let c=a=>{s(a),t(!1),a!==e&&l(a)};return ll(h3,{children:[ll(du,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[In(du,{component:"input",spellCheck:!1,value:o,readOnly:b,placeholder:h,onChange:a=>s(a.target.value),onBlur:()=>{r||o.trim()!==e&&l(o.trim())},onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),!b&&t(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),b?null:In(a3,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:In(Ah,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>t(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:In(c3,{sx:{fontSize:17}})})})]}),n?In(n,{open:r,onComplete:c,onClose:()=>t(!1)}):ll(o3,{open:r,onClose:()=>t(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[ll(s3,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",In(Ah,{"aria-label":"\uC8FC\uC18C \uAC80\uC0C9 \uB2EB\uAE30",onClick:()=>t(!1),size:"small",children:In(l3,{})})]}),In(i3,{style:{padding:0},dividers:!0,children:r?In(t3,{fallback:null,children:In(d3,{onComplete:a=>{c(f3(a))},onClose:()=>t(!1),defaultQuery:o,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as ul,jsx as ot,jsxs as En}from"react/jsx-runtime";function Nh(e){return String(e??"").includes(" ")?on(e):hn(e)}function E3(e){let[h="00",b="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(h)?h:"00",minute:/^\d{2}$/.test(b)?b:"00"}}function qi({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return ot(Lh,{component:"span",sx:{color:"#9a9a97"},children:e})}var tr=e=>({gridColumn:`${e}`,[Bn]:{gridColumn:"auto"}});function dl({values:e,customTabs:h,avatarSrcByName:b,managerLocked:l=!1,notice:o=!1,event:s=!1,hideDueDate:r=!1,hideReminder:t=!1,beforeStart:n,pinColumns:c=!1,projectColumn:i=1,afterProject:a,readOnly:d=!1,targetSummary:f="",narrowCollapsedSx:u,reminderLocked:g=!1,managerAction:m,hideProject:x=!1,leading:_,trailing:B,onChangeProject:A,onChangeStartDate:j,onChangeDueDate:D,onChangeReminder:P,onChangePriority:N,onChangeEventTime:q,onChangeEventPlace:z,onChangeEventAddress:T,onMemberEdit:C,onAddProject:R}){let[p,y]=hi(null),[v,w]=hi(!1),[k,S]=hi(null),[E,L]=hi(null),[$,U]=hi(null),[O,W]=hi(null),[M,I]=hi(null),F=Lt(),V=Nn(),Y=c&&!s,K=(X,ee,ne=!1)=>[Gn(X),...ne&&u?Array.isArray(u)?u:[u]:[],...Y&&ee?[tr(ee)]:[]],H=h.find(X=>X.key===e.tabKey),Z=h.filter(X=>!X.archived),J=X=>{let ee=!!String(e.startDate??"").trim();if(j(X),ee||o||s)return;let ne=xc(X);Number.isNaN(ne.getTime())||ne.getTime()<=Date.now()||I3("\uC2DC\uC791\uC77C\uC2DC\uAC00 \uB418\uBA74 \uCC45\uC784\uC790\uC5D0\uAC8C \uC54C\uB9BC\uC774 \uBC1C\uC1A1\uB429\uB2C8\uB2E4.")},G=ot(pt,{icon:ot(k3,{sx:{fontSize:17}}),label:"\uC0AC\uC804\uC54C\uB9BC",onClick:d||g?void 0:X=>L(X),sx:K(s?8:5,2,!0),children:e.reminders.length===0?ot(qi,{label:"\uC5C6\uC74C"}):Ac(e.reminders)});return En(ul,{children:[En(Lh,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gridAutoFlow:"row dense",columnGap:3,rowGap:0,px:2,[Bn]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[_,x?null:ot(pt,{icon:ot(b3,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:d?void 0:X=>y(X),sx:Y&&i==="full"?[K(1,void 0,!0),{gridColumn:"1 / -1"}]:K(1,i==="full"?1:i,!0),children:H?(()=>{let X=wt(H.icon);return En(ul,{children:[X?ot(X,{sx:{fontSize:16,color:"#1e3a8a"}}):null,H.label]})})():"\uAE30\uBCF8"}),a,o?ot(pt,{icon:ot(Ph,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:d?void 0:()=>C("targets"),sx:K(7,1),children:f||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!o&&!s?ot(pt,{icon:ot(v3,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:l||d||!e.managerName&&m?void 0:()=>C("manager"),sx:K(7,1),children:e.managerName?En(ul,{children:[ot(jr,{names:[e.managerName],size:20,avatarSrcByName:b}),e.managerName]}):m??ot(qi,{})}):null,n,s?null:ot(pt,{icon:ot(y3,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC2DC",onClick:d?void 0:X=>U(X),sx:K(2,2),children:e.startDate?Nh(e.startDate):ot(qi,{})}),o?null:ot(pt,{icon:ot(Ph,{sx:{fontSize:17}}),label:s?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:d?void 0:()=>C("receivers"),sx:K(s?7:8,1),children:e.receiverNames.length>0?En(ul,{children:[ot(jr,{names:e.receiverNames,size:20,avatarSrcByName:b}),e.receiverNames.length===1?e.receiverNames[0]:null]}):ot(qi,{})}),r?null:ot(pt,{icon:ot(x3,{sx:{fontSize:17}}),label:s?"\uB0A0\uC9DC":"\uB9C8\uAC10\uC77C\uC2DC",onClick:d?void 0:X=>W(X),sx:K(3,2),children:e.dueDate?s?hn(e.dueDate):Nh(e.dueDate):ot(qi,{})}),s?ot(pt,{icon:ot(_3,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:d?void 0:X=>I(X),sx:Gn(4),children:e.eventTime?e.eventTime:ot(qi,{label:"\uC885\uC77C"})}):null,s?ot(pt,{icon:ot(T3,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:Gn(5),children:ot(_o,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:d,onCommit:X=>z?.(X)})}):null,!t&&s?G:null,s?ot(pt,{icon:ot(C3,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},Gn(6)],children:ot(Dh,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:d,onCommit:X=>T?.(X)})}):null,s?null:ot(pt,{icon:ot(w3,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:d?void 0:X=>S(X),sx:K(6,1,!0),children:ot(Lr,{priority:e.priority,small:!0})}),!t&&!s?G:null,B]}),En(fu,{transitionDuration:0,anchorEl:p,open:!!p,onClose:()=>y(null),...V,children:[En(As,{selected:!e.tabKey,onClick:()=>{A(""),y(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ot(S3,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),Z.map(X=>{let ee=wt(X.icon),ne=e.tabKey===X.key;return En(As,{selected:ne,onClick:()=>{A(X.key),y(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ee?ot(ee,{sx:{fontSize:17,color:"#1e3a8a"}}):null,X.label,ne?ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},X.key)}),R?[ot(p3,{},"add-project-divider"),En(As,{onClick:()=>w(!0),sx:{fontSize:14,color:"#787774"},children:[ot(m3,{children:ot(g3,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),R?ot(qa,{open:v,onClose:()=>w(!1),onSubmit:(X,ee,ne)=>{(async()=>{let re=await R(X,ee,ne);re&&A(re)})(),y(null)}}):null,ot(fu,{transitionDuration:0,anchorEl:k,open:!!k,onClose:()=>S(null),...V,children:["high","medium","low"].map(X=>En(As,{selected:e.priority===X,onClick:()=>{N(X),S(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[ot(Lr,{priority:X,small:!0}),e.priority===X?ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},X))}),ot(fu,{transitionDuration:0,anchorEl:E,open:!!E,onClose:()=>L(null),...V,children:Oc(s?!!e.eventTime:String(e.dueDate??"").includes(" ")).map(X=>{let ee=X.value==="none"?e.reminders.length===0:e.reminders.includes(X.value);return En(As,{selected:ee,onClick:()=>{P(za(e.reminders,X.value)),X.value==="none"&&L(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[X.label,ee?ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},X.value)})}),s?ot(B3,{anchorEl:M,open:!!M,onClose:()=>I(null),value:E3(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:F,locale:"ko",onChange:(X,ee)=>{q?.(`${X}:${ee}`),I(null)}}):null,ot(pn,{anchorEl:$,open:!!$,date:e.startDate,reminders:[],hideReminder:!0,showTime:!0,centered:F,onClose:()=>U(null),onDateChange:J,onReminderChange:()=>{}}),ot(pn,{anchorEl:O,open:!!O,date:e.dueDate,reminders:e.reminders,hideReminder:g||t,showTime:!s,centered:F,onClose:()=>W(null),onDateChange:D,onReminderChange:P})]})}import{useState as M3}from"react";import{Box as R3,Menu as O3,MenuItem as A3}from"@mui/material";import D3 from"@mui/icons-material/RepeatOutlined";import P3 from"@mui/icons-material/DevicesOutlined";import N3 from"@mui/icons-material/ScreenSearchDesktopOutlined";import L3 from"@mui/icons-material/SellOutlined";import j3 from"@mui/icons-material/TaskAltOutlined";import{Fragment as jh,jsx as yr,jsxs as zh}from"react/jsx-runtime";function hu({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return yr(R3,{component:"span",sx:{color:"#9a9a97"},children:e})}function fl({values:e,readOnly:h=!1,showResolution:b=!1,onChangeRepro:l,onChangeDevice:o,onChangeWhere:s,onChangeVersion:r,onChangeResolution:t}){let[n,c]=M3(null),i=n?.field==="repro"?fc:n?.field==="device"?hc:pc,a=d=>{n?.field==="repro"?l(d):n?.field==="device"?o(d):n?.field==="resolution"&&t?.(d),c(null)};return zh(jh,{children:[zh(jh,{children:[yr(pt,{icon:yr(D3,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:h?void 0:d=>c({field:"repro",el:d}),children:Kd(e.repro)||yr(hu,{label:"\uC120\uD0DD"})}),yr(pt,{icon:yr(P3,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:h?void 0:d=>c({field:"device",el:d}),children:Gd(e.device)||yr(hu,{label:"\uC120\uD0DD"})}),yr(pt,{icon:yr(N3,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:yr(_o,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:h,onCommit:s})}),yr(pt,{icon:yr(L3,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:yr(_o,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:h,onCommit:r})}),b?yr(pt,{icon:yr(j3,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:h?void 0:d=>c({field:"resolution",el:d}),children:Sa(e.resolution)||yr(hu,{label:"\uC120\uD0DD"})}):null]}),yr(O3,{open:!!n,anchorEl:n?.el??null,onClose:()=>c(null),transitionDuration:0,children:i.map(d=>yr(A3,{onClick:()=>a(d.key),sx:{fontSize:14},children:d.name},d.key))})]})}import{Box as Fh}from"@mui/material";import{jsxs as qh}from"react/jsx-runtime";var pu=16;function bn({icon:e,title:h,titleExtra:b,children:l}){return qh(Fh,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[qh(Fh,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:pu,fontWeight:500,color:"#37352f"},children:[e,h,b]}),l]})}import{useState as mu}from"react";import{Box as gu,Button as z3,Divider as F3,IconButton as $h,Menu as q3,MenuItem as bu,Tooltip as $3}from"@mui/material";import H3 from"@mui/icons-material/MoreVert";import{ConfirmDialog as W3}from"@ehfuse/alerts";import{FormDialog as U3}from"@ehfuse/mui-form-dialog";import{ClearTextField as V3}from"@ehfuse/mui-form-controls";import{Fragment as K3,jsx as an,jsxs as hl}from"react/jsx-runtime";function Hh(e){return String(e??"").replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").trim().length>0}function pl({content:e,templates:h,onApply:b,onSave:l,onRemove:o}){let[s,r]=mu(null),[t,n]=mu(!1),[c,i]=mu(""),a=async d=>{r(null),!(Hh(e)&&!await W3({title:"\uC591\uC2DD \uBD88\uB7EC\uC624\uAE30",message:`\uC9C0\uAE08 \uC4F4 \uB0B4\uC6A9\uC744 "${d.name}" \uC591\uC2DD\uC73C\uB85C \uBC14\uAFC9\uB2C8\uB2E4. \uACC4\uC18D\uD560\uAE4C\uC694?`}))&&b(d.content)};return hl(K3,{children:[an($3,{title:"\uBCF8\uBB38 \uC591\uC2DD",arrow:!0,disableInteractive:!0,children:an($h,{size:"small","aria-label":"\uBCF8\uBB38 \uC591\uC2DD",onClick:d=>r(d.currentTarget),sx:{ml:"auto",color:"#9a9a97"},children:an(H3,{sx:{fontSize:18}})})}),hl(q3,{anchorEl:s,open:!!s,onClose:()=>r(null),transitionDuration:0,children:[l?an(bu,{disabled:!Hh(e),onClick:()=>{r(null),i(""),n(!0)},sx:{fontSize:14,minWidth:220},children:"\uD604\uC7AC \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5"}):null,l?an(F3,{sx:{my:.5}}):null,h.length===0?an(bu,{disabled:!0,sx:{fontSize:14,minWidth:220},children:"\uC800\uC7A5\uB41C \uC591\uC2DD\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}):h.map(d=>hl(bu,{onClick:()=>{a(d)},sx:{fontSize:14,minWidth:220,gap:1},children:[an(gu,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.name}),o?an($h,{size:"small","aria-label":`${d.name} \uC591\uC2DD \uC0AD\uC81C`,onClick:f=>{f.stopPropagation(),o(d.seq)},sx:{color:"#9a9a97"},children:an(cr,{sx:{fontSize:16}})}):null]},d.seq))]}),an(U3,{open:t,onClose:()=>n(!1),maxWidth:"xs",title:"\uC591\uC2DD\uC73C\uB85C \uC800\uC7A5",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,right:an(z3,{variant:"contained",disabled:!c.trim(),onClick:()=>{l?.(c.trim(),e),n(!1)},children:"\uC800\uC7A5"})},sections:[{id:"template-name",title:"",showTitle:!1,children:hl(gu,{sx:{display:"flex",flexDirection:"column",gap:1},children:[an(gu,{sx:{fontSize:15,color:"#37352f"},children:"\uC9C0\uAE08 \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5\uD569\uB2C8\uB2E4. \uB2E4\uC74C\uBD80\uD130 \uC774 \uC774\uB984\uC73C\uB85C \uAEBC\uB0B4 \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4."}),an(V3,{size:"medium",fullWidth:!0,autoFocus:!0,placeholder:"\uC591\uC2DD \uC774\uB984 (\uC608: \uC624\uB958 \uC2E0\uACE0 \uC11C\uC2DD)",value:c,onChange:d=>i(d.target.value)})]})}]})]})}import{useEffect as yu,useRef as Vo,useState as G3}from"react";import{Box as xu,IconButton as Y3,Tooltip as X3}from"@mui/material";import Z3 from"@mui/icons-material/ContentCopyOutlined";import J3 from"@mui/icons-material/Check";import{EhfuseEditor as Q3,ImageResizePlugin as e_,minimalToolbarOptions as t_}from"@ehfuse/editor";import{jsx as pi,jsxs as n_}from"react/jsx-runtime";function vu(e){let h=e.trim();return h?h.startsWith("<")?e:`<p>${h}</p>`:"<p></p>"}function r_(e){let h=e.replace(/<br\s*\/?>/gi,`
29
+ `,b.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NAME_CHAR="-"+b.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.CHAR_RE=new RegExp("^["+b.CHAR+"]$","u"),b.RESTRICTED_CHAR_RE=new RegExp("^["+b.RESTRICTED_CHAR+"]$","u"),b.S_RE=new RegExp("^["+b.S+"]+$","u"),b.NAME_START_CHAR_RE=new RegExp("^["+b.NAME_START_CHAR+"]$","u"),b.NAME_CHAR_RE=new RegExp("^["+b.NAME_CHAR+"]$","u"),b.NAME_RE=new RegExp("^["+b.NAME_START_CHAR+"]["+b.NAME_CHAR+"]*$","u"),b.NMTOKEN_RE=new RegExp("^["+b.NAME_CHAR+"]+$","u");function l(o){return o>=65&&o<=90||o>=97&&o<=122||o===58||o===95||o===8204||o===8205||o>=192&&o<=214||o>=216&&o<=246||o>=248&&o<=767||o>=880&&o<=893||o>=895&&o<=8191||o>=8304&&o<=8591||o>=11264&&o<=12271||o>=12289&&o<=55295||o>=63744&&o<=64975||o>=65008&&o<=65533||o>=65536&&o<=983039}b.S_LIST=[32,10,13,9],b.isChar=function(o){return o>=1&&o<=55295||o>=57344&&o<=65533||o>=65536&&o<=1114111},b.isRestrictedChar=function(o){return o>=1&&o<=8||o===11||o===12||o>=14&&o<=31||o>=127&&o<=132||o>=134&&o<=159},b.isCharAndNotRestricted=function(o){return o===9||o===10||o===13||o>31&&o<127||o===133||o>159&&o<=55295||o>=57344&&o<=65533||o>=65536&&o<=1114111},b.isS=function(o){return o===32||o===10||o===13||o===9},b.isNameStartChar=l,b.isNameChar=function(o){return l(o)||o>=48&&o<=57||o===45||o===46||o===183||o>=768&&o<=879||o>=8255&&o<=8256}},{}],545:[function(e,h,b){"use strict";function l(o){return o>=65&&o<=90||o===95||o>=97&&o<=122||o>=192&&o<=214||o>=216&&o<=246||o>=248&&o<=767||o>=880&&o<=893||o>=895&&o<=8191||o>=8204&&o<=8205||o>=8304&&o<=8591||o>=11264&&o<=12271||o>=12289&&o<=55295||o>=63744&&o<=64975||o>=65008&&o<=65533||o>=65536&&o<=983039}Object.defineProperty(b,"__esModule",{value:!0}),b.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NC_NAME_CHAR="-"+b.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.NC_NAME_START_CHAR_RE=new RegExp("^["+b.NC_NAME_START_CHAR+"]$","u"),b.NC_NAME_CHAR_RE=new RegExp("^["+b.NC_NAME_CHAR+"]$","u"),b.NC_NAME_RE=new RegExp("^["+b.NC_NAME_START_CHAR+"]["+b.NC_NAME_CHAR+"]*$","u"),b.isNCNameStartChar=l,b.isNCNameChar=function(o){return l(o)||o===45||o===46||o>=48&&o<=57||o===183||o>=768&&o<=879||o>=8255&&o<=8256}},{}]},{},[15])(15)}))});var Od="waiting",bT="replied";var io={basis:"count",default_capacity:0,by_account:{}};function xT(e){let h=e&&typeof e=="object"&&!Array.isArray(e)?e:{},b=h.basis==="points"?"points":"count",l=Math.max(0,Math.floor(Number(h.default_capacity)||0)),o={},s=h.by_account&&typeof h.by_account=="object"?h.by_account:{};for(let[r,t]of Object.entries(s)){let n=Number(r)||0,c=Math.max(0,Math.floor(Number(t)||0));n>0&&c>0&&(o[n]=c)}return{basis:b,default_capacity:l,by_account:o}}import{createContext as eg,useContext as tg,useMemo as Dd}from"react";import{Box as rg}from"@mui/material";var ic="--app-mobile-font-offset";function kr(e,h=0){return`calc(${e}px + max(0px, var(${ic}, 0px) - ${h}px))`}import{jsx as Ad}from"react/jsx-runtime";var Pd=eg({});function ng({config:e,children:h}){let b=Dd(()=>e??{},[e]),l=b.mobileFontOffsetPx;return Ad(Pd.Provider,{value:b,children:l===void 0?h:Ad(rg,{sx:{display:"contents",[ic]:`${l}px`},children:h})})}function Sr(){return tg(Pd)}function ps(){let{buildFileUrl:e}=Sr();return Dd(()=>e||((h,b)=>{let l=[];return b?.thumb&&l.push(`thumb=${b.thumb}`),b?.download&&l.push("download=1"),`/api/v1/files/${h}${l.length?`?${l.join("&")}`:""}`}),[e])}function ms(){let{uploadMaxMb:e}=Sr();return e??50}import{useGlobalForm as q1}from"@ehfuse/forma";import Nd from"@mui/icons-material/DoNotDisturbAltOutlined";import Ld from"@mui/icons-material/BookmarkBorderOutlined";import og from"@mui/icons-material/LabelOutlined";import ig from"@mui/icons-material/FlagOutlined";import sg from"@mui/icons-material/StarBorderOutlined";import ag from"@mui/icons-material/FolderOutlined";import lg from"@mui/icons-material/EventOutlined";import cg from"@mui/icons-material/BuildOutlined";import ug from"@mui/icons-material/LocalShippingOutlined";import dg from"@mui/icons-material/StorefrontOutlined";import fg from"@mui/icons-material/GroupsOutlined";import hg from"@mui/icons-material/LightbulbOutlined";import pg from"@mui/icons-material/FavoriteBorderOutlined";import mg from"@mui/icons-material/AssignmentOutlined";import gg from"@mui/icons-material/HomeOutlined";import bg from"@mui/icons-material/WorkOutline";import yg from"@mui/icons-material/SchoolOutlined";import xg from"@mui/icons-material/LocalHospitalOutlined";import vg from"@mui/icons-material/RestaurantOutlined";import wg from"@mui/icons-material/LocalFloristOutlined";import _g from"@mui/icons-material/DirectionsCarOutlined";import kg from"@mui/icons-material/CampaignOutlined";import Sg from"@mui/icons-material/SavingsOutlined";import Tg from"@mui/icons-material/Inventory2Outlined";import Cg from"@mui/icons-material/CleaningServicesOutlined";import jd from"@mui/icons-material/HandymanOutlined";import Bg from"@mui/icons-material/LocalPhoneOutlined";import Ig from"@mui/icons-material/EmailOutlined";import Eg from"@mui/icons-material/ShoppingCartOutlined";import Mg from"@mui/icons-material/BarChartOutlined";import Rg from"@mui/icons-material/PrintOutlined";import Og from"@mui/icons-material/SecurityOutlined";import Ag from"@mui/icons-material/AlarmOutlined";import Dg from"@mui/icons-material/AttachFileOutlined";import Pg from"@mui/icons-material/PhotoCameraOutlined";import Ng from"@mui/icons-material/ImageOutlined";import Lg from"@mui/icons-material/MenuBookOutlined";import jg from"@mui/icons-material/EditOutlined";import zg from"@mui/icons-material/KeyOutlined";import Fg from"@mui/icons-material/LockOutlined";import qg from"@mui/icons-material/LockOpenOutlined";import $g from"@mui/icons-material/SettingsOutlined";import Hg from"@mui/icons-material/CloudOutlined";import Wg from"@mui/icons-material/WifiOutlined";import Ug from"@mui/icons-material/ComputerOutlined";import Vg from"@mui/icons-material/SmartphoneOutlined";import Kg from"@mui/icons-material/TvOutlined";import Gg from"@mui/icons-material/AccessTimeOutlined";import Yg from"@mui/icons-material/TimerOutlined";import Xg from"@mui/icons-material/MapOutlined";import Zg from"@mui/icons-material/PlaceOutlined";import Jg from"@mui/icons-material/NavigationOutlined";import Qg from"@mui/icons-material/FlightOutlined";import eb from"@mui/icons-material/TrainOutlined";import tb from"@mui/icons-material/DirectionsBusOutlined";import rb from"@mui/icons-material/DirectionsBikeOutlined";import nb from"@mui/icons-material/DirectionsWalkOutlined";import ob from"@mui/icons-material/DirectionsRunOutlined";import ib from"@mui/icons-material/FitnessCenterOutlined";import sb from"@mui/icons-material/SportsSoccerOutlined";import ab from"@mui/icons-material/EmojiEventsOutlined";import lb from"@mui/icons-material/CardGiftcardOutlined";import cb from"@mui/icons-material/CakeOutlined";import zd from"@mui/icons-material/CoffeeOutlined";import ub from"@mui/icons-material/LocalPizzaOutlined";import db from"@mui/icons-material/ShoppingBagOutlined";import Fd from"@mui/icons-material/CreditCardOutlined";import fb from"@mui/icons-material/AccountBalanceOutlined";import hb from"@mui/icons-material/AccountBalanceWalletOutlined";import pb from"@mui/icons-material/AttachMoneyOutlined";import mb from"@mui/icons-material/ReceiptLongOutlined";import gb from"@mui/icons-material/CalculateOutlined";import bb from"@mui/icons-material/TrendingUpOutlined";import yb from"@mui/icons-material/ListAltOutlined";import xb from"@mui/icons-material/TaskAltOutlined";import vb from"@mui/icons-material/DoneAllOutlined";import wb from"@mui/icons-material/WarningAmberOutlined";import _b from"@mui/icons-material/InfoOutlined";import kb from"@mui/icons-material/HelpOutlined";import Sb from"@mui/icons-material/SupportAgentOutlined";import Tb from"@mui/icons-material/PersonOutlined";import Cb from"@mui/icons-material/PersonAddOutlined";import Bb from"@mui/icons-material/BadgeOutlined";import Ib from"@mui/icons-material/WbSunnyOutlined";import Eb from"@mui/icons-material/DarkModeOutlined";import Mb from"@mui/icons-material/LocalFireDepartmentOutlined";import Rb from"@mui/icons-material/WaterDropOutlined";import Ob from"@mui/icons-material/BoltOutlined";import Ab from"@mui/icons-material/AutorenewOutlined";import Db from"@mui/icons-material/ScienceOutlined";import Pb from"@mui/icons-material/MedicalServicesOutlined";import Nb from"@mui/icons-material/NotificationsOutlined";import Lb from"@mui/icons-material/SendOutlined";import jb from"@mui/icons-material/LinkOutlined";import zb from"@mui/icons-material/PublicOutlined";import qd from"@mui/icons-material/ApartmentOutlined";import Fb from"@mui/icons-material/PlumbingOutlined";import qb from"@mui/icons-material/ElectricalServicesOutlined";import $b from"@mui/icons-material/ChatOutlined";import Hb from"@mui/icons-material/DescriptionOutlined";import Wb from"@mui/icons-material/FactCheckOutlined";import Ub from"@mui/icons-material/RocketLaunchOutlined";import Vb from"@mui/icons-material/PaletteOutlined";import Kb from"@mui/icons-material/MusicNoteOutlined";import Gb from"@mui/icons-material/VideocamOutlined";import Yb from"@mui/icons-material/ThumbUpOutlined";import Xb from"@mui/icons-material/PushPinOutlined";import Zb from"@mui/icons-material/SearchOutlined";import Jb from"@mui/icons-material/VisibilityOutlined";import Qb from"@mui/icons-material/VerifiedOutlined";import e1 from"@mui/icons-material/TrackChangesOutlined";import t1 from"@mui/icons-material/ExtensionOutlined";import r1 from"@mui/icons-material/CodeOutlined";import n1 from"@mui/icons-material/BugReportOutlined";import o1 from"@mui/icons-material/SmartToyOutlined";import i1 from"@mui/icons-material/StorageOutlined";import s1 from"@mui/icons-material/QrCode2Outlined";import a1 from"@mui/icons-material/FileDownloadOutlined";import l1 from"@mui/icons-material/FileUploadOutlined";import c1 from"@mui/icons-material/MicOutlined";import u1 from"@mui/icons-material/HeadphonesOutlined";import d1 from"@mui/icons-material/MovieOutlined";import f1 from"@mui/icons-material/SportsEsportsOutlined";import h1 from"@mui/icons-material/BrushOutlined";import p1 from"@mui/icons-material/ArchitectureOutlined";import m1 from"@mui/icons-material/EngineeringOutlined";import g1 from"@mui/icons-material/FactoryOutlined";import b1 from"@mui/icons-material/AgricultureOutlined";import y1 from"@mui/icons-material/DirectionsBoatOutlined";import x1 from"@mui/icons-material/TwoWheelerOutlined";import v1 from"@mui/icons-material/HandshakeOutlined";import w1 from"@mui/icons-material/GavelOutlined";import _1 from"@mui/icons-material/BalanceOutlined";import k1 from"@mui/icons-material/TranslateOutlined";import S1 from"@mui/icons-material/PsychologyOutlined";import T1 from"@mui/icons-material/PetsOutlined";import C1 from"@mui/icons-material/CelebrationOutlined";import B1 from"@mui/icons-material/BeachAccessOutlined";import I1 from"@mui/icons-material/AcUnitOutlined";import E1 from"@mui/icons-material/ForestOutlined";import M1 from"@mui/icons-material/LandscapeOutlined";import R1 from"@mui/icons-material/HotelOutlined";import O1 from"@mui/icons-material/LocalLaundryServiceOutlined";import A1 from"@mui/icons-material/ChairOutlined";import D1 from"@mui/icons-material/LocalBarOutlined";import P1 from"@mui/icons-material/LunchDiningOutlined";import N1 from"@mui/icons-material/IcecreamOutlined";import L1 from"@mui/icons-material/WorkspacePremiumOutlined";import j1 from"@mui/icons-material/DiamondOutlined";import z1 from"@mui/icons-material/VaccinesOutlined";var sc="bookmark",so="label",or="notifications",ar="event",gs="warning",bs="#e53e3e",$d="none",ac=[{key:$d,Icon:Nd},{key:"label",Icon:og},{key:"bookmark",Icon:Ld},{key:"flag",Icon:ig},{key:"star",Icon:sg},{key:"folder",Icon:ag},{key:"event",Icon:lg},{key:"build",Icon:cg},{key:"shipping",Icon:ug},{key:"store",Icon:dg},{key:"groups",Icon:fg},{key:"idea",Icon:hg},{key:"heart",Icon:pg},{key:"assignment",Icon:mg},{key:"home",Icon:gg},{key:"work",Icon:bg},{key:"school",Icon:yg},{key:"hospital",Icon:xg},{key:"restaurant",Icon:vg},{key:"flower",Icon:wg},{key:"car",Icon:_g},{key:"campaign",Icon:kg},{key:"savings",Icon:Sg},{key:"inventory",Icon:Tg},{key:"cleaning",Icon:Cg},{key:"handyman",Icon:jd},{key:"phone",Icon:Bg},{key:"email",Icon:Ig},{key:"cart",Icon:Eg},{key:"chart",Icon:Mg},{key:"print",Icon:Rg},{key:"security",Icon:Og},{key:"alarm",Icon:Ag},{key:"attach",Icon:Dg},{key:"camera",Icon:Pg},{key:"image",Icon:Ng},{key:"book",Icon:Lg},{key:"edit",Icon:jg},{key:"key",Icon:zg},{key:"lock",Icon:Fg},{key:"unlock",Icon:qg},{key:"settings",Icon:$g},{key:"cloud",Icon:Hg},{key:"wifi",Icon:Wg},{key:"computer",Icon:Ug},{key:"smartphone",Icon:Vg},{key:"tv",Icon:Kg},{key:"clock",Icon:Gg},{key:"timer",Icon:Yg},{key:"map",Icon:Xg},{key:"place",Icon:Zg},{key:"navigation",Icon:Jg},{key:"flight",Icon:Qg},{key:"train",Icon:eb},{key:"bus",Icon:tb},{key:"bike",Icon:rb},{key:"walk",Icon:nb},{key:"run",Icon:ob},{key:"fitness",Icon:ib},{key:"soccer",Icon:sb},{key:"trophy",Icon:ab},{key:"gift",Icon:lb},{key:"cake",Icon:cb},{key:"coffee",Icon:zd},{key:"pizza",Icon:ub},{key:"bag",Icon:db},{key:"card",Icon:Fd},{key:"bank",Icon:fb},{key:"wallet",Icon:hb},{key:"money",Icon:pb},{key:"receipt",Icon:mb},{key:"calculate",Icon:gb},{key:"trending",Icon:bb},{key:"listalt",Icon:yb},{key:"task",Icon:xb},{key:"doneall",Icon:vb},{key:"warning",Icon:wb},{key:"info",Icon:_b},{key:"help",Icon:kb},{key:"support",Icon:Sb},{key:"person",Icon:Tb},{key:"personadd",Icon:Cb},{key:"badge",Icon:Bb},{key:"sun",Icon:Ib},{key:"moon",Icon:Eb},{key:"fire",Icon:Mb},{key:"water",Icon:Rb},{key:"bolt",Icon:Ob},{key:"renew",Icon:Ab},{key:"science",Icon:Db},{key:"medical",Icon:Pb},{key:"notifications",Icon:Nb},{key:"send",Icon:Lb},{key:"link",Icon:jb},{key:"public",Icon:zb},{key:"apartment",Icon:qd},{key:"plumbing",Icon:Fb},{key:"electrical",Icon:qb},{key:"chat",Icon:$b},{key:"description",Icon:Hb},{key:"factcheck",Icon:Wb},{key:"rocket",Icon:Ub},{key:"palette",Icon:Vb},{key:"music",Icon:Kb},{key:"video",Icon:Gb},{key:"thumbup",Icon:Yb},{key:"pin",Icon:Xb},{key:"search",Icon:Zb},{key:"eye",Icon:Jb},{key:"verified",Icon:Qb},{key:"target",Icon:e1},{key:"extension",Icon:t1},{key:"code",Icon:r1},{key:"bug",Icon:n1},{key:"robot",Icon:o1},{key:"storage",Icon:i1},{key:"qrcode",Icon:s1},{key:"download",Icon:a1},{key:"upload",Icon:l1},{key:"mic",Icon:c1},{key:"headphones",Icon:u1},{key:"movie",Icon:d1},{key:"game",Icon:f1},{key:"brush",Icon:h1},{key:"architecture",Icon:p1},{key:"engineering",Icon:m1},{key:"factory",Icon:g1},{key:"agriculture",Icon:b1},{key:"boat",Icon:y1},{key:"motorcycle",Icon:x1},{key:"handshake",Icon:v1},{key:"gavel",Icon:w1},{key:"balance",Icon:_1},{key:"translate",Icon:k1},{key:"psychology",Icon:S1},{key:"pets",Icon:T1},{key:"celebration",Icon:C1},{key:"beach",Icon:B1},{key:"snow",Icon:I1},{key:"forest",Icon:E1},{key:"mountain",Icon:M1},{key:"hotel",Icon:R1},{key:"laundry",Icon:O1},{key:"chair",Icon:A1},{key:"bar",Icon:D1},{key:"burger",Icon:P1},{key:"icecream",Icon:N1},{key:"medal",Icon:L1},{key:"diamond",Icon:j1},{key:"vaccine",Icon:z1}],F1={cafe:zd,payment:Fd,business:qd,construction:jd};function wt(e){return e===$d?null:ac.find(h=>h.key===e)?.Icon??F1[String(e??"")]??Ld}function m9(e){return wt(e)??Nd}var lc={title:"",icon:so,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,visibility:"involved",visibility_group_seq:0,repeat_rule:"",repeat_until:"",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:"",reminders:[],priority:"medium",label_keys:[],note:"",content:"",checklist:[],tab_key:""},cc={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function $1(e){let{formId:h="taskbox-create-form",initialValues:b,onValidate:l,onSubmit:o}=e;return q1({formId:h,initialValues:{...lc,...b},onValidate:l,onSubmit:o})}import{useGlobalFormaState as H1}from"@ehfuse/forma";var Hd="taskbox-ui-state";function ao(){return H1({stateId:Hd,initialValues:cc})}import{useMemo as W1}from"react";import{useTheme as U1}from"@mui/material";function Bi(e,h){let b=Math.max(0,Math.min(1,h));if(b<=0)return"transparent";let l=e.trim().replace("#",""),o=l.length===3?l.split("").map(n=>n+n).join(""):l;if(!/^[0-9a-fA-F]{6}$/.test(o))return e;let s=Number.parseInt(o.slice(0,2),16),r=Number.parseInt(o.slice(2,4),16),t=Number.parseInt(o.slice(4,6),16);return`rgba(${s}, ${r}, ${t}, ${b})`}function Wd(e,h){let b=Math.max(0,Math.min(1,h)),l=e.trim().replace("#",""),o=l.length===3?l.split("").map(c=>c+c).join(""):l;if(!/^[0-9a-fA-F]{6}$/.test(o))return e;let s=c=>Math.round(c+(255-c)*b),r=s(Number.parseInt(o.slice(0,2),16)),t=s(Number.parseInt(o.slice(2,4),16)),n=s(Number.parseInt(o.slice(4,6),16));return`#${[r,t,n].map(c=>c.toString(16).padStart(2,"0")).join("")}`}function uc(e,h,b){return b==="dark"?{accent:e,accentContrast:h,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",surfaceHoverStrong:"#323a45",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:h,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:"#f8f8f7",surfaceHoverStrong:"#efefed",border:"#e6e6e3",borderStrong:"#dedddb"}}function V1(e,h){let b=h==="dark";return{bg:b?Wd(e.accent,.45):e.accent,color:b?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function Ud(e,h){return{...e,...h??{}}}function ka(e,h="light"){let b=h==="dark",l=V1(e,h),o=e.accentOnSurface;return{mode:h,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:o,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:h==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHoverStrong,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:h==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:h==="dark"?400:700,minHeight:48,badge:{...l,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...l,borderRadius:4,width:34}},summary:{gaugeTrackColor:h==="dark"?e.borderStrong:"#ececea",gaugeBarColor:o,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:o,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:h==="dark"?e.surfaceSubtle:e.surface,color:h==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:h==="dark"?e.border:e.borderStrong,selectedBg:h==="dark"?e.surfaceHover:e.textStrong,selectedColor:h==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:b?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:b?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:b?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:b?"#232a33":e.surface,borderColor:b?"#333c47":e.border,hoverBg:b?"#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:h==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:h==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function dc(e,h){if(!h)return e;let b=h.mode??e.mode,o={...b===e.mode?e.colors:uc(e.colors.accent,e.colors.accentContrast,b),...h.colors??{}},s=ka(o,b),{groupHeader:r,...t}=h.table??{},{badge:n,...c}=h.board??{},{badge:i,...a}=r??{};return{mode:b,colors:o,table:{...s.table,...t,groupHeader:{...s.table.groupHeader,...a,badge:Ud(s.table.groupHeader.badge,i)}},board:{...s.board,...c,badge:Ud(s.board.badge,n)},summary:{...s.summary,...h.summary??{}},chip:{...s.chip,...h.chip??{}},actionButton:{...s.actionButton,...h.actionButton??{}},tabs:{...s.tabs,...h.tabs??{}},avatar:{...s.avatar,...h.avatar??{}},calendar:{...s.calendar,...h.calendar??{}},card:{...s.card,...h.card??{}},timeline:{...s.timeline,...h.timeline??{}}}}function K1(e={}){let{mode:h="light",accent:b="#2563eb",accentContrast:l="#ffffff",input:o}=e;return dc(ka(uc(b,l,h),h),o)}function ct(){let e=U1(),{theme:h}=Sr(),b=e.palette.primary.main,l=e.palette.primary.contrastText,o=e.palette.mode==="dark"?"dark":"light";return W1(()=>dc(ka(uc(b,l,o),o),h),[b,l,o,h])}import{useCallback as Fn,useEffect as Ha,useMemo as qn,useRef as Lx,useState as $n}from"react";import{Box as Er,Divider as jx,IconButton as zx,ListItemIcon as Fx,Menu as Ef,MenuItem as Wa}from"@mui/material";import Mf from"@mui/icons-material/Add";import qx from"@mui/icons-material/ArrowUpward";import $x from"@mui/icons-material/ArrowDownward";import Hx from"@mui/icons-material/KeyboardArrowDown";import Wx from"@mui/icons-material/KeyboardArrowRight";import zc from"@mui/icons-material/Check";import Ux from"@mui/icons-material/FilterList";import Vx from"@mui/icons-material/InboxOutlined";import{Virtuoso as Kx}from"react-virtuoso";import Gx from"@ehfuse/overlay-scrollbar";import{Box as Vd}from"@mui/material";import{jsx as Y1,jsxs as X1}from"react/jsx-runtime";var G1={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 Lr({priority:e,small:h=!1,plain:b=!1}){let l=G1[e],o=ct(),s=o.mode==="dark",r=b||e==="low";return X1(Vd,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:h?.5:.75,px:r?0:h?.9:1.25,py:r?0:h?.25:.5,borderRadius:.75,fontSize:h?11.5:13,fontWeight:500,bgcolor:r?"transparent":s?Bi(l.dot,o.chip.darkBgAlpha):l.bgcolor,color:r?s?o.chip.plainColor:l.color:s?o.chip.darkTextSource==="fg"?l.color:l.dot:l.color,whiteSpace:"nowrap"},children:[Y1(Vd,{component:"span",sx:{width:h?6:8,height:h?6:8,borderRadius:"50%",bgcolor:l.dot}}),l.label]})}import{Menu as ty,MenuItem as ry}from"@mui/material";import ny from"@mui/icons-material/Check";function Nn(){return{}}var fc=[{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"}],hc=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],pc=[{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 Kd(e){return fc.find(h=>h.key===e)?.name??""}function Gd(e){return hc.find(h=>h.key===e)?.name??""}function Sa(e){return pc.find(h=>h.key===e)?.name??""}function mc(e,h=new Date){if(!e.is_event)return!1;let b=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(b))return!1;let l=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(l)){let s=new Date(`${b}T${l}:00`);return!Number.isNaN(s.getTime())&&s.getTime()<=h.getTime()}let o=new Date(`${b}T00:00:00`);return Number.isNaN(o.getTime())?!1:(o.setDate(o.getDate()+1),o.getTime()<=h.getTime())}function Ta(e,h=new Date){return e.is_event?mc(e,h):!!e.completed}var nn=[{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:"review_waiting",name:"\uAC80\uD1A0\uB300\uAE30",bg:"#ede9fe",fg:"#5b3fa8",dot:"#8b5cf6"},{key:"hold",name:"\uBCF4\uB958",bg:"#fbeee0",fg:"#8a5a2b",dot:"#d9730d"}],xs=nn;function Ca(e){return nn.find(h=>h.key===e)??nn[0]}var gc={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function lr(e){if(e.is_notice)return Yd(e.status);if(e.is_bug&&e.completed){let h=Sa(e.resolution)||"\uC644\uB8CC";return{...gc,name:h}}return e.completed&&e.status!=="hold"?gc:e.is_bug?J1(e.status):Ca(e.status)}var Z1={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function vs(e){return mc(e)?Z1:null}var ys=[{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 Yd(e){return ys.find(h=>h.key===e)??ys[1]}var bc="__closed__",ni=[{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"}],H9=[...ni.filter(e=>e.key!=="bug_hold"),{key:bc,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...ni.filter(e=>e.key==="bug_hold")];function J1(e){return ni.find(h=>h.key===e)??ni[0]}function Ba(e){return e.is_notice?ys:e.is_bug?ni:xs}function W9(e){return e.status===Od}var Q1={in_progress:0,not_started:2,hold:3};function U9(e){return e.completed?9:Q1[String(e.status??"")]??2}function Ii(e,h){let b=new Map(h.map(o=>[o.key,o])),l=(e.label_keys??[]).map(o=>b.get(o)).filter(o=>!!o);if(e.is_event){let o=vs({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return o?[o,...l]:l}return e.is_notice?String(e.status??"")==="notice_active"?l:[Yd(e.status),...l]:e.is_bug?[lr({...e,is_notice:!1}),...l]:e.completed?[gc,...l]:[Ca(e.status),...l]}function Xd(e){return{bg:`${e}1f`,fg:e,dot:e}}function Ia(e,h){return e.includes(h)?e.filter(b=>b!==h):[...e,h]}import{Box as Ea}from"@mui/material";import{jsx as ws,jsxs as ey}from"react/jsx-runtime";function At({option:e,small:h=!1}){let b=ct(),l=b.mode==="dark",o=e.key==="not_started";return ey(Ea,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:h?.5:.75,px:o?0:h?.9:1.25,py:o?0:h?.25:.5,borderRadius:1.25,fontSize:h?11.5:13,fontWeight:500,bgcolor:o?"transparent":l?Bi(e.dot,b.chip.darkBgAlpha):e.bg,color:o?l?b.chip.plainColor:e.fg:l?b.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[ws(Ea,{component:"span",sx:{width:h?6:8,height:h?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function Z9({task:e,statusOptions:h,small:b=!1}){let l=Ii(e,h);return l.length===0?null:ws(Ea,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:l.map(o=>ws(At,{option:o,small:b},o.key))})}function No({labelKeys:e,labelOptions:h}){let b=new Map(h.map(o=>[o.key,o])),l=e.map(o=>b.get(o)).filter(o=>!!o);return l.length===0?null:ws(Ea,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:l.map(o=>ws(At,{option:o,small:!0},o.key))})}import{jsx as yc,jsxs as oy}from"react/jsx-runtime";function Ei({anchorEl:e,value:h,options:b=nn,onSelect:l,onClose:o}){let s=Nn();return yc(ty,{anchorEl:e,open:!!e,onClose:o,transitionDuration:0,...s,children:b.map(r=>oy(ry,{onClick:()=>{l(r.key),o()},sx:{fontSize:14,minWidth:150,gap:1},children:[yc(At,{option:r}),h===r.key?yc(ny,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},r.key))})}function xc(e){let h=String(e??"").trim().replace("T"," "),b=h.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return b?new Date(Number(b[1]),Number(b[2])-1,Number(b[3]),Number(b[4]??0),Number(b[5]??0),Number(b[6]??0)):new Date(h)}function gr(e,h="YYYY-MM-DD"){let b=typeof e=="string"?xc(e):e;if(!e||e===""||isNaN(b.getTime()))return"";let l=b.getFullYear(),o=(b.getMonth()+1).toString().padStart(2,"0"),s=b.getDate().toString().padStart(2,"0"),r=l.toString().slice(-2);switch(h){case"YYYY-MM-DD":return`${l}-${o}-${s}`;case"YY.MM.DD":return`${r}.${o}.${s}`;case"MM/DD/YYYY":return`${o}/${s}/${l}`;case"DD.MM.YYYY":return`${s}.${o}.${l}`;case"YYYYMMDD":return`${l}${o}${s}`;default:return h.replace(/YYYY/g,l.toString()).replace(/YY/g,r).replace(/MM/g,o).replace(/DD/g,s)}}function Zd(){return gr(new Date)}var vc=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uC608\uC815"},{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 iy(e){let h=new Date(`${e}T00:00:00`);return h.setDate(h.getDate()+(6-h.getDay())),gr(h)}var sy=[{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 ay(e,h,b){let l=e.due_date.slice(0,10);return l?l<h?"overdue":l===h?"today":l<=b?"this_week":"later":"no_due"}function wc(e,h,b,l=[],o=[],s="",r){let t=e.filter(d=>d.is_notice);if(t.length>0){let d=wc(e.filter(f=>!f.is_notice),h,b,l,o,s,r);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:t},...d]}let n=new Map,c=(d,f)=>{let u=n.get(d);u?u.push(f):n.set(d,[f])},i;if(h==="due"){let d=iy(b);for(let f of e)c(ay(f,b,d),f);i=sy}else if(h==="status"){for(let d of e)c(Ca(d.status).key,d);i=nn.map(d=>({key:d.key,label:d.name}))}else if(h==="tab"){for(let d of e)c(d.tab_key?.trim()||"__none__",d);i=[...l.filter(d=>!d.archived).map(d=>({key:d.key,label:d.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...l.filter(d=>d.archived).map(d=>({key:d.key,label:`${d.label} (\uBCF4\uAD00\uB428)`}))]}else if(r?.enabled){let d=Number(r.myAccountSeq??0),f=s.trim();for(let u of e){if(!(Number(u.manager_account_seq??0)>0||String(u.manager_name??"").trim()!=="")){c("__none__",u);continue}let m=d>0&&Number(u.manager_account_seq??0)===d||!!f&&String(u.manager_name??"").trim()===f;c(m?"__manager__":"__reference__",u)}i=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let m of e)c(String(m.manager_name??"").trim()||"__none__",m);let d=s.trim(),f=[...n.keys()].filter(m=>m!=="__none__").sort((m,x)=>{if(d){if(m===d)return-1;if(x===d)return 1}return m.localeCompare(x)}),u=!!d&&f.includes(d),g=f.filter(m=>m!==d);i=[...u?[{key:d,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...g.map(m=>({key:m,label:m}))]}let a=[];for(let d of i){let f=n.get(d.key);!f||f.length===0||a.push({key:d.key,label:d.label,tasks:f})}return a}import ly from"@mui/icons-material/NotesOutlined";import cy from"@mui/icons-material/AutorenewOutlined";import uy from"@mui/icons-material/CalendarTodayOutlined";import dy from"@mui/icons-material/EventOutlined";import fy from"@mui/icons-material/PersonOutlineOutlined";import Qd from"@mui/icons-material/PeopleAltOutlined";import Sc from"@mui/icons-material/CheckCircleOutlineOutlined";import hy from"@mui/icons-material/FlagOutlined";import ef from"@mui/icons-material/AccessTimeOutlined";import py from"@mui/icons-material/StickyNote2Outlined";import my from"@mui/icons-material/ViewKanbanOutlined";import gy from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as Br}from"react/jsx-runtime";var by={completed:"50px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"132px",manager_name:"110px",receiver_names:"170px",targets:"170px",priority:"84px",ack:"104px",confirm:"100px",project:"150px",request:"100px",deleted_time:"150px",completed_time:"150px",note:"minmax(140px, 0.7fr)"};function tf(e){return Tc(e).map(h=>by[h.id]).join(" ")}var yy={id:"deleted_time",label:"\uC0AD\uC81C\uC77C\uC2DC",icon:Br(ef,{sx:{fontSize:15}}),align:"center",sortable:!0},xy={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:Br(ef,{sx:{fontSize:15}}),align:"center",sortable:!0},vy={id:"ticket_no",label:"\uD2F0\uCF13",icon:Br(gy,{sx:{fontSize:15}}),align:"center"},wy={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:Br(my,{sx:{fontSize:15}}),projectFilter:!0},_y={id:"targets",label:"\uB300\uC0C1\uC790",icon:Br(Qd,{sx:{fontSize:15}})},Jd={id:"priority",label:"\uC911\uC694\uB3C4",icon:Br(hy,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},ky={id:"ack",label:"\uD655\uC778",icon:Br(Sc,{sx:{fontSize:15}}),align:"center",ackFilter:!0},Sy={id:"confirm",label:"\uD655\uC778",icon:Br(Sc,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function _c(e){let h=e.findIndex(l=>l.id==="receiver_names"||l.id==="targets"),b=h>=0?h+1:e.findIndex(l=>l.id==="note");return b<0?[...e,Jd]:[...e.slice(0,b),Jd,...e.slice(b)]}function Tc(e){let{showProject:h=!1,showManager:b=!0,showActions:l=!0,showRequest:o=!0,notice:s=!1,bug:r=!1,trash:t=!1,confirmMode:n="none"}=e??{},c=d=>{if(!r)return d;let f=d.filter(m=>m.id!=="note"),u=f.findIndex(m=>m.id==="completed"),g=u>=0?u+1:0;return[...f.slice(0,g),vy,...f.slice(g)]};if(s)return c(_c(kc.filter(d=>!["manager_name","receiver_names","request"].includes(d.id)).flatMap(d=>d.id==="due_date"?[d,_y]:d.id==="note"?[ky,d]:[d])));let i=b?kc:kc.filter(d=>d.id!=="manager_name");if(l)o||(i=i.filter(d=>d.id!=="request"));else{i=i.filter(f=>f.id!=="request");let d=i.findIndex(f=>f.id==="note");i=[...i.slice(0,d),t?yy:xy,...i.slice(d)]}if(n==="action"){let d=i.findIndex(f=>f.id==="note");i=[...i.slice(0,d),Sy,...i.slice(d)]}if(!h)return c(_c(i));let a=i.findIndex(d=>d.id==="receiver_names");return c(_c([...i.slice(0,a+1),wy,...i.slice(a+1)]))}var kc=[{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:Br(ly,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:Br(cy,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC",icon:Br(uy,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uC608\uC815",icon:Br(dy,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:Br(fy,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:Br(Qd,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:Br(Sc,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:Br(py,{sx:{fontSize:15}})}];import{Button as rf,ClickAwayListener as By,Dialog as Iy,Paper as Ey,Popper as My,Typography as Ry,Box as Oy}from"@mui/material";import{useMediaQuery as Ty,useTheme as Cy}from"@mui/material";function Lt(){let{isMobile:e}=Sr(),h=Cy(),b=Ty(h.breakpoints.up("lg"));return e!==void 0?e:!b}import{Fragment as Dy,jsx as Lo,jsxs as of}from"react/jsx-runtime";function nf(){if(typeof document>"u")return;let e=0,h=l=>{l.stopPropagation(),l.preventDefault(),b()},b=()=>{window.clearTimeout(e),document.removeEventListener("click",h,!0)};document.addEventListener("click",h,!0),e=window.setTimeout(b,350)}function Ay({title:e,content:h,confirmText:b,cancelText:l,titleFontSize:o,actionFontSize:s,actionMinHeight:r,onCancel:t,onConfirm:n}){return of(Dy,{children:[Lo(Ry,{component:"div",sx:{fontSize:o,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),h,of(Oy,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[Lo(rf,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{nf(),t()},fullWidth:!0,sx:{fontSize:s,minHeight:r,fontWeight:700},children:l}),Lo(rf,{size:"medium",variant:"contained",color:"primary",onClick:()=>{nf(),n()},fullWidth:!0,sx:{fontSize:s,minHeight:r,fontWeight:700},children:b})]})]})}function Dt({open:e,anchorEl:h,title:b="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:l,confirmText:o="\uD655\uC778",cancelText:s="\uCDE8\uC18C",placement:r="top",minWidth:t=160,minHeight:n,titleFontSize:c=17,actionFontSize:i=16,actionMinHeight:a=44,zIndex:d=1300,onCancel:f,onConfirm:u}){let g=Lt(),m=Lo(Ay,{title:b,content:l,confirmText:o,cancelText:s,titleFontSize:c,actionFontSize:i,actionMinHeight:a,onCancel:f,onConfirm:u});return g?Lo(Iy,{open:e,onClose:f,sx:{zIndex:d},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:m}):Lo(My,{open:e,anchorEl:h,placement:r,sx:{zIndex:d},children:Lo(By,{onClickAway:f,children:Lo(Ey,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:t,minHeight:n,justifyContent:n?"space-between":"flex-start"},onClick:x=>x.stopPropagation(),onMouseDown:x=>x.stopPropagation(),children:m})})})}import{memo as ix}from"react";function kn(e){let h=e.visibility;return h==="involved"||h==="group"||h==="all"?h:e.is_open?"all":"involved"}function Ma(e,h,b=0){if(h<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===h)return!0;let s=(e.target_account_seqs??[]).filter(r=>r>0);return s.length===0||s.includes(h)}if((e.author_account_seq??0)===h||(e.manager_account_seq??0)===h||(e.receiver_account_seqs??[]).includes(h))return!0;let o=kn(e);if(o==="all")return!0;if(o==="group"){let s=e.visibility_group_seq??0;return s>0&&b===s}return!1}function sf(e){return e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)!==0?!1:kn(e)!=="involved"}function Ra(e,h){return h<=0||(e.author_account_seq??0)===h?!1:sf(e)}function Oa(e,h){return h<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||(e.author_account_seq??0)===h||sf(e)?!1:(e.receiver_account_seqs??[]).includes(h)}function af(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function lf(e,h){if(h<=0)return!1;let b=(e.author_account_seq??0)===h;return e.is_notice?b:b||(e.manager_account_seq??0)===h}function lo(e,h){return h<=0?!1:e.is_notice?(e.author_account_seq??0)===h:(e.author_account_seq??0)===h||(e.manager_account_seq??0)===h||(e.receiver_account_seqs??[]).includes(h)}var OB=[119,121,141,143];import{memo as Gy,useEffect as Yy,useRef as Xy,useState as gf}from"react";import{Box as Et,Button as Zy,ButtonBase as Jy,Checkbox as Qy,Tooltip as ks}from"@mui/material";import ex from"@mui/icons-material/PublicOutlined";import tx from"@mui/icons-material/Group";import rx from"@mui/icons-material/CheckCircle";import nx from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as Py,useState as cf}from"react";import{Avatar as uf,Box as Ny}from"@mui/material";import Ly from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Aa}from"react/jsx-runtime";var Cc=new Set,df=e=>e.startsWith("data:")||e.startsWith("blob:");function jy(e){let h=e.trim();return h?([...h][0]??"").toUpperCase():""}function fn({src:e,name:h="",avatarSx:b,iconFontSize:l=40}){let[o,s]=cf(()=>e?df(e)||Cc.has(e):!1),[r,t]=cf(!1),n={position:"relative",overflow:"hidden",borderRadius:"15px"},c=b?[n,...Array.isArray(b)?b:[b]]:n;if(Py(()=>{t(!1),s(e?df(e)||Cc.has(e):!1)},[e]),!e||r){let i=jy(h);return Aa(uf,{sx:c,children:i?Aa(Ny,{component:"span",sx:{fontSize:"inherit",fontWeight:600,lineHeight:1,userSelect:"none"},children:i}):Aa(Ly,{sx:{fontSize:l}})})}return Aa(uf,{src:e,imgProps:{onLoad:()=>{Cc.add(e),s(!0)},onError:()=>t(!0),style:o?void 0:{opacity:0}},sx:c})}var zy=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Da=(e,h)=>{if(!h||!h.trim())return[{text:e,highlight:!1}];try{let b=zy(h.trim()),l=new RegExp(`(${b})`,"gi");return e.split(l).map(s=>s.toLowerCase()===h.trim().toLowerCase()?{text:s,highlight:!0}:{text:s,highlight:!1}).filter(s=>s.text)}catch{return[{text:e,highlight:!1}]}};var Fy=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function hn(e){let h=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(h))return"";let b=new Date(`${h}T00:00:00`);return Number.isNaN(b.getTime())?"":`${h.slice(2).replaceAll("-",".")} (${Fy[b.getDay()]})`}function Bc(e){let h=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(h))return"";let b=Number(h.slice(5,7)),l=Number(h.slice(8,10));return!b||!l?"":`${b}\uC6D4 ${l}\uC77C`}function on(e){let h=String(e??"").trim(),[b,l=""]=h.split(" "),o=hn(b);return o?l?`${o} ${l.slice(0,5)}`:o:""}function Mi(e){let h=e.checklist??[];return h.length===0?"":`${h.filter(l=>l.checked).length}/${h.length}`}import{Box as ff,Tooltip as qy}from"@mui/material";import{jsx as Pa}from"react/jsx-runtime";var Ri=[{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 jr({names:e,size:h=22,ringFirst:b=!1,avatarSrcByName:l}){let o=ct();return Pa(ff,{sx:{display:"flex",alignItems:"center"},children:e.map((s,r)=>{let t=b&&r===0;return Pa(qy,{title:t?`\uCC45\uC784\uC790 \xB7 ${s}`:s,arrow:!0,children:Pa(ff,{sx:{ml:r===0?0:"-7px",zIndex:r,borderRadius:"50%",border:`2px solid ${t?o.avatar.ringColor:o.avatar.separatorColor}`,display:"inline-flex",...o.avatar.sx},children:Pa(fn,{src:l?.get(s)??"",name:s,avatarSx:{width:h,height:h,fontSize:Math.round(h/2),borderRadius:"50%",...Ri[r%Ri.length]},iconFontSize:Math.round(h*.6)})})},`${s}-${r}`)})})}import{Box as hf,Button as mf}from"@mui/material";import $y from"@mui/icons-material/CheckCircle";import{Fragment as Uy,jsx as _s,jsxs as pf}from"react/jsx-runtime";function Hy(e){let h=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,gap:.5,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:h?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:h?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function Wy(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 Ln({onClick:e,children:h,fullWidth:b=!1,sx:l}){let o=ct();return _s(mf,{size:"small",variant:"contained",color:"inherit",fullWidth:b,sx:[Wy(o),...Array.isArray(l)?l:l?[l]:[]],onClick:s=>{s.stopPropagation(),e(s)},children:h})}function Oi({canConfirm:e,count:h,total:b,myConfirmed:l=!1,onConfirm:o,onShowList:s}){let r=ct(),t=Hy(r);return e?_s(Ln,{onClick:()=>o(),children:"\uD655\uC778"}):pf(mf,{size:"small",variant:"outlined",color:"inherit",sx:t,onClick:n=>{n.stopPropagation(),s(n.currentTarget)},children:[l?_s($y,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,_s(hf,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:b>0&&h>=b?"\uD655\uC778\uC644\uB8CC":pf(Uy,{children:[h,_s(hf,{component:"span",sx:{mx:.15},children:"/"}),b]})})]})}import{SvgIcon as Vy}from"@mui/material";import{jsx as Na,jsxs as Ky}from"react/jsx-runtime";function jo({sx:e,...h}){return Ky(Vy,{viewBox:"0 0 48 48",...h,sx:{fill:"none",...e},children:[Na("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"}),Na("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Na("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Na("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as xf,jsx as Ge,jsxs as Ss}from"react/jsx-runtime";function La(e){let h=String(e??"").trim();if(!h)return"-";let b=h.slice(2,10).replaceAll("-","."),l=h.slice(11,16);return/^\d{2}:\d{2}$/.test(l)?`${b} ${l}`:b}function ox(e){let h=String(e.event_time??"").trim();return e.is_event&&/^\d{2}:\d{2}$/.test(h)?La(`${String(e.due_date??"").slice(0,10)} ${h}`):La(e.due_date)}function Ic(e,h){let b=String(e??"").trim()||"-";return Da(b,h).map((l,o)=>Ge("span",{className:l.highlight?"font-semibold text-blue-600":void 0,children:l.text},`${l.text}-${o}`))}function ja({names:e,searchText:h,avatarSrcByName:b,emphasize:l=!1}){let o=e.filter(s=>s.trim());if(o.length===0)return null;if(o.length===1){let s=o[0]??"";return Ss(xf,{children:[Ge(fn,{src:b?.get(s)??"",name:s,avatarSx:{width:24,height:24,fontSize:12,borderRadius:"50%",...Ri[0]},iconFontSize:15}),Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...l?{fontWeight:500,color:"#2f80ed"}:{}},children:Ic(s,h)})]})}return Ge(jr,{names:o,size:22,avatarSrcByName:b})}function bf({display:e,summary:h,searchText:b,avatarSrcByName:l}){if(!e||e.kind==="everyone")return Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:o,individualNames:s}=e;if(o.length===0)return Ge(ja,{names:s,searchText:b,avatarSrcByName:l});let r=[...o,...s],t=r.join(", ");return r.length>2?Ge(ks,{title:t,arrow:!0,children:Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${r[0]}, ${r[1]} \uC678 ${r.length-2}\uBA85`})}):Ge(ks,{title:t,arrow:!0,children:Ss(Et,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[Ge(Et,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.join(", ")+(s.length>0?",":"")}),s.length>0?Ge(ja,{names:s,searchText:b,avatarSrcByName:l}):null]})})}var yf=Gy(function({task:h,gridTemplate:b,statusOptions:l,avatarSrcByName:o,searchText:s,myAccountSeq:r=0,todayStr:t,showProject:n=!1,showManager:c=!0,showActions:i=!0,showRequest:a=!0,confirmMode:d="none",bugMode:f=!1,trashMode:u=!1,dimCompleted:g=!0,confirmInfo:m,onConfirmTask:x,projectLabel:_="",projectIcon:B="",onProjectClick:A,onRequestToggleCompleted:j,onDateClick:D,onChangeNote:P,onMemberClick:N,onClaimClick:q,onVolunteerClick:z,onStatusClick:T,onOpenDetail:C,onTaskContextMenu:R,hideBottomBorder:p=!1,completeLocked:y=!1,unread:v=!1,notice:w=!1,noticeReadOnly:k=!1,readOnly:S=!1,onIconClick:E,lastColumnCentered:L=!1,noteLocked:$=!1,targetSummary:U="",targetDisplay:O,onArchiveTask:W,ackInfo:M,onAckConfirm:I,onAckListClick:F,onPriorityClick:V}){let[Y,K]=gf(!1),[H,Z]=gf(""),J=Xy(null);Yy(()=>{if(!Y)return;let de=Ve=>{let Pe=J.current;Pe&&(Ve.target instanceof Node&&Pe.contains(Ve.target)||Pe.blur())};return document.addEventListener("mousedown",de,!0),document.addEventListener("touchstart",de,!0),()=>{document.removeEventListener("mousedown",de,!0),document.removeEventListener("touchstart",de,!0)}},[Y]);let G=[h.manager_account_seq??0,...h.receiver_account_seqs??[]].some(de=>de>0&&de!==(h.author_account_seq??0)),X=k||S,ee=r>0&&!h.is_notice&&!h.is_event&&(h.manager_account_seq??0)===r,ne=X||!!h.is_notice,re=ct(),oe=!!q&&Ra(h,r),se=!!z&&Oa(h,r),ge=ne&&!af(h),ve=h.is_notice?Ge(Oi,{canConfirm:!!M?.canAck,count:M?.count??0,total:M?.total??0,myConfirmed:!!M?.acked,onConfirm:()=>I?.(h),onShowList:de=>F?.(h,de)}):null,_e=!h.is_notice&&!h.completed&&!!h.due_date&&h.due_date.slice(0,10)<=t,De=Mi(h),pe=h.completed?re.colors.textPrimary:_e?"#e5484d":"#2f80ed";return Ss(Et,{onContextMenu:de=>R(h,de),sx:{display:"grid",gridTemplateColumns:b,minHeight:48,position:"relative",fontSize:15,bgcolor:re.table.rowBg,color:re.table.rowColor,borderBottom:p?"none":`1px solid ${re.table.rowBorderColor}`,"&:hover":{bgcolor:re.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${re.table.rowBorderColor}`},"& > .cell:first-of-type":{px:1.5},"& > .cell:last-of-type":{borderRight:"none",pr:2,...L?{pl:2}:{}}},children:[Ge(Et,{className:"cell",sx:{justifyContent:"center"},children:h.is_event?(()=>{let de=wt(h.icon||ar);if(!de)return null;let Ve=Ge(de,{sx:{fontSize:19,color:h.icon_color||"#1e3a8a"}});return X||!E?Ve:Ge(ks,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Ge(Jy,{onClick:Pe=>{Pe.stopPropagation(),E(h,Pe.currentTarget)},sx:{p:.25,borderRadius:1,"&:hover":{bgcolor:re.table.cellHoverBg}},children:Ve})})})():!k&&!y&&!u?Ge(ks,{title:h.completed&&h.completed_by?`${h.completed_by} \xB7 ${on(h.completed_time)} \uC644\uB8CC`:h.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Ge(Qy,{checked:h.completed,inputProps:{"aria-label":h.completed?`${h.title} \uC644\uB8CC \uD574\uC81C`:`${h.title} \uC644\uB8CC \uCC98\uB9AC`},icon:Ge(nx,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:Ge(rx,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:de=>de.stopPropagation(),onChange:(de,Ve)=>j({anchorEl:de.currentTarget,task:h,nextCompleted:Ve}),sx:{p:.5}})}):null}),f?Ge(Et,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:h.ticket_no||"-"}):null,Ss(Et,{className:"cell",onClick:()=>C(h),sx:{gap:1,pl:2,cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}},children:[(()=>{if(!h.is_notice)return null;let de=wt(h.icon||or);return de?Ge(de,{sx:{fontSize:18,flexShrink:0,color:h.icon_color||"#e5484d"}}):null})(),(()=>{if(h.is_notice)return null;let de=kn(h);return de==="involved"?null:Ge(ks,{title:de==="all"?"\uC804\uCCB4\uACF5\uAC1C \u2014 \uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4":"\uBD80\uC11C\uACF5\uAC1C \u2014 \uC9C0\uC815\uD55C \uBD80\uC11C\uC758 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",arrow:!0,disableInteractive:!0,children:de==="all"?Ge(ex,{sx:{fontSize:15,flexShrink:0,color:"#2f80ed"}}):Ge(tx,{sx:{fontSize:15,flexShrink:0,color:"#d9730d"}})})})(),Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:h.completed&&g?400:re.table.rowTitleFontWeight,color:h.completed&&g?re.colors.textMuted:re.table.rowTitleColor,textDecoration:h.completed&&g?"line-through":"none"},children:Ic(h.title,s)}),De?Ge(Et,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:re.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:De}):null,(h.comment_count??h.comments?.length??0)>0?Ge(jo,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,Ge(Et,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:Ge(No,{labelKeys:h.label_keys??[],labelOptions:l})}),v&&!h.completed?Ge(Et,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,Ta(h)&&!h.archived&&!X&&W?Ge(Zy,{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:de=>{de.stopPropagation(),W(h)},children:"\uBCF4\uAD00"}):null]}),(()=>{let de=X||!!h.is_event||!!h.completed;return Ge(Et,{className:"cell",onClick:de?void 0:Ve=>T(h,Ve.currentTarget),sx:{py:.5,justifyContent:"center",...de?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:h.is_event?(()=>{let Ve=vs(h);return Ve?Ge(At,{option:Ve}):null})():Ge(At,{option:lr(h)})})})(),Ge(Et,{className:"cell",onClick:X?void 0:de=>D(h,"start_date",de.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:La(h.start_date)}),Ge(Et,{className:"cell",onClick:X?void 0:de=>D(h,"due_date",de.currentTarget),sx:{justifyContent:"center",color:pe,fontWeight:500,whiteSpace:"nowrap",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:h.due_date?ox(h):null}),w?Ge(Et,{className:"cell",onClick:X?void 0:()=>N(h,"targets"),sx:{gap:.75,...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(bf,{display:O,summary:U,searchText:s,avatarSrcByName:o})}):null,!w&&h.is_notice?Ge(Et,{className:"cell",onClick:X?void 0:()=>N(h,"targets"),sx:{gridColumn:c?"span 2":"auto",gap:.75,...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(bf,{display:O,summary:U,searchText:s,avatarSrcByName:o})}):null,!w&&!h.is_notice&&!h.is_event&&c?Ge(Et,{className:"cell",onClick:ge?void 0:()=>N(h,"manager"),sx:{gap:.75,...oe||se?{justifyContent:"center"}:{},...ge?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:oe?Ge(Ln,{onClick:de=>q?.(h,de.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):se?Ge(Ln,{onClick:de=>z?.(h,de.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):Ge(ja,{names:h.manager_name?[h.manager_name]:[],searchText:s,avatarSrcByName:o,emphasize:ee})}):null,!w&&!h.is_notice?Ge(Et,{className:"cell",onClick:ne?void 0:()=>N(h,"receivers"),sx:{gridColumn:h.is_event&&c?"span 2":"auto",gap:.75,...ne?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(ja,{names:h.receiver_names,searchText:s,avatarSrcByName:o})}):null,Ge(Et,{className:"cell",onClick:X?void 0:de=>V?.(h,de.currentTarget),sx:{py:.5,justifyContent:"center",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:Ge(Lr,{priority:h.priority,plain:!0})}),n?Ge(Et,{className:"cell",onClick:X?void 0:de=>A?.(h,de.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...X?{}:{cursor:"pointer","&:hover":{bgcolor:re.table.cellHoverBg}}},children:_?Ss(xf,{children:[(()=>{let de=wt(B);return de?Ge(de,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_})]}):null}):null,w?Ge(Et,{className:"cell",sx:{justifyContent:"center"},children:ve}):null,!w&&i&&a?Ge(Et,{className:"cell",sx:{justifyContent:"center"},children:h.is_notice?ve:G?Ge(Oi,{canConfirm:!!m?.canConfirm,count:m?.count??0,total:m?.total??0,myConfirmed:!!m?.myTime,onConfirm:()=>x?.(h),onShowList:de=>F?.(h,de)}):null}):null,!w&&d==="action"?Ge(Et,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:re.table.rowSubColor},children:h.is_notice?ve:m&&m.total>0?Ge(Oi,{canConfirm:!!m.canConfirm,count:m.count,total:m.total,myConfirmed:!!m.myTime,onConfirm:()=>x?.(h),onShowList:de=>F?.(h,de)}):"-"}):null,!w&&!i?Ge(Et,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:u?re.colors.danger:g?re.table.rowSubColor:re.table.rowTitleColor},children:u?La(h.deleted_time):h.completed_time||"-"}):null,f?null:Ge(Et,{className:"cell",onClick:()=>{!$&&!Y&&(Z(h.note),K(!0))},sx:{color:"#6f6f6c",cursor:$?"default":"text"},children:Y?Ge(Et,{component:"input",ref:J,autoFocus:!0,spellCheck:!1,value:H,onChange:de=>Z(de.target.value),onBlur:()=>{K(!1),H.trim()!==h.note&&P(h.seq,H)},onKeyDown:de=>{de.key==="Enter"&&de.target.blur(),de.key==="Escape"&&(Z(h.note),K(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:re.table.rowTitleColor,caretColor:re.table.rowTitleColor,p:0,m:0}}):Ge(Et,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.note?Ic(h.note,s):""})}),ee?Ge(Et,{component:"span",sx:{position:"absolute",left:3,top:6,bottom:6,width:3,bgcolor:"#2f80ed",borderRadius:1.5,pointerEvents:"none"}}):null]})});import{jsx as sx}from"react/jsx-runtime";var vf=ix(function(h){let l=(h.useTaskItem?h.useTaskItem(h.task.seq):void 0)??h.task,{myAccountSeq:o}=h,s=h.projectByKey.get(l.tab_key??"");return sx(yf,{hideBottomBorder:h.hideBottomBorder,gridTemplate:h.gridTemplate,task:l,statusOptions:h.statusOptions,avatarSrcByName:h.avatarSrcByName,searchText:h.searchText,myAccountSeq:o,todayStr:h.todayStr,showProject:h.showProject,showManager:h.showManager,showActions:h.showActions,showRequest:h.showRequest,confirmMode:h.confirmMode,confirmInfo:l.is_notice?void 0:h.getConfirmInfo?.(l),onConfirmTask:h.onConfirmTask,projectLabel:s?.label??"",projectIcon:s?.icon??"",onProjectClick:h.onProjectClick,onRequestReply:h.onRequestReply,onRequestToggleCompleted:h.onRequestToggleCompleted,onDateClick:h.onDateClick,onChangeNote:h.onChangeNote,onMemberClick:h.onMemberClick,onClaimClick:h.onClaimClick,onVolunteerClick:h.onVolunteerClick,onStatusClick:h.onStatusClick,onOpenDetail:h.onOpenDetail,onTaskContextMenu:h.onTaskContextMenu,notice:h.notice,bugMode:h.bugMode,trashMode:h.trashMode,dimCompleted:h.dimCompleted,noticeReadOnly:!lo(l,o),readOnly:h.readOnly,noteLocked:h.readOnly||(l.is_notice?!Ma(l,o):!lo(l,o)),completeLocked:l.is_event?!0:l.is_notice?(l.author_account_seq??0)!==o:(l.author_account_seq??0)!==o&&(l.manager_account_seq??0)!==o,targetSummary:l.is_notice?h.getTargetSummary?.(l):void 0,targetDisplay:l.is_notice?h.getTargetDisplay?.(l):void 0,onArchiveTask:h.onArchiveTask,unread:h.isTaskUnread?.(l)??!1,ackInfo:l.is_notice?h.getAckInfo?.(l):void 0,onAckConfirm:h.onAckConfirm,onAckListClick:h.onAckListClick,onPriorityClick:h.onPriorityClick,onIconClick:h.onIconClick,lastColumnCentered:h.lastColumnCentered})});import{useMemo as wf,useState as Mc}from"react";import{Box as oi,Button as _f,ButtonBase as kf,Dialog as cx,Divider as Rc,Menu as ux,MenuItem as dx,Popover as fx}from"@mui/material";import Sf from"@mui/icons-material/ChevronRight";import hx from"@mui/icons-material/Check";import px from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as mx,TimePicker as gx}from"@ehfuse/mui-datetime-picker";import bx from"@mui/icons-material/TimerOutlined";import{useEffect as ax,useState as lx}from"react";function jn(e){let{loadHolidays:h}=Sr(),[b,l]=lx(()=>new Map),o=e.join(",");return ax(()=>{if(!h||!o){l(new Map);return}let s=!1;return h(o.split(",").map(Number)).then(r=>{if(s)return;let t=new Map;for(let n of r)t.has(n.date)||t.set(n.date,n.name);l(t)}).catch(()=>{}),()=>{s=!0}},[h,o]),b}var Ec=["min30_before","hour1_before","hour2_before","same_day","day_before","two_days_before","three_days_before","week_before"];function zn(e){let h=Array.isArray(e?.reminders)?e?.reminders:[e?.reminder],b=new Set;for(let l of h){let o=String(l??"").trim();Ec.includes(o)&&b.add(o)}return Ec.filter(l=>b.has(l))}function za(e,h){if(h==="none")return[];let b=e.includes(h)?e.filter(l=>l!==h):[...e,h];return Ec.filter(l=>b.includes(l))}import{Fragment as Tf,jsx as Ir,jsxs as Sn}from"react/jsx-runtime";var yx=9,xx=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],Cf=[{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"}],Bf=[{value:"none",label:"\uC5C6\uC74C"},...xx,...Cf];function Oc(e){return e?Bf:[{value:"none",label:"\uC5C6\uC74C"},...Cf]}function vx(e){return e==="same_day"?"\uB2F9\uC77C":Bf.find(h=>h.value===e)?.label??"\uC5C6\uC74C"}function Ac(e){if(e.length===0)return"\uC5C6\uC74C";let h=e.map(b=>vx(b));return h.length<=3?h.join(", "):`${h.slice(0,3).join(", ")} \uC678 ${h.length-3}`}function wx(e){let h=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(h.getTime())?new Date:h}function pn({anchorEl:e,open:h,date:b,reminders:l,hideReminder:o=!1,showTime:s=!1,centered:r=!1,onClose:t,onDateChange:n,onReminderChange:c}){let[i,a]=Mc(null),[d,f]=Mc(null),u=Nn(),g=String(b??"").trim().slice(0,10),m=String(b??"").trim().slice(11,16),x=/^\d{2}:\d{2}$/.test(m)?m:"",_=(T,C)=>n(C?`${T} ${C}`:T),{defaultDueHour:B}=Sr(),A=`${String(Number.isInteger(B)&&B>=0&&B<=23?B:yx).padStart(2,"0")}:00`,[j,D]=Mc(()=>{let T=Number(g.slice(0,4));return Number.isFinite(T)&&T>1900?T:new Date().getFullYear()}),P=wf(()=>[j-1,j,j+1],[j]),N=jn(P),q=wf(()=>{let T=[];for(let C of N.keys()){let R=new Date(`${C}T00:00:00`);Number.isNaN(R.getTime())||T.push(R)}return T},[N]),z=Sn(oi,{sx:{width:300,maxWidth:"100%"},children:[Ir(oi,{sx:{height:320},children:Ir(mx,{selectedDate:wx(g),onSelect:T=>{_(gr(T),s?x||A:x),s||t()},onClose:t,showFooter:!1,autoApply:!0,holidays:q,onYearChange:T=>D(T),onMonthChange:(T,C)=>{typeof C=="number"&&D(C)}})}),s?Sn(Tf,{children:[Ir(Rc,{sx:{borderColor:"#e6e6e3"}}),Sn(kf,{onClick:T=>f(T.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Ir(bx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC2DC\uAC01"]}),Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[x||"\uC5C6\uC74C",Ir(Sf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Ir(gx,{anchorEl:d,open:!!d,onClose:()=>f(null),centered:r,value:{hour:x.slice(0,2)||A.slice(0,2),minute:x.slice(3,5)||"00"},format:"HH:mm",minuteStep:5,autoApply:!0,locale:"ko",onChange:(T,C)=>{_(g||gr(new Date),`${T}:${C}`),f(null)}})]}):null,o?null:Sn(Tf,{children:[Ir(Rc,{sx:{borderColor:"#e6e6e3"}}),Sn(kf,{onClick:T=>a(T.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Ir(px,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC0AC\uC804\uC54C\uB9BC"]}),Sn(oi,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[Ac(l),Ir(Sf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Ir(ux,{transitionDuration:0,anchorEl:i,open:!!i,onClose:()=>a(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...u,children:Oc(!!x).map(T=>{let C=T.value==="none"?l.length===0:l.includes(T.value);return Sn(dx,{selected:C,onClick:()=>{c(za(l,T.value)),T.value==="none"&&a(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[T.label,C?Ir(hx,{sx:{fontSize:16,color:"#2f80ed"}}):null]},T.value)})})]}),Ir(Rc,{sx:{borderColor:"#e6e6e3"}}),Sn(oi,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[Ir(_f,{size:"small",onClick:()=>{_(gr(new Date),x),t()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),Ir(_f,{size:"small",onClick:t,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return r?Ir(cx,{open:h,onClose:t,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:z}):Ir(fx,{transitionDuration:0,open:h,anchorEl:e,onClose:t,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:z})}import{useEffect as Sx,useState as Pc}from"react";import{Box as ii,Button as Tx,Switch as Cx}from"@mui/material";import{FormDialog as Bx}from"@ehfuse/mui-form-dialog";import{ClearTextField as Ix}from"@ehfuse/mui-form-controls";import{ErrorAlert as Ex}from"@ehfuse/alerts";import{Box as _x,ButtonBase as kx}from"@mui/material";import{jsx as Dc}from"react/jsx-runtime";function Fa({value:e,onChange:h}){return Dc(_x,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:ac.map(({key:b,Icon:l})=>{let o=b===e;return Dc(kx,{onClick:()=>h(b),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:o?"2px solid #2563eb":"1px solid #dedddb",bgcolor:o?"#eef4ff":"#fff",color:o?"#1e3a8a":"#787774","&:hover":{bgcolor:o?"#eef4ff":"#f4f4f2"}},children:Dc(l,{sx:{fontSize:20}})},b)})})}import{jsx as co,jsxs as Nc}from"react/jsx-runtime";function qa({open:e,title:h="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:b="",initialIcon:l=sc,confirmText:o="\uCD94\uAC00",initialUseSprints:s=!1,onClose:r,onSubmit:t}){let[n,c]=Pc(""),[i,a]=Pc(sc),[d,f]=Pc(!1);Sx(()=>{e&&(c(b),a(l),f(s))},[e]);let u=()=>{let m=n.trim();if(!m){Ex("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(m,i,d),r()};return co(Bx,{open:e,onClose:r,maxWidth:"xs",title:h,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:Nc(ii,{children:[co(Ix,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:n,onChange:m=>c(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),u())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),co(ii,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),co(ii,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:co(Fa,{value:i,onChange:a})}),Nc(ii,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[Nc(ii,{children:[co(ii,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),co(ii,{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)"})]}),co(Cx,{checked:d,onChange:(m,x)=>f(x)})]})]})}],actions:{showCancelButton:!0,right:co(Tx,{variant:"contained",onClick:u,children:o})}})}import{Box as Mx}from"@mui/material";import{jsx as Rx}from"react/jsx-runtime";function $a({size:e=40}){return Rx(Mx,{sx:{boxSizing:"border-box",width:e,height:e,borderRadius:"50%",border:"4px solid rgba(28, 64, 125, 0.14)",borderTopColor:"#1c407d",animation:"taskbox-content-loading-spin 0.75s linear infinite","@keyframes taskbox-content-loading-spin":{to:{transform:"rotate(360deg)"}}}})}import{Box as Lc,ButtonBase as Ox,Divider as Ax,Popover as Dx}from"@mui/material";import Px from"@mui/icons-material/Check";import Nx from"@ehfuse/overlay-scrollbar";import{jsx as si,jsxs as If}from"react/jsx-runtime";var jc=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function zo({anchorEl:e,value:h,color:b="",onSelect:l,onSelectColor:o,onClose:s}){return si(Dx,{transitionDuration:0,open:!!e,anchorEl:e,onClose:s,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:If(Lc,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[si(Nx,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:si(Fa,{value:h||so,onChange:r=>{l(r),s()}})}),o?If(Lc,{sx:{px:1.25,pb:1.25},children:[si(Ax,{sx:{mb:1,borderColor:"#efefed"}}),si(Lc,{sx:{display:"grid",gridTemplateColumns:`repeat(${jc.length}, 1fr)`,justifyItems:"center"},children:jc.map(r=>{let t=(b||jc[0])===r;return si(Ox,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${r}`,onClick:()=>o(r),sx:{width:"100%",maxWidth:26,aspectRatio:"1 / 1",borderRadius:"50%",bgcolor:r,display:"flex",alignItems:"center",justifyContent:"center"},children:t?si(Px,{sx:{fontSize:15,color:"#ffffff"}}):null},r)})})]}):null]})})}import{jsx as gt,jsxs as Tn}from"react/jsx-runtime";var Rf=48,Yx=5;function Of({tasks:e,statusOptions:h,avatarSrcByName:b,searchText:l,todayStr:o,sortBy:s,sortDirection:r,onSort:t,onRequestReply:n,onToggleCompleted:c,onChangeTaskDate:i,onChangeTaskReminder:a,groupBy:d,collapsedGroupKeys:f,customTabs:u,onToggleGroup:g,hideCompleted:m=!1,loading:x=!1,dimCompleted:_=!0,readOnly:B=!1,onChangeTaskIcon:A,onChangeTaskIconColor:j,onAddInGroup:D,canAddInGroup:P,renderGroupSummary:N,renderGroupTitleSummary:q,onChangeTaskProject:z,onAddProject:T,onChangeNote:C,onMemberClick:R,onClaimTask:p,onChangeTaskStatus:y,onOpenDetail:v,onTaskContextMenu:w,onMemberFilterClick:k,activeMemberFilters:S=[],onStatusFilterClick:E,statusFilterActive:L=!1,onAckFilterClick:$,ackFilterActive:U=!1,onProjectFilterClick:O,projectFilterActive:W=!1,onPriorityFilterClick:M,priorityFilterActive:I=!1,columns:F,getConfirmInfo:V,onConfirmTask:Y,myAccountSeq:K=0,currentUserName:H="",groupManagerByMyRole:Z=!1,allowManagerVolunteer:J=!0,noticeAdmin:G=!1,getTargetSummary:X,getTargetDisplay:ee,onArchiveTask:ne,isTaskUnread:re,getAckInfo:oe,onAckConfirm:se,onAckListClick:ge,onChangeTaskPriority:ve,onEndReached:_e,useTaskItem:De}){let pe=ct(),de=qn(()=>({showManager:!0,showActions:!0,showRequest:!0,...F}),[F]),Ve=de.showManager??!0,Pe=de.showActions??!0,ie=de.showRequest??!0,Be=de.confirmMode??"none",ye=de.notice??!1,xe=de.bug??!1,Ze=de.trash??!1,Te=d!=="none",ce=qn(()=>Te?wc(e,d,o,u,h,H,{enabled:Z,myAccountSeq:K}):[],[Te,e,d,o,u,h,H,Z,K]),Re=qn(()=>m?e.filter(he=>!he.completed):e,[e,m]),Se=qn(()=>Re.filter(he=>he.completed||he.archived?!1:he.is_notice?!!oe?.(he).canAck:!!V?.(he).canConfirm),[Re,oe,V]),Ce=qn(()=>new Set(Se.map(he=>he.seq)),[Se]),lt=qn(()=>ce.map(he=>({section:he,visibleTasks:he.tasks.filter(Oe=>!Ce.has(Oe.seq)&&(!m||!Oe.completed))})).filter(he=>he.visibleTasks.length>0),[ce,m,Ce]),Le=qn(()=>new Set(f),[f]),qe=qn(()=>{let he=[];if(Te)for(let{section:Oe,visibleTasks:at}of lt){let sr=Le.has(Oe.key);if(he.push({kind:"header",section:Oe,visibleTasks:at,collapsed:sr}),!sr)for(let Xr of at)he.push({kind:"task",task:Xr,last:!1})}else for(let Oe of Re)Ce.has(Oe.seq)||he.push({kind:"task",task:Oe,last:!1});for(let Oe=he.length-1;Oe>=0;Oe-=1){let at=he[Oe];if(at.kind==="task"){at.last=!0;break}}return he},[Te,lt,Re,Le,Ce]),kt=de.showProject??(!ye&&d!=="tab"),$e=qn(()=>Tc({...de,showProject:kt}),[de,kt]),Ne=tf({...de,showProject:kt}),vt=$e[$e.length-1]?.align==="center",et=qn(()=>{let he=new Map;for(let Oe of u)he.set(Oe.key,{label:Oe.archived?`${Oe.label} (\uBCF4\uAD00\uB428)`:Oe.label,icon:Oe.icon});return he},[u]),Ke=Lx(null),[bt,tt]=$n(null),te=Re.length>0;Ha(()=>{if(!te){tt(null);return}let he=window.requestAnimationFrame(()=>{tt(Ke.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(he)},[te]);let ue=`${d}|${s}|${r}|${l}|${m?1:0}`;Ha(()=>{bt&&(bt.scrollTop=0)},[ue,bt]);let[me,ke]=$n(!1);Ha(()=>{if(!bt)return;let he=()=>ke(bt.scrollHeight-bt.clientHeight>4),Oe=window.requestAnimationFrame(he),at=new ResizeObserver(he);return at.observe(bt),bt.firstElementChild&&at.observe(bt.firstElementChild),()=>{window.cancelAnimationFrame(Oe),at.disconnect()}},[bt,qe.length,f.length]),Ha(()=>{if(!bt)return;let he=bt.clientHeight,Oe=new ResizeObserver(()=>{let at=bt.clientHeight;at!==he&&(he=at,bt.dispatchEvent(new Event("scroll")))});return Oe.observe(bt),()=>Oe.disconnect()},[bt]);let[Je,Me]=$n(null),[Ae,yt]=$n(null),[We,Ie]=$n(null),[Ue,rt]=$n(null),[dt,St]=$n(!1),[Rt,xt]=$n(null),Qt=Rt?e.find(he=>he.seq===Rt.taskSeq)??null:null,[Nt,Vt]=$n(null),Q=Nt?e.find(he=>he.seq===Nt.taskSeq)??null:null,[le,be]=$n(null),fe=le?e.find(he=>he.seq===le.taskSeq)??null:null,Ee=Fn((he,Oe)=>{be({anchorEl:Oe,taskSeq:he.seq})},[]),je=Fn((he,Oe)=>{Vt({anchorEl:Oe,taskSeq:he.seq})},[]),ze=Fn((he,Oe)=>{xt({anchorEl:Oe,taskSeq:he.seq})},[]),ae=Fn((he,Oe)=>{if(!Oe)return;t(he,s===he&&r==="asc"?"desc":"asc")},[t,s,r]),Fe=Fn((he,Oe,at)=>{Me({anchorEl:at,taskSeq:he.seq,field:Oe,date:he[Oe],isEvent:!!he.is_event,reminders:zn(he),completed:he.completed})},[]),Ye=Fn((he,Oe)=>{rt({anchorEl:Oe,task:he})},[]),Qe=Fn(he=>{Je&&(i(Je.taskSeq,Je.field,he),Me(Oe=>Oe&&{...Oe,date:he}))},[Je,i]),qt=Fn(he=>{Je&&(a(Je.taskSeq,he),Me(Oe=>Oe&&{...Oe,reminders:he}))},[Je,a]),Kt=Fn((he,Oe)=>{Ie({anchorEl:Oe,taskSeq:he.seq,title:he.title,kind:"claim"})},[]),Tt=Fn((he,Oe)=>{Ie({anchorEl:Oe,taskSeq:he.seq,title:he.title,kind:"volunteer"})},[]),It=(he,Oe)=>gt(vf,{task:he,hideBottomBorder:Oe,gridTemplate:Ne,useTaskItem:De,statusOptions:h,avatarSrcByName:b,searchText:l,myAccountSeq:K,todayStr:o,showProject:kt,showManager:Ve,showActions:Pe,showRequest:ie,confirmMode:Be,notice:ye,bugMode:xe,trashMode:Ze,dimCompleted:_,readOnly:B,projectByKey:et,getConfirmInfo:V,onConfirmTask:Y,onProjectClick:Ye,onRequestReply:n,onRequestToggleCompleted:yt,onDateClick:Fe,onChangeNote:C,onMemberClick:R,onClaimClick:p?Kt:void 0,onVolunteerClick:J?Tt:void 0,onStatusClick:ze,onOpenDetail:v,onTaskContextMenu:w,onPriorityClick:je,onIconClick:A?Ee:void 0,lastColumnCentered:vt,getTargetSummary:X,getTargetDisplay:ee,getAckInfo:oe,isTaskUnread:re,onArchiveTask:ne,onAckConfirm:se,onAckListClick:ge},he.seq);return Tn(Er,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${pe.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:pe.table.bg,color:pe.table.rowColor,...pe.table.sx},children:[gt(Er,{sx:{display:"grid",gridTemplateColumns:Ne,borderBottom:`1px solid ${pe.table.borderColor}`,flexShrink:0,bgcolor:pe.table.headerBg,"& > *":{borderRight:`1px solid ${pe.table.rowBorderColor}`},"& > *:first-of-type":{px:1.5},"& > *:last-child":{borderRight:"none",pr:2,...vt?{pl:2}:{}},...pe.table.headerSx},children:$e.map(he=>{let Oe=s===he.id,at=!!he.memberFilter,sr=at&&S.includes(he.memberFilter),Xr=at||!!he.statusFilter||!!he.ackFilter||!!he.projectFilter||!!he.priorityFilter,no=sr||!!he.statusFilter&&L||!!he.ackFilter&&U||!!he.projectFilter&&W||!!he.priorityFilter&&I;return Tn(Er,{onClick:dn=>{he.memberFilter?k(he.memberFilter,dn.currentTarget):he.statusFilter?E(dn.currentTarget):he.ackFilter?$?.(dn.currentTarget):he.projectFilter?O?.(dn.currentTarget):he.priorityFilter?M?.(dn.currentTarget):ae(he.id,he.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:he.align==="center"?"center":"flex-start",gap:.5,px:1,...he.id==="title"?{pl:2}:{},py:1,minWidth:0,fontSize:pe.table.headerFontSize,color:he.sortable||Xr?pe.table.headerActiveColor:pe.table.headerColor,whiteSpace:"nowrap",cursor:he.sortable||Xr?"pointer":"default",userSelect:"none",...Oe?{color:pe.table.headerFilteredColor}:{},...no?{color:pe.table.headerFilteredColor,fontWeight:600}:{}},children:[he.icon,he.label,no?gt(Ux,{sx:{fontSize:14}}):null,Oe?r==="asc"?gt(qx,{sx:{fontSize:13}}):gt($x,{sx:{fontSize:13}}):null]},he.id)})}),Se.length>0?Tn(Er,{sx:{flexShrink:0,maxHeight:`${pe.table.groupHeader.minHeight+1+Rf*Yx}px`,overflowY:"auto",borderBottom:"1px solid #000"},children:[Tn(Er,{sx:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:pe.table.groupHeader.minHeight,bgcolor:"#fdf3f2",borderBottom:"1px solid #f2d7d4"},children:[gt(Er,{component:"span",sx:{fontSize:pe.table.groupHeader.labelFontSize,fontWeight:pe.table.groupHeader.labelFontWeight,color:pe.table.groupHeader.labelColor},children:"\uBBF8\uD655\uC778"}),gt(Er,{sx:{ml:"auto",display:"flex",alignItems:"center",pr:.5},children:gt(Er,{component:"span",sx:{flexShrink:0,width:pe.table.groupHeader.badge.width,py:pe.table.groupHeader.badge.paddingY,borderRadius:`${pe.table.groupHeader.badge.borderRadius}px`,bgcolor:"#e5484d",color:"#fff",fontSize:pe.table.groupHeader.badge.fontSize,fontWeight:pe.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:Se.length})})]}),Se.map((he,Oe)=>It(he,Oe===Se.length-1))]}):null,Re.length===0&&x?gt(Er,{role:"status","aria-live":"polite","aria-label":"\uC5C5\uBB34 \uBAA9\uB85D\uC744 \uBD88\uB7EC\uC624\uB294 \uC911\uC785\uB2C8\uB2E4.",sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",py:8},children:gt($a,{})}):Re.length===0?gt(Er,{role:"status","aria-live":"polite",sx:{py:8,textAlign:"center",color:pe.table.emptyColor,fontSize:14},children:e.length>0?`\uC644\uB8CC\uB41C \uC5C5\uBB34 ${e.length}\uAC74\uC774 "\uC644\uB8CC \uC228\uAE30\uAE30"\uB85C \uAC10\uCDB0\uC838 \uC788\uC2B5\uB2C8\uB2E4.`:xe?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":ye?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):gt(Er,{sx:{flex:1,minHeight:0},children:gt(Gx,{ref:Ke,style:{height:"100%"},thumb:{width:8},scrollTopFab:!0,children:bt?gt(Kx,{customScrollParent:bt,data:qe,computeItemKey:(he,Oe)=>Oe.kind==="header"?`group:${Oe.section.key}`:Oe.task.seq,endReached:Te?void 0:_e,defaultItemHeight:Rf,increaseViewportBy:{top:600,bottom:600},itemContent:(he,Oe)=>{if(Oe.kind==="task")return It(Oe.task,Oe.last&&me);let{section:at,visibleTasks:sr,collapsed:Xr}=Oe;return Tn(Er,{onClick:()=>g(at.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:pe.table.groupHeader.minHeight,bgcolor:pe.table.groupHeader.bg,borderBottom:`1px solid ${pe.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:pe.table.groupHeader.hoverBg},...pe.table.groupHeader.sx},children:[Xr?gt(Wx,{sx:{fontSize:20,color:pe.colors.textMuted}}):gt(Hx,{sx:{fontSize:20,color:pe.colors.textMuted}}),gt(Er,{component:"span",sx:{fontSize:pe.table.groupHeader.labelFontSize,fontWeight:pe.table.groupHeader.labelFontWeight,color:pe.table.groupHeader.labelColor},children:at.label}),q?gt(Er,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:q(at.key,at.tasks)}):null,D&&(!P||P(at.key))?gt(zx,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:no=>{no.stopPropagation(),D(at.key,at.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:pe.colors.textSecondary,"&:hover":{bgcolor:pe.colors.surfaceHover,color:pe.colors.accentOnSurface}},children:gt(Mf,{sx:{fontSize:21}})}):null,Tn(Er,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[N?N(at.key,at.tasks):null,gt(Er,{component:"span",sx:{flexShrink:0,width:pe.table.groupHeader.badge.width,py:pe.table.groupHeader.badge.paddingY,borderRadius:`${pe.table.groupHeader.badge.borderRadius}px`,bgcolor:pe.table.groupHeader.badge.bg,border:pe.table.groupHeader.badge.border,color:pe.table.groupHeader.badge.color,fontSize:pe.table.groupHeader.badge.fontSize,fontWeight:pe.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:sr.length})]})]})}},ue):null})}),gt(Ei,{anchorEl:Rt?.anchorEl??null,value:Qt?.status??"",options:Qt?Ba(Qt):xs,onSelect:he=>{Qt&&y(Qt.seq,he)},onClose:()=>xt(null)}),gt(Ef,{transitionDuration:0,anchorEl:Nt?.anchorEl??null,open:!!Nt,onClose:()=>Vt(null),children:["high","medium","low"].map(he=>Tn(Wa,{selected:Q?.priority===he,onClick:()=>{Q&&ve?.(Q.seq,he),Vt(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[gt(Lr,{priority:he,small:!0}),Q?.priority===he?gt(zc,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},he))}),Tn(Ef,{anchorEl:Ue?.anchorEl??null,open:!!Ue,onClose:()=>rt(null),transitionDuration:0,children:[Tn(Wa,{selected:!Ue?.task.tab_key,onClick:()=>{Ue&&z(Ue.task.seq,""),rt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[gt(Vx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",Ue?.task.tab_key?null:gt(zc,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),u.filter(he=>!he.archived).map(he=>{let Oe=wt(he.icon),at=Ue?.task.tab_key===he.key;return Tn(Wa,{selected:at,onClick:()=>{Ue&&z(Ue.task.seq,he.key),rt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Oe?gt(Oe,{sx:{fontSize:17,color:"#1e3a8a"}}):null,he.label,at?gt(zc,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},he.key)}),T?[gt(jx,{},"add-project-divider"),Tn(Wa,{onClick:()=>St(!0),sx:{fontSize:14,color:"#787774"},children:[gt(Fx,{children:gt(Mf,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),T?gt(qa,{open:dt,onClose:()=>St(!1),onSubmit:(he,Oe)=>{let at=Ue?.task.seq??0;(async()=>{let sr=await T(he,Oe);sr&&at&&z(at,sr)})(),rt(null)}}):null,gt(zo,{anchorEl:le?.anchorEl??null,value:fe?.icon??"",color:fe?.icon_color??"",onSelect:he=>{le&&A?.(le.taskSeq,he),be(null)},onSelectColor:j?he=>{le&&j(le.taskSeq,he)}:void 0,onClose:()=>be(null)}),gt(pn,{anchorEl:Je?.anchorEl??null,open:!!Je&&Je?.field==="start_date",date:Je?.date??"",reminders:[],hideReminder:!0,showTime:!Je?.isEvent,onClose:()=>Me(null),onDateChange:Qe,onReminderChange:()=>{}}),gt(pn,{anchorEl:Je?.anchorEl??null,open:!!Je&&Je?.field==="due_date",date:Je?.date??"",showTime:!Je?.isEvent,reminders:Je?.reminders??[],hideReminder:!!Je?.completed,onClose:()=>Me(null),onDateChange:Qe,onReminderChange:qt}),gt(Dt,{open:!!We,anchorEl:We?.anchorEl??null,title:We?.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:()=>Ie(null),onConfirm:()=>{We&&p?.(We.taskSeq),Ie(null)}}),gt(Dt,{open:!!Ae,anchorEl:Ae?.anchorEl??null,title:Ae?.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:Ae?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>yt(null),onConfirm:()=>{Ae&&c(Ae.task,Ae.nextCompleted),yt(null)}})]})}import{useCallback as Wn,useMemo as fo,useRef as y2,useState as ho}from"react";import{Box as jt,ButtonBase as Vf,Divider as Nf,IconButton as Lf,Menu as jf,MenuItem as Fo}from"@mui/material";import Hc from"@mui/icons-material/Add";import zf from"@mui/icons-material/MoreVert";import Ff from"@mui/icons-material/EditOutlined";import qf from"@mui/icons-material/ArchiveOutlined";import $f from"@mui/icons-material/UnarchiveOutlined";import x2 from"@mui/icons-material/NotificationsOutlined";import v2 from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as Xx}from"@mui/material";import{jsx as Af}from"react/jsx-runtime";function cr({sx:e,...h}){return Af(Xx,{viewBox:"0 0 24 24",...h,sx:{fill:"none",...e},children:Af("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 w2,DragOverlay as _2,PointerSensor as k2,pointerWithin as S2,rectIntersection as T2,useDroppable as C2,useSensor as B2,useSensors as I2}from"@dnd-kit/core";import{SortableContext as Kf,arrayMove as Hf,horizontalListSortingStrategy as E2,useSortable as M2,verticalListSortingStrategy as R2}from"@dnd-kit/sortable";import{CSS as O2}from"@dnd-kit/utilities";import Wc from"@ehfuse/overlay-scrollbar";import{useState as n2}from"react";import{Box as uo,ButtonBase as o2,Checkbox as i2,Tooltip as s2}from"@mui/material";import a2 from"@mui/icons-material/AlarmOutlined";import l2 from"@mui/icons-material/TimerOutlined";import{Box as Cn,Button as Zx,Popover as Jx}from"@mui/material";import Qx from"@mui/icons-material/CheckCircle";import{Fragment as e2,jsx as Hn,jsxs as ai}from"react/jsx-runtime";function Ua({anchorEl:e,open:h,acks:b,total:l,avatarSrcByName:o,pendingNames:s=[],onRequestConfirm:r,onClose:t}){let n=Lt();return Hn(Jx,{open:h&&(n||!!e),anchorEl:e,onClose:t,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...n?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:ai(Cn,{sx:{minWidth:240,maxWidth:320,py:1},children:[ai(Cn,{sx:{px:2,pb:.75,fontSize:kr(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",b.length,"/",l]}),s.length>0&&b.length>0?ai(Cn,{sx:{px:2,pt:1,pb:.5,fontSize:kr(12.5),fontWeight:600,color:"#9a9a97"},children:["\uD655\uC778 ",b.length]}):null,b.length===0?s.length>0?null:Hn(Cn,{sx:{px:2,py:1.5,fontSize:kr(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(c=>ai(Cn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[Hn(jr,{names:[c.name],size:22,avatarSrcByName:o}),Hn(Cn,{component:"span",sx:{fontSize:kr(14),color:"#37352f",whiteSpace:"nowrap"},children:c.name}),Hn(Cn,{component:"span",sx:{ml:"auto",fontSize:kr(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:on(c.time)}),Hn(Qx,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},c.account_seq)),s.length>0?ai(e2,{children:[ai(Cn,{sx:{mt:b.length>0?.75:0,px:2,pt:1,pb:.5,borderTop:b.length>0?"1px solid #efefed":"none",fontSize:kr(12.5),fontWeight:600,color:"#9a9a97"},children:["\uBBF8\uD655\uC778 ",s.length]}),s.map(c=>ai(Cn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[Hn(jr,{names:[c],size:22,avatarSrcByName:o}),Hn(Cn,{component:"span",sx:{fontSize:kr(14),color:"#37352f",whiteSpace:"nowrap"},children:c})]},c))]}):null,r?Hn(Cn,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:Hn(Zx,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{r(),t()},sx:{fontSize:kr(13)},children:"\uD655\uC778 \uC694\uCCAD"})}):null]})})}function t2(e){let h=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(b=>b>0&&b!==h))]}function r2(e){let h=new Map,b=Number(e.manager_account_seq??0);b>0&&h.set(b,String(e.manager_name??"").trim());let l=e.receiver_account_seqs??[],o=e.receiver_names??[];return l.forEach((s,r)=>{s>0&&!h.has(s)&&h.set(s,String(o[r]??"").trim())}),h}function Va(e,h){let b=t2(e),l=e.acks??[],o=h>0?l.find(t=>t.account_seq===h):void 0,s=new Set(l.map(t=>t.account_seq)),r=r2(e);return{myTime:o?.time??"",canConfirm:h>0&&b.includes(h)&&!o,count:l.filter(t=>b.includes(t.account_seq)).length,total:b.length,pendingNames:b.filter(t=>!s.has(t)).map(t=>r.get(t)??"").filter(t=>t.length>0)}}function eM(e){let h=String(e??"").trim();return h?h.slice(5,16).replaceAll("-","."):""}import{Fragment as f2,jsx as zr,jsxs as li}from"react/jsx-runtime";function Ka(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}}var c2=3;function u2(e){let h=e.trim();return h?h.slice(2,10).replaceAll("-","."):"-"}function d2(){let e=new Date,h=String(e.getMonth()+1).padStart(2,"0"),b=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${h}-${b}`}function Ts({task:e,statusOptions:h,showDueDate:b=!1,onRequestArchiveToggle:l,onRequestReply:o,onDueDateClick:s,titleFontSize:r=13}){let t=ct(),n=Mi(e),i=!!e.due_date&&e.due_date.slice(0,10)<=d2()?t.colors.danger:t.colors.accentOnSurface,a=Va(e,0),[d,f]=n2(null),u=Ii(e,h),g=new Set(e.label_keys??[]),m=u.filter(_=>!g.has(_.key)),x=u.filter(_=>g.has(_.key));return li(f2,{children:[li(uo,{sx:{display:"flex",alignItems:"flex-start",gap:.5},children:[zr(i2,{size:"small",checked:e.completed,inputProps:{"aria-label":e.completed?`${e.title} \uC644\uB8CC \uD574\uC81C`:`${e.title} \uC644\uB8CC \uCC98\uB9AC`},onPointerDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),onChange:(_,B)=>l?.({anchorEl:_.currentTarget,taskSeq:e.seq,nextCompleted:B}),sx:{p:0}}),zr(s2,{title:e.title,arrow:!0,enterDelay:300,children:li(uo,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:r,fontWeight:t.mode==="dark"||e.completed?400:500,color:t.mode==="dark"?t.colors.textStrong:t.colors.textPrimary,lineHeight:1.35,overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:c2,overflowWrap:"anywhere",textDecoration:e.completed?"line-through":"none"},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})}),n?zr(uo,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:t.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:n}):null,(e.comment_count??e.comments?.length??0)>0?zr(jo,{sx:{fontSize:15,flexShrink:0,color:t.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?zr(uo,{sx:{pl:3,mt:-.5,fontSize:12.5,color:t.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,li(uo,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[li(uo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[m.map(_=>zr(At,{option:_,small:!0},_.key)),zr(Lr,{priority:e.priority,small:!0}),x.map(_=>zr(At,{option:_,small:!0},_.key))]}),b&&String(e.due_date??"").trim()?li(o2,{disabled:!s,onPointerDown:_=>_.stopPropagation(),onClick:_=>{_.stopPropagation(),s?.(e,_.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:i,whiteSpace:"nowrap","&:hover":s?{bgcolor:t.colors.border}:void 0},children:[u2(e.due_date),zr(a2,{sx:{fontSize:15}})]}):null]}),b&&(e.due_date.slice(11,16)||e.estimated_time)?li(uo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:t.colors.textSecondary},children:[zr(l2,{sx:{fontSize:14}}),e.due_date.slice(11,16)||e.estimated_time]}):null,zr(jr,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),a.total>0?zr(uo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:zr(uo,{sx:{flexShrink:0,width:64},onPointerDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),children:zr(Oi,{canConfirm:!1,count:a.count,total:a.total,onConfirm:()=>{},onShowList:_=>f(_)})})}):null,zr(Ua,{anchorEl:d,open:!!d,acks:e.acks??[],total:a.total,pendingNames:a.pendingNames,onRequestConfirm:o&&a.count<a.total?()=>{o(e),f(null)}:void 0,onClose:()=>f(null)})]})}import{Box as h2}from"@mui/material";import{useSortable as p2}from"@dnd-kit/sortable";import{CSS as m2}from"@dnd-kit/utilities";import{jsx as Df}from"react/jsx-runtime";function g2(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function Pf({task:e,statusOptions:h,variant:b="card",showDueDate:l=!1,onRequestArchiveToggle:o,onRequestReply:s,onDueDateClick:r,onCardClick:t,onCardContextMenu:n,titleFontSize:c}){let i=ct(),{attributes:a,listeners:d,setNodeRef:f,transform:u,transition:g,isDragging:m}=p2({id:String(e.seq)}),x=b==="list";return Df(h2,{ref:f,...a,...d,onClick:t?()=>t(e):void 0,onContextMenu:n?_=>n(e,_):void 0,sx:{...x?g2(i.card):Ka(i.card),opacity:m?.35:e.completed?.55:1,transform:m2.Translate.toString(u),transition:g,position:"relative",cursor:"default",touchAction:"none","&:hover":x?{bgcolor:i.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:Df(Ts,{task:e,statusOptions:h,showDueDate:l,onRequestArchiveToggle:o,onRequestReply:s,onDueDateClick:r,titleFontSize:c})})}function b2(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function mn(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let h=b2(e.end_date);return h?`${e.name} (~${h})`:e.name}import{jsx as nt,jsxs as Ht}from"react/jsx-runtime";var Wf=2,Ga="group-",gn="colmove-",Fc="__default__",qc=bc,$c="__other__",Ya="sprint-",Uf=`${Ya}0`,A2={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function Gf(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 D2({column:e,tasks:h,statusOptions:b,onRequestArchiveToggle:l,onRequestReply:o,onDueDateClick:s,onAddTask:r,canAdd:t,onOpenMenu:n,onCardClick:c,onCardContextMenu:i,grow:a,summary:d,onOpenSprintMenu:f}){let u=ct(),{setNodeRef:g,isOver:m}=C2({id:`${Ga}${e.key}`}),{attributes:x,listeners:_,setNodeRef:B,transform:A,transition:j,isDragging:D}=M2({id:`${gn}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return Ht(jt,{ref:P=>{g(P),B(P)},sx:{flex:a?"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:m?u.colors.accentSoft:u.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:O2.Translate.toString(A),...j?{transition:`${j}, background-color 0.15s`}:{},opacity:D?.6:1},children:[Ht(jt,{...x,..._,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${u.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?nt(jt,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let P=wt(e.icon);return P?nt(P,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),nt(jt,{component:"span",sx:{fontSize:u.board.columnHeaderFontSize,fontWeight:700,color:u.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),nt(jt,{component:"span",sx:{...Gf(u.board.badge),ml:"auto"},children:h.length}),e.sprint&&f?nt(Lf,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>f(P.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:nt(zf,{sx:{fontSize:18}})}):e.locked?null:nt(Lf,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>n({anchorEl:P.currentTarget,column:e}),sx:{color:"#9a9a97"},children:nt(zf,{sx:{fontSize:18}})})]}),d?nt(jt,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${u.card.borderColor}`,flexShrink:0},children:d}):null,nt(jt,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:nt(Wc,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Ht(jt,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[nt(Kf,{items:h.map(P=>String(P.seq)),strategy:R2,children:h.map(P=>nt(Pf,{task:P,statusOptions:b,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:l,onRequestReply:o,onDueDateClick:s,onCardClick:c,onCardContextMenu:i},P.seq))}),h.length===0&&!t?nt(jt,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,h.length===0&&t?nt(jt,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:Ht(Vf,{className:"taskbox-board-add",onClick:()=>r(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${u.card.borderColor}`,bgcolor:u.card.bg,color:u.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:u.card.hoverBg}},children:[nt(Hc,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function Uc({tasks:e,statusOptions:h,customTabs:b,mode:l="active",onToggleCompleted:o,onRequestReply:s,onChangeDueDate:r,onChangeReminder:t,onMoveTask:n,columnAxis:c="project",statusColumns:i=[],onMoveTaskStatus:a,sprintColumns:d=[],onMoveTaskSprint:f,onAddGroup:u,onAddTask:g,canAdd:m=!0,onRequestRename:x,onArchiveProject:_,onDeleteProject:B,onReorderProjects:A,onOpenDetail:j,onTaskContextMenu:D,hideCompleted:P=!1,renderColumnSummary:N,onEditSprint:q,onChangeSprintStatus:z,onRemoveSprint:T}){let C=ct(),[R,p]=ho(null),[y,v]=ho(null),[w,k]=ho(null),[S,E]=ho(null),[L,$]=ho(null),[U,O]=ho(null),[W,M]=ho(null),[I,F]=ho(null),[V,Y]=ho(null),K=y2(!1),H=fo(()=>new Map(e.map(ce=>[ce.seq,ce])),[e]),Z=fo(()=>{let ce=e.filter(Re=>Re.is_notice);return ce.sort((Re,Se)=>Re.completed!==Se.completed?Re.completed?1:-1:Se.seq-Re.seq),ce},[e]),J=fo(()=>b.filter(ce=>!ce.archived),[b]),G=fo(()=>b.filter(ce=>ce.archived),[b]),X=ce=>({key:ce.key,label:ce.label,icon:ce.icon,isDefault:!1,isArchived:ce.archived}),ee=fo(()=>new Set(i.map(ce=>ce.key)),[i]),ne=fo(()=>new Set(d.map(ce=>ce.seq)),[d]),re=fo(()=>{if(c==="sprint")return[{key:Uf,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...d.map(ce=>({key:`${Ya}${ce.seq}`,label:mn(ce),icon:"",isDefault:!1,isArchived:!1,dot:A2[ce.status],locked:!0,sprint:ce}))];if(c==="status"){let ce=i.map(Re=>({key:Re.key,label:Re.name,icon:"",isDefault:!1,isArchived:!1,dot:Re.dot,locked:!0}));return ce.some(Re=>Re.key===qc)?ce:[...ce,{key:qc,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return l==="archived"?G.map(X):[{key:Fc,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...J.map(X)]},[c,i,d,l,J,G]),oe=I2(B2(k2,{activationConstraint:{distance:5}})),se=Wn(ce=>{let Re=String(ce.active.id).startsWith(gn),Se=S2(ce),Ce=Se.length>0?Se:T2(ce);if(Re)return Ce.filter(qe=>String(qe.id).startsWith(gn));let lt=Ce.filter(qe=>!String(qe.id).startsWith(gn)),Le=lt.filter(qe=>!String(qe.id).startsWith(Ga));return Le.length>0?Le:lt},[]),ge=fo(()=>{let ce=new Map;for(let Re of e){if(Re.is_notice)continue;let Se;if(c==="sprint"){let lt=Re.sprint_seq??0;Se=ne.has(lt)?`${Ya}${lt}`:Uf}else Se=c==="status"?Re.completed?qc:ee.has(String(Re.status??""))?String(Re.status??""):$c:Re.tab_key?.trim()||Fc;let Ce=ce.get(Se);Ce?Ce.push(Re):ce.set(Se,[Re])}for(let Re of ce.values())Re.sort((Se,Ce)=>{if(Se.completed!==Ce.completed)return Se.completed?1:-1;let lt=(Se.group_sort_no??0)>0,Le=(Ce.group_sort_no??0)>0;return lt&&Le?(Se.group_sort_no??0)-(Ce.group_sort_no??0):lt!==Le?lt?-1:1:Se.due_date!==Ce.due_date?Se.due_date<Ce.due_date?-1:1:Se.seq-Ce.seq});return ce},[e,c,ee,ne]),ve=fo(()=>c!=="status"||(ge.get($c)??[]).length===0?re:[...re,{key:$c,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[c,re,ge]),_e=Wn(ce=>W?(W.get(ce)??[]).map(Re=>H.get(Re)).filter(Re=>!!Re):ge.get(ce)??[],[W,H,ge]),De=Wn(ce=>{let Re=_e(ce);return P?Re.filter(Se=>!Se.completed):Re},[_e,P]),pe=Wn(ce=>{let Re=String(ce.active.id);if(Re.startsWith(gn)){Y(Re.slice(gn.length));return}F(Number(Re)),M(new Map(re.map(Se=>[Se.key,(ge.get(Se.key)??[]).map(Ce=>Ce.seq)])))},[re,ge]),de=Wn((ce,Re)=>{if(ce.startsWith(Ga))return{key:ce.slice(Ga.length),overSeq:null};let Se=Number(ce);for(let[Ce,lt]of Re)if(lt.includes(Se))return{key:Ce,overSeq:Se};return null},[]),Ve=Wn(ce=>{let{active:Re,over:Se}=ce;!Se||String(Re.id).startsWith(gn)||M(Ce=>{if(!Ce)return Ce;let lt=Number(Re.id),Le=de(String(Se.id),Ce);if(!Le)return Ce;let qe=[...Ce.entries()].find(([,vt])=>vt.includes(lt))?.[0];if(!qe||qe===Le.key)return Ce;let kt=new Map(Ce);kt.set(qe,(kt.get(qe)??[]).filter(vt=>vt!==lt));let $e=[...kt.get(Le.key)??[]],Ne=$e.length;if(Le.overSeq!==null){let vt=$e.indexOf(Le.overSeq);vt!==-1&&(Ne=vt)}return $e.splice(Ne,0,lt),kt.set(Le.key,$e),kt})},[de]),Pe=Wn(ce=>{let Re=String(ce.active.id);if(Re.startsWith(gn)){Y(null);let Ne=String(ce.over?.id??"");if(!Ne.startsWith(gn))return;let vt=Re.slice(gn.length),et=Ne.slice(gn.length);if(vt===et)return;let Ke=b.map(te=>te.key),bt=Ke.indexOf(vt),tt=Ke.indexOf(et);if(bt===-1||tt===-1)return;A(Hf(Ke,bt,tt));return}let Se=W;if(M(null),F(null),K.current=!0,!Se||!ce.over)return;let Ce=Number(Re),lt=[...Se.entries()].find(([,Ne])=>Ne.includes(Ce));if(!lt)return;let[Le,qe]=lt,kt=[...qe],$e=de(String(ce.over.id),Se);if($e&&$e.key===Le&&$e.overSeq!==null&&$e.overSeq!==Ce){let Ne=kt.indexOf(Ce),vt=kt.indexOf($e.overSeq);Ne!==-1&&vt!==-1&&(kt=Hf(kt,Ne,vt))}if(c==="status"){a?.(Ce,Le);return}if(c==="sprint"){f?.(Ce,Number(Le.slice(Ya.length))||0);return}n(Ce,Le===Fc?"":Le,kt)},[b,W,de,n,A,c,a,f]),ie=Wn(()=>{M(null),F(null),Y(null),K.current=!0},[]),Be=Wn(ce=>{if(K.current){K.current=!1;return}j(ce)},[j]),ye=I!==null?H.get(I)??null:null,xe=V!==null?re.find(ce=>ce.key===V)??null:null,Ze=Wn((ce,Re)=>{O({anchorEl:Re,taskSeq:ce.seq,date:ce.due_date,reminders:zn(ce)})},[]),Te=y?.column??null;return Ht(jt,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${C.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:Wf,bgcolor:C.colors.surfaceSubtle},children:[Ht(w2,{sensors:oe,collisionDetection:se,onDragStart:pe,onDragOver:Ve,onDragEnd:Pe,onDragCancel:ie,children:[nt(jt,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:l==="archived"&&re.length===0?nt(jt,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):nt(Wc,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:Ht(jt,{sx:{display:"flex",alignItems:"flex-start",gap:Wf,height:"100%",minWidth:"min-content",pb:.5},children:[l==="active"&&Z.length>0?Ht(jt,{sx:{flex:c!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:ce=>ce.shadows[1],bgcolor:C.card.bg,overflow:"hidden"},children:[Ht(jt,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${C.card.borderColor}`,flexShrink:0,minHeight:48},children:[nt(x2,{sx:{fontSize:17,color:"#e8763a"}}),nt(jt,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:C.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),Ht(jt,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",Z.length,")"]})]}),nt(jt,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:nt(Wc,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:nt(jt,{sx:{display:"flex",flexDirection:"column"},children:Z.map(ce=>Ht(jt,{onClick:()=>Be(ce),onContextMenu:Re=>D(ce,Re),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${C.card.borderColor}`,bgcolor:C.card.bg,cursor:"pointer","&:hover":{bgcolor:C.card.hoverBg}},children:[nt(Ts,{task:ce,statusOptions:h,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:p}),(()=>{let Re=(ce.target_names??[]).filter(Ce=>Ce.trim());if(Re.length===0)return null;let Se=Re.length>2?`${Re[0]}, ${Re[1]} \uC678 ${Re.length-2}`:Re.join(", ");return Ht(jt,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[nt(v2,{sx:{fontSize:14,flexShrink:0}}),nt(jt,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:Se})]})})()]},ce.seq))})})})]}):null,nt(Kf,{items:J.map(ce=>`${gn}${ce.key}`),strategy:E2,children:ve.map(ce=>nt(D2,{column:ce,tasks:De(ce.key),summary:N?.(ce.key,_e(ce.key)),onOpenSprintMenu:q||z||T?(Re,Se)=>k({anchorEl:Re,sprint:Se}):void 0,statusOptions:h,onRequestArchiveToggle:p,onRequestReply:s,onDueDateClick:Ze,onAddTask:g,canAdd:m&&c==="project",onOpenMenu:v,onCardClick:Be,onCardContextMenu:D,grow:c!=="project"},ce.key))}),l==="active"&&c==="project"?Ht(Vf,{onClick:u,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:[nt(Hc,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,l==="active"&&ve.length===0&&Z.length===0?nt(jt,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:c==="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]})})}),nt(_2,{children:ye?nt(jt,{sx:{...Ka,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:nt(Ts,{task:ye,statusOptions:h,showDueDate:!0,titleFontSize:15})}):xe?Ht(jt,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:C.card.bg,border:`1px solid ${C.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let ce=wt(xe.icon);return ce?nt(ce,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),nt(jt,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:C.board.columnHeaderColor},children:xe.label}),nt(jt,{component:"span",sx:Gf(C.board.badge),children:(ge.get(xe.key)??[]).length})]}):null})]}),Ht(jf,{transitionDuration:0,anchorEl:y?.anchorEl??null,open:!!y,onClose:()=>v(null),children:[Te&&!Te.isArchived&&m?Ht(Fo,{onClick:()=>{Te&&g(Te.isDefault?"":Te.key),v(null)},sx:{fontSize:14,gap:1},children:[nt(Hc,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,Te&&!Te.isDefault&&!Te.isArchived?Ht(Fo,{onClick:()=>{x(Te.key,Te.label,Te.icon),v(null)},sx:{fontSize:14,gap:1},children:[nt(Ff,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,Te&&!Te.isDefault&&!Te.isArchived?Ht(Fo,{onClick:()=>{_(Te.key,!0),v(null)},sx:{fontSize:14,gap:1},children:[nt(qf,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,Te&&Te.isArchived?Ht(Fo,{onClick:()=>{_(Te.key,!1),v(null)},sx:{fontSize:14,gap:1},children:[nt($f,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,Te&&!Te.isDefault?nt(Nf,{}):null,Te&&!Te.isDefault?Ht(Fo,{onClick:()=>{y&&$(y),v(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[nt(cr,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),Ht(jf,{transitionDuration:0,anchorEl:w?.anchorEl??null,open:!!w,onClose:()=>k(null),children:[q?Ht(Fo,{onClick:()=>{w&&q(w.sprint.seq),k(null)},sx:{fontSize:14,gap:1},children:[nt(Ff,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,z?Ht(Fo,{onClick:()=>{w&&z(w.sprint.seq,w.sprint.status==="closed"?"active":"closed"),k(null)},sx:{fontSize:14,gap:1},children:[w?.sprint.status==="closed"?nt($f,{sx:{fontSize:18,color:"#787774"}}):nt(qf,{sx:{fontSize:18,color:"#787774"}}),w?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,T?nt(Nf,{}):null,T?Ht(Fo,{onClick:()=>{w&&E(w),k(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[nt(cr,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),nt(Dt,{open:!!S,anchorEl:S?.anchorEl??null,title:`"${S?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>E(null),onConfirm:()=>{S&&T?.(S.sprint.seq),E(null)}}),nt(pn,{anchorEl:U?.anchorEl??null,open:!!U,date:U?.date??"",reminders:U?.reminders??[],onClose:()=>O(null),onDateChange:ce=>{U&&(r(U.taskSeq,ce),O(Re=>Re&&{...Re,date:ce}))},onReminderChange:ce=>{U&&(t(U.taskSeq,ce),O(Re=>Re&&{...Re,reminders:ce}))}}),nt(Dt,{open:!!L,anchorEl:L?.anchorEl??null,title:`"${L?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
30
+ \uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>$(null),onConfirm:()=>{L&&B(L.column.key),$(null)}}),nt(Dt,{open:!!R,anchorEl:R?.anchorEl??null,title:R?.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:R?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>p(null),onConfirm:()=>{R&&o(R.taskSeq,R.nextCompleted),p(null)}})]})}import{useCallback as mo,useMemo as Cs,useRef as Zf,useState as Bs}from"react";import{Box as mr,Button as W2,ButtonBase as Qf,IconButton as Jf}from"@mui/material";import U2 from"@mui/icons-material/Add";import V2 from"@mui/icons-material/ChevronLeft";import K2 from"@mui/icons-material/ChevronRight";import G2 from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Y2}from"@ehfuse/mui-datetime-picker";import{DndContext as X2,DragOverlay as Z2,PointerSensor as J2,pointerWithin as Q2,rectIntersection as ev,useDroppable as tv,useSensor as rv,useSensors as nv}from"@dnd-kit/core";import{SortableContext as ov,arrayMove as iv,useSortable as sv,verticalListSortingStrategy as av}from"@dnd-kit/sortable";import{CSS as lv}from"@dnd-kit/utilities";import cv from"@ehfuse/overlay-scrollbar";function P2(e){let[h,b,l]=e.split("-").map(Number),o=new Date(Date.UTC(h,b-1,l+1)),s=r=>String(r).padStart(2,"0");return`${o.getUTCFullYear()}-${s(o.getUTCMonth()+1)}-${s(o.getUTCDate())}`}function Ai(e){let h=new Map;for(let b of e){let l=b.start_date;for(let o=0;o<62&&l<=b.end_date;o+=1){let s=h.get(l);s?s.push(b):h.set(l,[b]),l=P2(l)}}for(let b of h.values())b.sort((l,o)=>(l.time||"99:99").localeCompare(o.time||"99:99")||l.title.localeCompare(o.title));return h}function Di(e){let h=String((e.is_event?e.event_time:e.due_date.slice(11,16)||e.estimated_time)??"").trim();return/^\d{1,2}:\d{2}$/.test(h)?h:""}function Pi(e,h){if(e.completed!==h.completed)return e.completed?1:-1;let b=Di(e),l=Di(h);if(!!b!=!!l)return b?-1:1;if(b&&l&&b!==l)return b<l?-1:1;let o=e.sort_no>0,s=h.sort_no>0;return o&&s?e.sort_no-h.sort_no:o!==s?o?-1:1:e.seq-h.seq}import{Box as Vc,Tooltip as N2}from"@mui/material";import{jsx as Kc,jsxs as L2}from"react/jsx-runtime";function Ni({event:e,small:h=!1}){let b=e.time?`${e.time} ${e.title}`:e.title,l=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",o=s=>{s.stopPropagation();let[r,t,n]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${r}/${t}/${n}`,"_blank")};return Kc(N2,{title:`(${l}) ${b}`,arrow:!0,enterDelay:300,children:L2(Vc,{onClick:o,onPointerDown:s=>s.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:h?.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:[Kc(Vc,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),Kc(Vc,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:b})]})})}import{useCallback as F2}from"react";import{Box as qo,Checkbox as q2}from"@mui/material";import{useLayoutEffect as j2,useState as Yf}from"react";var Yc=new WeakMap,Gc=null;function z2(){return typeof ResizeObserver>"u"?null:(Gc||(Gc=new ResizeObserver(e=>{for(let h of e){let b=Yc.get(h.target);if(!b)continue;let l=h.borderBoxSize?.[0]?.inlineSize??h.target.getBoundingClientRect().width;b(l)}})),Gc)}function Xf(){let[e,h]=Yf(null),[b,l]=Yf(0);return j2(()=>{if(!e)return;l(e.getBoundingClientRect().width);let o=z2();if(o)return Yc.set(e,s=>l(r=>Math.abs(r-s)<1?r:s)),o.observe(e),()=>{o.unobserve(e),Yc.delete(e)}},[e]),{ref:h,width:b}}import{jsx as po,jsxs as Xc}from"react/jsx-runtime";var Zc={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"},Li=15,$2=150,H2=3;function $o({task:e,statusOptions:h,onOpenDetail:b,onContextMenu:l,isPreview:o=!1,isDragging:s=!1,isMine:r=!1,avatarSrcByName:t,showManagerAvatar:n=!1,onOpenMembers:c,setNodeRef:i,dragProps:a,trailing:d,showCheckbox:f=!1,onRequestToggleCompleted:u,showTime:g=!0,wrapTitle:m=!1}){let x=ct(),_=x.mode==="dark",[B]=Ii(e,h),A=String(e.manager_name??"").trim(),j=g?Di(e):"",D=Mi(e),P=!e.completed&&!e.is_event&&!e.due_date.slice(0,10),N=e.is_notice||e.is_event?wt(e.icon||(e.is_notice?or:ar)):null,q=!e.completed&&!e.is_event&&!!e.due_date&&e.due_date.slice(0,10)<Zd(),{ref:z,width:T}=Xf(),C=T>0&&T<$2,R=C||m,p=F2(v=>{z(v),i?.(v)},[z,i]),y=n&&!r&&!C&&!!A;return Xc(qo,{ref:p,...a??{},onClick:v=>{v.stopPropagation(),b(e)},onContextMenu:l?v=>l(e,v):void 0,sx:{display:"flex",alignItems:R?"flex-start":"center",gap:.5,py:.6,px:1,flexShrink:0,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:B?_?Bi(B.dot,x.chip.darkBgAlpha):B.bg:_?x.card.bg:x.colors.surfaceHover,color:B?_?x.chip.darkTextSource==="fg"?B.fg:B.dot:B.fg:x.colors.textPrimary,fontSize:Li,fontWeight:_||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:o?.5:s?.35:e.completed?.6:P?.75:1,border:o?`1px dashed ${x.colors.accent}`:"1px solid transparent",pointerEvents:o?"none":"auto",cursor:"pointer",touchAction:a?"none":"auto",overflow:"hidden","&:hover":{filter:"brightness(0.96)"},...q?{borderLeft:`3px solid ${x.colors.danger}`,pl:.75}:r?{borderLeft:"3px solid #2f80ed",pl:.75}:{}},children:[po(qo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,...R?{mt:"7px"}:{},bgcolor:Zc[e.priority]??x.colors.accentOnSurface}}),f&&!C&&u?po(q2,{size:"small",checked:e.completed,onPointerDown:v=>v.stopPropagation(),onClick:v=>v.stopPropagation(),onChange:(v,w)=>u({anchorEl:v.currentTarget,taskSeq:e.seq,nextCompleted:w}),sx:{p:0,flexShrink:0}}):null,N&&!C?po(N,{sx:{fontSize:15,flexShrink:0,opacity:.75,...R?{mt:"3px"}:{}}}):null,Xc(qo,{sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",color:_?x.colors.textStrong:x.colors.textPrimary,...P&&!_?{color:x.colors.textSecondary}:{}},children:[C&&j?po(qo,{component:"span",sx:{lineHeight:1.35,fontSize:Li-1,color:e.completed?x.colors.textPrimary:x.colors.danger},children:j}):null,Xc(qo,{component:"span",sx:{minWidth:0,overflow:"hidden",...R?{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:H2,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.35}:{textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:[!C&&j?po(qo,{component:"span",sx:{mr:.5,fontSize:Li-1,color:e.completed?x.colors.textPrimary:x.colors.danger},children:j}):null,e.title,!C&&D?po(qo,{component:"span",sx:{ml:.5,fontSize:Li-2,color:x.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:D}):null,!C&&(e.comment_count??e.comments?.length??0)>0?po(jo,{sx:{fontSize:15,ml:.5,verticalAlign:"-2px",color:x.colors.textMuted}}):null]})]}),d??null,!d&&y?po(qo,{component:"span",onClick:c?v=>{v.stopPropagation(),c(e)}:void 0,sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:po(fn,{src:t?.get(A)??"",name:A,avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}import{jsx as Mt,jsxs as go}from"react/jsx-runtime";var eh=36,uv=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Za="day-";function Jc(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(h.getDate()-h.getDay()),h}function Xa(e,h){let b=new Date(e);return b.setDate(b.getDate()+h),b}function dv(e){let h=e[0],b=e[e.length-1];return h.getMonth()===b.getMonth()?`${h.getFullYear()}\uB144 ${h.getMonth()+1}\uC6D4`:h.getFullYear()===b.getFullYear()?`${h.getFullYear()}\uB144 ${h.getMonth()+1}\uC6D4 - ${b.getMonth()+1}\uC6D4`:`${h.getFullYear()}\uB144 ${h.getMonth()+1}\uC6D4 - ${b.getFullYear()}\uB144 ${b.getMonth()+1}\uC6D4`}function fv(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function hv({task:e,statusOptions:h,isMine:b,avatarSrcByName:l,onCardClick:o,onCardContextMenu:s,onRequestArchiveToggle:r,dragDisabled:t=!1}){let{attributes:n,listeners:c,setNodeRef:i,transform:a,transition:d,isDragging:f}=sv({id:String(e.seq),disabled:t});return Mt($o,{task:e,statusOptions:h,isMine:b,avatarSrcByName:l,showManagerAvatar:!0,wrapTitle:!0,onOpenDetail:u=>o?.(u),onContextMenu:s,showCheckbox:!0,onRequestToggleCompleted:r,isDragging:f,setNodeRef:i,dragProps:t?void 0:{...n,...c,style:{transform:lv.Translate.toString(a),transition:d}}})}function pv({dayKey:e,isToday:h,dayLabel:b,holidayName:l,tasks:o,googleEvents:s,statusOptions:r,onRequestArchiveToggle:t,onRequestReply:n,onAddSchedule:c,canAdd:i,onCardClick:a,onCardContextMenu:d,summary:f,myAccountSeq:u,avatarSrcByName:g,dragDisabled:m=!1}){let x=ct(),{setNodeRef:_}=tv({id:`${Za}${e}`,disabled:m});return go(mr,{ref:_,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:h?x.calendar.todayBg:x.calendar.cellBg},children:[go(mr,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:eh,bgcolor:h?x.calendar.todayBg:x.calendar.dateBandBg,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0},children:[l?Mt(mr,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:x.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l}):null,h?Mt(mr,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:x.colors.danger,color:x.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Mt(mr,{component:"span",sx:{fontSize:13.5,fontWeight:h?700:400,color:l?x.colors.danger:x.mode==="dark"?x.colors.textStrong:x.colors.textPrimary,flexShrink:0},children:b})]}),f?Mt(mr,{sx:{px:1,py:1,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0},children:f}):null,Mt(mr,{sx:{flex:1,minHeight:0,bgcolor:h?x.calendar.todayBg:x.colors.surfaceSubtle},children:Mt(cv,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:go(mr,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[s.length>0?Mt(mr,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:s.map(B=>Mt(Ni,{event:B},B.uid))}):null,Mt(ov,{items:o.map(B=>String(B.seq)),strategy:av,children:Mt(mr,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75},children:o.map(B=>Mt(hv,{task:B,statusOptions:r,isMine:u>0&&Number(B.manager_account_seq??0)===u,avatarSrcByName:g,onCardClick:a,onCardContextMenu:d,onRequestArchiveToggle:t,dragDisabled:m},B.seq))})}),Mt(mr,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...i?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:go(Qf,{className:"taskbox-add-schedule",onClick:()=>c(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.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:[Mt(U2,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function th({tasks:e,googleEvents:h=[],statusOptions:b,fallbackToStartDate:l=!1,myAccountSeq:o=0,avatarSrcByName:s,todayStr:r,onToggleCompleted:t,onMoveTask:n,onRequestReply:c,onAddSchedule:i,canAdd:a=!0,disableDrag:d=!1,onOpenDetail:f,onTaskContextMenu:u,hideCompleted:g=!1,renderColumnSummary:m}){let x=ct(),[_,B]=Bs(()=>Jc(new Date)),[A,j]=Bs(null),[D,P]=Bs(null),[N,q]=Bs(null),[z,T]=Bs(null),C=Zf(!1),R=Cs(()=>Array.from({length:7},(K,H)=>Xa(_,H)),[_]),p=Cs(()=>new Map(e.map(K=>[K.seq,K])),[e]),y=Cs(()=>[...new Set(R.map(K=>K.getFullYear()))],[R]),v=jn(y),w=nv(rv(J2,{activationConstraint:{distance:5}})),k=mo(K=>{let H=Q2(K),Z=H.length>0?H:ev(K),J=Z.filter(G=>!String(G.id).startsWith(Za));return J.length>0?J:Z},[]),S=Cs(()=>Ai(h),[h]),E=Cs(()=>{let K=new Map;for(let H of e){let Z=H.due_date.slice(0,10)||(l?H.start_date.slice(0,10)||String(H.created_time??"").slice(0,10):"");if(!Z)continue;let J=K.get(Z);J?J.push(H):K.set(Z,[H])}for(let H of K.values())H.sort(Pi);return K},[e,l]),L=mo(K=>N?(N.get(K)??[]).map(H=>p.get(H)).filter(H=>!!H):E.get(K)??[],[N,p,E]),$=mo(K=>{let H=L(K);return g?H.filter(Z=>!Z.completed):H},[L,g]),U=mo(K=>{T(Number(K.active.id)),q(new Map(R.map(H=>{let Z=gr(H);return[Z,(E.get(Z)??[]).map(J=>J.seq)]})))},[R,E]),O=mo((K,H)=>{if(K.startsWith(Za))return{day:K.slice(Za.length),overSeq:null};let Z=Number(K);for(let[J,G]of H)if(G.includes(Z))return{day:J,overSeq:Z};return null},[]),W=mo(K=>{let{active:H,over:Z}=K;Z&&q(J=>{if(!J)return J;let G=Number(H.id),X=O(String(Z.id),J);if(!X)return J;let ee=[...J.entries()].find(([,se])=>se.includes(G))?.[0];if(!ee||ee===X.day)return J;let ne=new Map(J);ne.set(ee,(ne.get(ee)??[]).filter(se=>se!==G));let re=[...ne.get(X.day)??[]],oe=re.length;if(X.overSeq!==null){let se=re.indexOf(X.overSeq);se!==-1&&(oe=se)}return re.splice(oe,0,G),ne.set(X.day,re),ne})},[O]),M=mo(K=>{let{active:H,over:Z}=K,J=N;if(q(null),T(null),C.current=!0,!J||!Z)return;let G=Number(H.id),X=[...J.entries()].find(([,se])=>se.includes(G));if(!X)return;let[ee,ne]=X,re=[...ne],oe=O(String(Z.id),J);if(oe&&oe.day===ee&&oe.overSeq!==null&&oe.overSeq!==G){let se=re.indexOf(G),ge=re.indexOf(oe.overSeq);se!==-1&&ge!==-1&&(re=iv(re,se,ge))}n(G,ee,re)},[N,n,O]),I=mo(()=>{q(null),T(null),C.current=!0},[]),F=mo(K=>{if(C.current){C.current=!1;return}f(K)},[f]),V=z!==null?p.get(z)??null:null,Y=Zf(null);return go(mr,{onTouchStart:K=>{let H=K.touches[0];Y.current=H?{x:H.clientX,y:H.clientY}:null},onTouchEnd:K=>{let H=Y.current;Y.current=null;let Z=K.changedTouches[0];if(!H||!Z||z!==null)return;let J=Z.clientX-H.x,G=Z.clientY-H.y;Math.abs(J)<60||Math.abs(J)<=Math.abs(G)||B(Xa(_,J<0?7:-7))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${x.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[go(mr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:x.calendar.bg,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0},children:[go(mr,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Mt(Jf,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>B(Xa(_,-7)),children:Mt(V2,{sx:{fontSize:24,color:x.colors.textSecondary}})}),Mt(W2,{size:"small",color:"inherit",onClick:()=>B(Jc(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:x.mode==="dark"?400:500,color:x.mode==="dark"?x.colors.textStrong:x.colors.textPrimary},children:"\uC624\uB298"}),Mt(Jf,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>B(Xa(_,7)),children:Mt(K2,{sx:{fontSize:24,color:x.colors.textSecondary}})})]}),go(Qf,{onClick:K=>P(K.currentTarget),sx:{ml:"auto",display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:x.mode==="dark"?400:700,color:x.mode==="dark"?x.colors.textStrong:x.colors.textPrimary,"&:hover":{bgcolor:x.colors.surfaceHover}},children:[dv(R),Mt(G2,{sx:{fontSize:18,color:x.colors.textMuted}})]})]}),Mt(mr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:x.calendar.headerBg,borderBottom:`1px solid ${x.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${x.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:R.map(K=>{let H=K.getDay(),Z=v.has(gr(K));return Mt(mr,{sx:{height:eh,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:H===0||Z?x.colors.danger:H===6?x.colors.accentOnSurface:x.colors.textSecondary},children:uv[H]},gr(K))})}),Mt(mr,{sx:{flex:1,minHeight:0},children:go(X2,{sensors:w,collisionDetection:k,onDragStart:U,onDragOver:W,onDragEnd:M,onDragCancel:I,children:[Mt(mr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${x.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:R.map(K=>{let H=gr(K);return Mt(pv,{dayKey:H,isToday:H===r,dayLabel:fv(K),holidayName:v.get(H)??"",summary:m?.(H,L(H)),tasks:$(H),googleEvents:S.get(H)??[],statusOptions:b,onRequestArchiveToggle:j,onRequestReply:c,onAddSchedule:i,canAdd:a,onCardClick:F,onCardContextMenu:u,myAccountSeq:o,avatarSrcByName:s,dragDisabled:d},H)})}),Mt(Z2,{children:V?Mt(mr,{sx:{boxShadow:"0 8px 20px rgba(0,0,0,0.18)",borderRadius:.75,cursor:"grabbing"},children:Mt($o,{task:V,statusOptions:b,onOpenDetail:()=>{},isMine:o>0&&Number(V.manager_account_seq??0)===o})}):null})]})}),Mt(Y2,{anchorEl:D,open:!!D,onClose:()=>P(null),selectedDate:_,onDateChange:K=>{B(Jc(K)),P(null)}}),Mt(Dt,{open:!!A,anchorEl:A?.anchorEl??null,title:A?.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:A?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>j(null),onConfirm:()=>{A&&t(A.taskSeq,A.nextCompleted),j(null)}})]})}import{useCallback as Is,useMemo as ci,useRef as mv,useState as Es}from"react";import{Box as Fr,Button as gv,ButtonBase as nh,IconButton as rh,Tooltip as bv}from"@mui/material";import yv from"@mui/icons-material/Add";import xv from"@mui/icons-material/ChevronLeft";import vv from"@mui/icons-material/ChevronRight";import wv from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as _v}from"@ehfuse/mui-datetime-picker";import{DndContext as kv,DragOverlay as Sv,PointerSensor as Tv,pointerWithin as Cv,rectIntersection as Bv,useDraggable as Iv,useDroppable as oh,useSensor as Ev,useSensors as Mv}from"@dnd-kit/core";import Rv from"@ehfuse/overlay-scrollbar";import{jsx as $t,jsxs as bo}from"react/jsx-runtime";var Ov=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ja="mday-",Qa="mchip-",ih=36;function Av(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(h.getDate()-h.getDay()),h}function el(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(1),h}function Dv(e,h){let b=new Date(e);return b.setDate(b.getDate()+h),b}function Qc(e,h){let b=el(e);return b.setMonth(b.getMonth()+h),b}function Pv({task:e,statusOptions:h,isPreview:b=!1,isMine:l=!1,avatarSrcByName:o,onOpenDetail:s,onContextMenu:r,onRequestToggleCompleted:t,dragDisabled:n=!1}){let{attributes:c,listeners:i,setNodeRef:a,isDragging:d}=Iv({id:String(e.seq),disabled:b||n}),{setNodeRef:f}=oh({id:`${Qa}${e.seq}`,disabled:b||n});return $t(bv,{title:e.title,arrow:!0,enterDelay:400,children:$t($o,{task:e,statusOptions:h,onOpenDetail:s,onContextMenu:r,showCheckbox:!!t,onRequestToggleCompleted:t,isPreview:b,isDragging:d,isMine:l,avatarSrcByName:o,showManagerAvatar:!0,wrapTitle:!0,setNodeRef:u=>{a(u),f(u)},dragProps:n?void 0:{...c,...i}})})}function Nv({dayKey:e,dayNumber:h,isToday:b,isOtherMonth:l,weekday:o,holidayName:s,tasks:r,googleEvents:t,statusOptions:n,previewSeq:c,myAccountSeq:i,avatarSrcByName:a,onRequestToggleCompleted:d,onOpenDetail:f,onTaskContextMenu:u,onAddSchedule:g,canAdd:m,dragDisabled:x=!1}){let _=ct(),B=_.mode==="dark",{setNodeRef:A,isOver:j}=oh({id:`${Ja}${e}`,disabled:x}),D=r,P=!!s||o===0;return bo(Fr,{ref:A,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:j?_.colors.accentSoft:b?_.calendar.todayBg:l?_.calendar.otherMonthBg:_.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...m?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[bo(Fr,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:ih,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:b?_.calendar.todayBg:_.calendar.dateBandBg,borderBottom:`1px solid ${_.calendar.borderColor}`},children:[s?$t(Fr,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:_.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}):null,b?$t(Fr,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:_.colors.danger,color:_.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,$t(Fr,{component:"span",sx:{fontSize:13.5,fontWeight:b?700:400,color:l?_.colors.textMuted:P?_.colors.danger:o===6?_.colors.accentOnSurface:B?_.colors.textStrong:_.colors.textPrimary,flexShrink:0},children:h})]}),t.map(N=>$t(Ni,{event:N,small:!0},N.uid)),D.map(N=>$t(Pv,{task:N,statusOptions:n,isPreview:N.seq===c,isMine:i>0&&Number(N.manager_account_seq??0)===i,avatarSrcByName:a,onRequestToggleCompleted:d,onOpenDetail:f,onContextMenu:u,dragDisabled:x},N.seq)),$t(Fr,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:bo(nh,{className:"taskbox-month-add",onClick:()=>g(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${_.calendar.borderColor}`,bgcolor:_.calendar.cellBg,color:_.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:_.calendar.hoverBg}},children:[$t(yv,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function sh({tasks:e,googleEvents:h=[],statusOptions:b,fallbackToStartDate:l=!1,myAccountSeq:o=0,avatarSrcByName:s,onToggleCompleted:r,todayStr:t,onMoveTask:n,onAddSchedule:c,canAdd:i=!0,disableDrag:a=!1,onOpenDetail:d,onTaskContextMenu:f}){let u=ct(),g=u.mode==="dark",[m,x]=Es(()=>el(new Date)),[_,B]=Es(null),[A,j]=Es(null),[D,P]=Es(null),[N,q]=Es(null),z=ci(()=>{let F=Av(m);return Array.from({length:42},(V,Y)=>Dv(F,Y))},[m]),T=ci(()=>new Map(e.map(F=>[F.seq,F])),[e]),C=ci(()=>Ai(h),[h]),R=ci(()=>[...new Set(z.map(F=>F.getFullYear()))],[z]),p=jn(R),y=ci(()=>{let F=new Map;for(let V of e){let Y=V.due_date.slice(0,10)||(l?V.start_date.slice(0,10)||String(V.created_time??"").slice(0,10):"");if(!Y)continue;let K=F.get(Y);K?K.push(V):F.set(Y,[V])}for(let V of F.values())V.sort(Pi);return F},[e,l]),v=Mv(Ev(Tv,{activationConstraint:{distance:5}})),w=Is(F=>{let V=Cv(F),Y=V.length>0?V:Bv(F),K=Y.filter(H=>String(H.id).startsWith(Qa));return K.length>0?K:Y.filter(H=>String(H.id).startsWith(Ja))},[]),k=Is(F=>{P(Number(F.active.id))},[]),S=Is(F=>{q(F.over?String(F.over.id):null)},[]),E=ci(()=>{let F=new Map;for(let[V,Y]of y)for(let K of Y)F.set(K.seq,V);return F},[y]),L=D!==null?T.get(D)?.due_date.slice(0,10)??"":"",$=ci(()=>{if(D===null||!N)return null;if(N.startsWith(Qa)){let F=Number(N.slice(Qa.length)),V=E.get(F);if(!V)return null;let Y=(y.get(V)??[]).filter(H=>H.seq!==D),K=Y.findIndex(H=>H.seq===F);return{day:V,index:K===-1?Y.length:K}}if(N.startsWith(Ja)){let F=N.slice(Ja.length),V=(y.get(F)??[]).filter(Y=>Y.seq!==D);return{day:F,index:V.length}}return null},[D,E,N,y]),U=Is(F=>{let V=y.get(F)??[];if(D===null||!$)return V;let Y=T.get(D);if(!Y)return V;let K=V.filter(H=>H.seq!==D);return F===$.day?[...K.slice(0,$.index),Y,...K.slice($.index)]:F===L?K:V},[D,L,$,T,y]),O=Is(F=>{let V=D,Y=$;if(P(null),q(null),V===null||!Y)return;let K=(y.get(Y.day)??[]).filter(Z=>Z.seq!==V),H=[...K.slice(0,Y.index).map(Z=>Z.seq),V,...K.slice(Y.index).map(Z=>Z.seq)];n(V,Y.day,H)},[D,$,n,y]),W=D!==null?T.get(D)??null:null,M=`${m.getFullYear()}\uB144 ${m.getMonth()+1}\uC6D4`,I=mv(null);return bo(Fr,{onTouchStart:F=>{let V=F.touches[0];I.current=V?{x:V.clientX,y:V.clientY}:null},onTouchEnd:F=>{let V=I.current;I.current=null;let Y=F.changedTouches[0];if(!V||!Y||D!==null)return;let K=Y.clientX-V.x,H=Y.clientY-V.y;Math.abs(K)<60||Math.abs(K)<=Math.abs(H)||x(Qc(m,K<0?1:-1))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${u.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[bo(Fr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:u.calendar.bg,borderBottom:`1px solid ${u.calendar.borderColor}`,flexShrink:0},children:[bo(Fr,{sx:{display:"flex",alignItems:"center",gap:.25},children:[$t(rh,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>x(Qc(m,-1)),children:$t(xv,{sx:{fontSize:24,color:u.colors.textSecondary}})}),$t(gv,{size:"small",color:"inherit",onClick:()=>x(el(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:u.mode==="dark"?400:500,color:u.mode==="dark"?u.colors.textStrong:u.colors.textPrimary},children:"\uC624\uB298"}),$t(rh,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>x(Qc(m,1)),children:$t(vv,{sx:{fontSize:24,color:u.colors.textSecondary}})})]}),bo(nh,{onClick:F=>B(F.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:u.mode==="dark"?400:700,color:u.mode==="dark"?u.colors.textStrong:u.colors.textPrimary,"&:hover":{bgcolor:u.colors.surfaceHover}},children:[M,$t(wv,{sx:{fontSize:18,color:u.colors.textMuted}})]})]}),$t(Fr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:u.calendar.headerBg,borderBottom:`1px solid ${u.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${u.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Ov.map((F,V)=>$t(Fr,{sx:{height:ih,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:V===0?u.colors.danger:V===6?u.colors.accentOnSurface:u.colors.textSecondary},children:F},F))}),$t(Fr,{sx:{flex:1,minHeight:0},children:bo(kv,{sensors:v,collisionDetection:w,onDragStart:k,onDragOver:S,onDragEnd:O,onDragCancel:()=>{P(null),q(null)},children:[$t(Rv,{style:{height:"100%"},thumb:{width:8},children:$t(Fr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${u.calendar.borderColor}`,borderBottom:`1px solid ${u.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:z.map(F=>{let V=gr(F);return $t(Nv,{dayKey:V,dayNumber:F.getDate(),isToday:V===t,isOtherMonth:F.getMonth()!==m.getMonth(),weekday:F.getDay(),holidayName:p.get(V)??"",tasks:U(V),googleEvents:C.get(V)??[],statusOptions:b,previewSeq:$?.day===V?D:null,myAccountSeq:o,avatarSrcByName:s,onRequestToggleCompleted:r?j:void 0,onOpenDetail:d,onTaskContextMenu:f,onAddSchedule:c,canAdd:i,dragDisabled:a},V)})})}),$t(Sv,{children:W?bo(Fr,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:u.calendar.cellBg,border:`1px solid ${u.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:Li,fontWeight:500,color:u.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[$t(Fr,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:Zc[W.priority]}}),W.title]}):null})]})}),$t(Dt,{open:!!A,anchorEl:A?.anchorEl??null,title:A?.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:A?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>j(null),onConfirm:()=>{A&&r?.(A.taskSeq,A.nextCompleted),j(null)}}),$t(_v,{anchorEl:_,open:!!_,onClose:()=>B(null),selectedDate:m,onDateChange:F=>{x(el(F)),B(null)}})]})}import{useEffect as zv,useMemo as Ms,useRef as tu,useState as ru}from"react";import{Box as Mr,Button as Fv,IconButton as lh,useMediaQuery as qv}from"@mui/material";import $v from"@mui/icons-material/ChevronLeft";import Hv from"@mui/icons-material/ChevronRight";import Wv from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Uv}from"@ehfuse/mui-datetime-picker";import{Box as yo,Button as Lv,Dialog as jv}from"@mui/material";import{jsx as xo,jsxs as eu}from"react/jsx-runtime";function ah({task:e,avatarSrcByName:h,onClose:b}){let l=ct(),o=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 xo(jv,{open:!!e,onClose:b,maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:e?eu(yo,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:l.colors.surface},children:[xo(yo,{sx:{fontSize:15.5,fontWeight:600,color:l.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),o.map(s=>{let r=s.names.filter(t=>!!t);return eu(yo,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[xo(yo,{sx:{width:56,flexShrink:0,fontSize:13.5,color:l.colors.textSecondary,pt:.5},children:s.label}),xo(yo,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:r.length===0?xo(yo,{sx:{fontSize:14,color:l.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):r.map(t=>eu(yo,{sx:{display:"flex",alignItems:"center",gap:.75},children:[xo(fn,{src:h?.get(t)??"",name:t,avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),xo(yo,{sx:{fontSize:14.5,color:l.colors.textPrimary},children:t})]},`${s.label}-${t}`))})]},s.label)}),xo(yo,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:xo(Lv,{size:"small",color:"inherit",onClick:b,children:"\uB2EB\uAE30"})})]}):null})}import{jsx as br,jsxs as Un}from"react/jsx-runtime";var Vv=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function ch(e){let h=e?.parentElement??null;for(;h;){let b=window.getComputedStyle(h);if(/(auto|scroll)/.test(b.overflowY)&&h.scrollHeight>h.clientHeight)return h;h=h.parentElement}return null}var Kv="(min-width:600px)";function nu(e){let h=new Date(e);return h.setHours(0,0,0,0),h.setDate(1),h}function uh(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function dh({tasks:e,googleEvents:h=[],statusOptions:b,todayStr:l,onOpenDetail:o,onAddSchedule:s,myAccountSeq:r=0,avatarSrcByName:t,fallbackToStartDate:n=!1}){let c=ct(),i=qv(Kv),[a,d]=ru(()=>nu(new Date)),[f,u]=ru(!1),g=Ms(()=>{let C=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();return Array.from({length:C},(R,p)=>{let y=new Date(a.getFullYear(),a.getMonth(),p+1);return{ymd:uh(y),dayNumber:p+1,weekday:y.getDay()}})},[a]),m=Ms(()=>{let C=new Map;for(let R of e){let p=R.due_date.slice(0,10)||(n?R.start_date.slice(0,10)||String(R.created_time??"").slice(0,10):"");if(!p)continue;let y=C.get(p);y?y.push(R):C.set(p,[R])}for(let R of C.values())R.sort(Pi);return C},[e,n]),x=Ms(()=>n?e.filter(C=>!C.due_date.slice(0,10)&&!C.start_date.slice(0,10)&&!String(C.created_time??"").slice(0,10)).sort((C,R)=>C.completed!==R.completed?C.completed?1:-1:C.seq-R.seq):[],[e,n]),[_,B]=ru(null),A=Ms(()=>Ai(h),[h]),j=Ms(()=>[a.getFullYear()],[a]),D=jn(j),P=tu(null),N=l.slice(0,7)===uh(a).slice(0,7);zv(()=>{if(!N)return;let C=()=>{let y=P.current,v=ch(y);if(!v||!y)return;let w=y.getBoundingClientRect().top-v.getBoundingClientRect().top+v.scrollTop;v.scrollTop=Math.max(0,w-v.clientHeight/2+y.clientHeight/2)},R=setTimeout(C,100),p=setTimeout(C,400);return()=>{clearTimeout(R),clearTimeout(p)}},[N,a]);let q=tu(null),z=tu(null),T=C=>{d(p=>new Date(p.getFullYear(),p.getMonth()+C,1));let R=ch(q.current);R&&R.scrollTo({top:0,behavior:"auto"})};return Un(Mr,{ref:q,onTouchStart:C=>{let R=C.touches[0];z.current=R?{x:R.clientX,y:R.clientY}:null},onTouchEnd:C=>{let R=z.current;z.current=null;let p=C.changedTouches[0];if(!R||!p)return;let y=p.clientX-R.x,v=p.clientY-R.y;Math.abs(y)<60||Math.abs(y)<=Math.abs(v)||T(y<0?1:-1)},sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:c.colors.surface},children:[Un(Mr,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[br(lh,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>T(-1),children:br($v,{sx:{fontSize:24,color:c.colors.textSecondary}})}),br(Fv,{size:"small",color:"inherit",onClick:()=>d(nu(new Date)),sx:{minWidth:0,px:1,fontSize:15.5,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),br(lh,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>T(1),children:br(Hv,{sx:{fontSize:24,color:c.colors.textSecondary}})}),Un(Mr,{onClick:()=>u(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,cursor:"pointer"},children:[a.getFullYear(),"\uB144 ",a.getMonth()+1,"\uC6D4",br(Wv,{sx:{fontSize:20,color:c.colors.textMuted}})]})]}),Un(Mr,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${c.calendar.borderColor}`},children:[x.length>0?Un(Mr,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${c.calendar.borderColor}`},children:[Un(Mr,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:c.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",br("br",{}),"\uC5C6\uC74C"]}),br(Mr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:x.map(C=>br($o,{task:C,statusOptions:b,onOpenDetail:o,isMine:r>0&&Number(C.manager_account_seq??0)===r,avatarSrcByName:t,showManagerAvatar:!0,onOpenMembers:B},C.seq))})]}):null,g.map(({ymd:C,dayNumber:R,weekday:p})=>{let y=D.get(C)??"",v=C===l,w=!!y||p===0,k=m.get(C)??[],S=A.get(C)??[],E=k.length>0||S.length>0;return Un(Mr,{ref:v?P:void 0,onClick:s?()=>s(C):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:E?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${c.calendar.borderColor}`,...s?{cursor:"pointer"}:{}},children:[br(Mr,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:Un(Mr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.25,"@media (min-width:600px)":{flexDirection:"row",gap:.75}},children:[br(Mr,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:40,height:32,borderRadius:1,px:1.25,fontSize:22,fontWeight:500,color:v?c.colors.surface:w?c.colors.danger:p===6?c.colors.accentOnSurface:c.colors.textPrimary,bgcolor:v?c.colors.accentOnSurface:"transparent"},children:R}),br(Mr,{component:"span",sx:{fontSize:13,color:w?c.colors.danger:p===6?c.colors.accentOnSurface:c.colors.textSecondary},children:Vv[p]})]})}),Un(Mr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[S.map(L=>br(Ni,{event:L},L.uid)),k.map(L=>{let $=Di(L),U=br($o,{task:L,statusOptions:b,onOpenDetail:o,isMine:r>0&&Number(L.manager_account_seq??0)===r,avatarSrcByName:t,showManagerAvatar:!0,onOpenMembers:B,showTime:!i,wrapTitle:!0},L.seq);return i?Un(Mr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[br(Mr,{component:"span",sx:{width:44,flexShrink:0,textAlign:"right",fontSize:13.5,fontWeight:400,opacity:1,color:$?L.completed?c.colors.textPrimary:c.colors.danger:"transparent"},children:$||"00:00"}),br(Mr,{sx:{flex:1,minWidth:0},children:U})]},L.seq):U})]})]},C)})]}),br(ah,{task:_,avatarSrcByName:t,onClose:()=>B(null)}),br(Uv,{open:f,centered:!0,monthOnly:!0,onClose:()=>u(!1),selectedDate:a,onDateChange:C=>{d(nu(C)),u(!1)}})]})}import{useCallback as fh,useEffect as hh,useMemo as ou,useRef as rl,useState as nl}from"react";import{Box as ir,Tooltip as gh}from"@mui/material";import Gv from"@ehfuse/overlay-scrollbar";import Yv from"@mui/icons-material/CheckCircle";import Xv from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as Zv,PointerSensor as Jv,closestCenter as Qv,useSensor as ew,useSensors as tw}from"@dnd-kit/core";import{SortableContext as rw,arrayMove as nw,useSortable as ow,verticalListSortingStrategy as iw}from"@dnd-kit/sortable";import sw from"@mui/icons-material/DragIndicator";import{jsx as Gt,jsxs as Ho}from"react/jsx-runtime";var iu=36,aw=48,ph=40,lw=24,cw=4,uw=14,mh=36,dw=12.5,ji=220,fw={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function ui(e){let h=String(e??"").trim();if(!h)return null;let b=new Date(`${h}T00:00:00`);return Number.isNaN(b.getTime())?null:b}function tl(e,h){let b=new Date(e);return b.setDate(b.getDate()+h),b}function su(e,h){return Math.round((h.getTime()-e.getTime())/864e5)}function hw({task:e,dragHandle:h,onPointerDown:b,onClick:l}){let o=ct(),s=rl(null),[r,t]=nl("");return Gt(gh,{title:r,arrow:!0,enterDelay:300,children:Ho(ir,{onPointerDown:b,onClick:n=>l(e,n),onMouseEnter:()=>{let n=s.current;t(n&&n.scrollWidth>n.clientWidth?e.title:"")},sx:{width:ji,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:o.timeline.bg,borderRight:`1px solid ${o.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:o.mode==="dark"||e.completed?400:500,color:e.completed?o.colors.textMuted:o.mode==="dark"?o.colors.textStrong:o.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:o.colors.surfaceHover}},children:[h,Gt(ir,{ref:s,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function pw({id:e,showIndicator:h,children:b}){let l=ct(),{attributes:o,listeners:s,setNodeRef:r}=ow({id:e});return Ho(ir,{ref:r,sx:{position:"relative"},children:[h?Gt(ir,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:l.colors.accentOnSurface,zIndex:5}}):null,b({...o,...s})]})}function bh({tasks:e,todayStr:h,onOpenDetail:b,onToggleChecklist:l,onReorderTasks:o,onTaskContextMenu:s}){let r=ct(),t=ou(()=>[...e].sort((R,p)=>{let y=(R.timeline_sort_no??0)>0,v=(p.timeline_sort_no??0)>0;if(y&&v)return(R.timeline_sort_no??0)-(p.timeline_sort_no??0);if(y!==v)return y?-1:1;let w=R.due_date||R.start_date,k=p.due_date||p.start_date;return w!==k?w<k?-1:1:R.seq-p.seq}),[e]),[n,c]=nl(null),[i,a]=nl(null),d=tw(ew(Jv,{activationConstraint:{distance:4}})),f=fh(R=>{c(R.over?Number(R.over.id):null)},[]),u=fh(R=>{c(null),a(null);let{active:p,over:y}=R;if(!y||p.id===y.id)return;let v=t.map(S=>S.seq),w=v.indexOf(Number(p.id)),k=v.indexOf(Number(y.id));w===-1||k===-1||o(nw(v,w,k))},[t,o]),g=ou(()=>{let R=ui(h)??new Date,p=R,y=tl(R,21);for(let k of t){let S=ui(k.start_date)??ui(k.due_date),E=ui(k.due_date)??S;S&&S<p&&(p=S),E&&E>y&&(y=E)}let v=tl(p,-3),w=su(v,tl(y,3))+1;return Array.from({length:w},(k,S)=>tl(v,S))},[t,h]),m=g[0],x=g.findIndex(R=>gr(R)===h),{dayWidths:_,dayOffsets:B,gridWidth:A}=ou(()=>{let R=g.map((v,w)=>v.getDate()===1||w===0?aw:iu),p=[],y=0;for(let v of R)p.push(y),y+=v;return{dayWidths:R,dayOffsets:p,gridWidth:y}},[g]),j=ji+A,D=rl(null),P=R=>{D.current={x:R.clientX,y:R.clientY}},N=(R,p)=>{let y=D.current;D.current=null,!(y&&(Math.abs(p.clientX-y.x)>5||Math.abs(p.clientY-y.y)>5))&&b(R)},q=rl(null),[z,T]=nl(!1);hh(()=>{let R=q.current?.getScrollContainer();if(!R)return;let p=()=>T(R.scrollHeight>R.clientHeight);p();let y=new ResizeObserver(p);return y.observe(R),()=>y.disconnect()},[t.length]);let C=rl(!1);return hh(()=>{if(t.length===0||C.current)return;C.current=!0;let R=window.requestAnimationFrame(()=>{let p=q.current?.getScrollContainer();!p||x<0||(p.scrollLeft=Math.max(0,B[x]-iu*3))});return()=>window.cancelAnimationFrame(R)},[t.length]),Gt(ir,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${r.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:r.timeline.headerBg},children:Gt(ir,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:Gt(Gv,{ref:q,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:Ho(ir,{sx:{width:j,position:"relative",bgcolor:r.timeline.bg},children:[Ho(ir,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:r.timeline.headerBg,borderBottom:`1px solid ${r.timeline.gridColor}`},children:[Gt(ir,{sx:{width:ji,height:mh,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:r.timeline.headerBg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:r.colors.textSecondary},children:"\uC81C\uBAA9"}),g.map((R,p)=>{let y=R.getDay(),v=p===x,w=R.getDate()===1||p===0;return Gt(ir,{sx:{width:_[p],height:mh,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:dw,fontWeight:v&&r.mode!=="dark"?700:400,color:v?r.timeline.bg:y===0?r.colors.danger:y===6?r.colors.accentOnSurface:r.colors.textSecondary,bgcolor:v?r.colors.danger:"transparent",borderRight:`1px solid ${r.timeline.gridColor}`,whiteSpace:"nowrap"},children:w?`${R.getMonth()+1}/${R.getDate()}`:R.getDate()},gr(R))})]}),Gt(Zv,{sensors:d,collisionDetection:Qv,onDragStart:R=>a(Number(R.active.id)),onDragOver:f,onDragEnd:u,onDragCancel:()=>{c(null),a(null)},children:Gt(rw,{items:t.map(R=>String(R.seq)),strategy:iw,children:Ho(ir,{sx:{position:"relative"},children:[g.map((R,p)=>{let y=R.getDay(),v=p===x;return!v&&y!==0&&y!==6?null:Gt(ir,{sx:{position:"absolute",top:0,bottom:0,left:ji+B[p],width:_[p],bgcolor:v?"rgba(229,72,77,0.07)":r.colors.surfaceSubtle,zIndex:0}},`stripe-${gr(R)}`)}),t.map((R,p)=>{let y=ui(R.start_date)??ui(R.due_date),v=ui(R.due_date)??y,w=y?Math.min(g.length-1,Math.max(0,su(m,y))):0,k=v?Math.min(g.length-1,Math.max(w,su(m,v))):w,S=fw[R.priority],E=ji+B[w]+2,L=B[k]+_[k]-B[w]-4,$=R.checklist??[];return Gt(pw,{id:String(R.seq),showIndicator:n===R.seq&&i!==R.seq,children:U=>Ho(ir,{sx:{borderBottom:p===t.length-1&&z?"none":`1px solid ${r.timeline.gridColor}`,position:"relative",zIndex:1,opacity:i===R.seq?.45:1},children:[Ho(ir,{onContextMenu:O=>s(R,O),sx:{display:"flex",height:ph,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[Gt(hw,{task:R,dragHandle:Gt(ir,{component:"span",className:"taskbox-timeline-handle",...U,onClick:O=>O.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:r.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:r.colors.accentOnSurface}},children:(()=>{let O=(R.is_notice||R.is_event?wt(R.icon||(R.is_notice?or:ar)):null)??sw;return Gt(O,{sx:{fontSize:17}})})()}),onPointerDown:P,onClick:N}),Gt(gh,{title:`${R.title} (${R.start_date||"?"} ~ ${R.due_date||"?"})`,arrow:!0,enterDelay:300,children:Gt(ir,{onPointerDown:P,onClick:O=>N(R,O),sx:{position:"absolute",top:(ph-20)/2,left:E,width:Math.max(iu-4,L),height:20,borderRadius:1,bgcolor:S.bg,border:`1px solid ${S.border}`,opacity:R.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),$.map((O,W)=>Gt(ir,{sx:{display:"flex",height:lw,position:"relative",mt:W===0?`${cw}px`:0,mb:W===$.length-1?`${uw}px`:0},children:Gt(ir,{sx:{width:ji,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:O.checked?r.colors.textMuted:r.colors.textPrimary},children:Ho(ir,{onClick:()=>l(R.seq,W,!O.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[O.checked?Gt(Yv,{sx:{fontSize:17,color:r.colors.accentOnSurface,flexShrink:0}}):Gt(Xv,{sx:{fontSize:17,color:r.colors.textMuted,flexShrink:0}}),Gt(ir,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:O.checked?"line-through":"none"},children:O.label})]})})},`${R.seq}-check-${W}`))]})},R.seq)}),t.length===0?Gt(ir,{sx:{py:8,textAlign:"center",color:r.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as di}from"react/jsx-runtime";function UO(e){switch(e.view){case"card":case"kanban":{let{view:h,...b}=e;return di(Uc,{...b,columnAxis:h==="kanban"?"status":"project"})}case"sprint":{let{view:h,...b}=e;return di(Uc,{...b,columnAxis:"sprint"})}case"calendar":{let{view:h,...b}=e;return di(th,{...b})}case"month":{let{view:h,...b}=e;return di(sh,{...b})}case"agenda":{let{view:h,...b}=e;return di(dh,{...b})}case"timeline":{let{view:h,...b}=e;return di(bh,{...b})}default:{let{view:h,...b}=e;return di(Of,{...b})}}}var VO=["list","card","kanban","calendar","month","timeline"];import{Box as sn}from"@mui/material";import{Fragment as mw,jsx as fi,jsxs as Vn}from"react/jsx-runtime";function yh(e,h){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return null;let b=new Date(`${e}T00:00:00`),l=new Date(`${h}T00:00:00`);return Math.round((b.getTime()-l.getTime())/864e5)}function xh({tasks:e,todayStr:h,showProgress:b=!0,dday:l=null,workdaysLeft:o=null,showPoints:s=!0,showHours:r=!0,showOverdue:t=!0,showInfo:n=!0,inline:c=!1}){let i=ct(),a=e.filter(P=>!P.archived),d=a.filter(P=>P.completed).length,f=a.length>0?Math.round(d/a.length*100):0,u=a.filter(P=>!P.completed&&!P.is_event&&!!P.due_date&&P.due_date.slice(0,10)<h).length,g=a.reduce((P,N)=>N.completed?P:P+(N.story_points??0),0),m=b?fi(sn,{sx:{flex:c?"0 0 110px":"1 1 auto",minWidth:0,height:i.summary.gaugeHeight,borderRadius:3,bgcolor:i.summary.gaugeTrackColor},children:fi(sn,{sx:{height:"100%",borderRadius:3,width:`${f}%`,bgcolor:f>=100?i.summary.gaugeCompleteColor:i.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,x=b?Vn(sn,{component:"span",sx:{flexShrink:0,fontSize:c?14:13,color:i.summary.textColor},children:[f,"%"]}):null,_={color:i.summary.numberColor,fontWeight:700,fontSize:c?15:14},B=a.length-d,A=Vn(mw,{children:[c?null:Vn("span",{children:["\uB0A8\uC740 ",fi(sn,{component:"span",sx:_,children:B}),"\uAC74"]}),t&&u>0?Vn(sn,{component:"span",sx:{color:i.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",fi(sn,{component:"span",sx:{fontWeight:700,fontSize:c?15:14},children:u}),"\uAC74"]}):null,s&&g>0?Vn("span",{children:[fi(sn,{component:"span",sx:_,children:g}),"SP"]}):null]}),j=typeof o=="number"&&Number.isFinite(o)?Vn("span",{children:["\uADFC\uBB34\uC77C ",fi(sn,{component:"span",sx:_,children:o}),"\uC77C"]}):null,D=typeof l=="number"&&Number.isFinite(l)?fi(sn,{component:"span",sx:{ml:c?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:i.summary.overdueColor,color:i.colors.textInverse,lineHeight:1.6},children:l===0?"D-day":l>0?`D-${l}`:`D+${-l}`}):null;return c?Vn(sn,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:i.summary.textColor,whiteSpace:"nowrap",...i.summary.sx},children:[n?A:null,n?j:null,n?D:null,m,x]}):Vn(sn,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[b?Vn(sn,{sx:{display:"flex",alignItems:"center",gap:1},children:[m,x]}):null,Vn(sn,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:i.summary.textColor},children:[A,j,D]})]})}import{useMemo as bw}from"react";function gw(e){let h=String(e??"").trim();if(!h)return 0;let b=0,l=!1;for(let o of h.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let s=parseFloat(o[1]),r=o[2].toLowerCase();l=!0,r==="m"||r==="\uBD84"?b+=s/60:r==="d"||r==="\uC77C"?b+=s*8:b+=s}if(!l){let o=parseFloat(h);Number.isFinite(o)&&(b+=o)}return b}function QO(e){let h=Math.round(e*10)/10;return`${h%1===0?h.toFixed(0):h.toFixed(1)}\uC2DC\uAC04`}function vh(e,h,b){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return 0;let l=new Date(`${e}T00:00:00`),o=new Date(`${h}T00:00:00`);if(o<l||o.getTime()-l.getTime()>3660*864e5)return 0;let s=0;for(let r=new Date(l);r<=o;r.setDate(r.getDate()+1)){let t=r.getDay();if(t===0||t===6)continue;let n=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`;b.has(n)||(s+=1)}return s}function eA(e){return e.reduce((h,b)=>b.completed?h:h+gw(b.estimated_time),0)}import{jsx as yw}from"react/jsx-runtime";function sA({sprint:e,tasks:h,todayStr:b,...l}){let o=e.status==="closed"?null:yh(e.end_date,b),s=o!==null&&o>=0,r=bw(()=>{if(!s)return[];let c=Number(b.slice(0,4)),i=Number(e.end_date.slice(0,4))||c,a=[];for(let d=c;d<=Math.max(c,i);d+=1)a.push(d);return a},[s,b,e.end_date]),t=jn(r),n=s?vh(b,e.end_date,new Set(t.keys())):null;return yw(xh,{tasks:h,todayStr:b,dday:o,workdaysLeft:n,...l})}import{useEffect as Iw,useRef as Ew,useState as Mw}from"react";import{Box as lu}from"@mui/material";import{Children as xw}from"react";import{Box as au,CircularProgress as vw}from"@mui/material";import{jsx as ol}from"react/jsx-runtime";var wh={xs:2,md:3};function _h(){return ol(au,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:ol(vw,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function kh({children:e}){return ol(au,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:wh,pb:wh},children:xw.map(e,h=>h==null||h===!1?null:ol(au,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:h}))})}import{Box as wo,Button as Sw,Checkbox as Tw,Typography as Wo}from"@mui/material";import Th from"@mui/icons-material/CheckCircle";import Cw from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as kw,jsx as Sh}from"react/jsx-runtime";var ww="taskbox-search-highlight";function _w(e,h){let b=h?.keyPrefix??"hl";return e.map((l,o)=>Sh("span",{className:l.highlight?h?.highlightClassName??ww:h?.className,style:l.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:l.text},`${b}-${l.text}-${o}`))}function il({text:e,keyword:h,fallback:b="-",className:l,highlightClassName:o,keyPrefix:s}){let r=String(e??"").trim()||b,t=Da(r,h);return Sh(kw,{children:_w(t,{className:l,highlightClassName:o,keyPrefix:s})})}import{jsx as _t,jsxs as zi}from"react/jsx-runtime";var Bw={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:kr(12.5),fontWeight:500,lineHeight:1.4},vo={fontSize:kr(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function Kn({label:e,children:h}){return zi(wo,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[_t(wo,{sx:Bw,children:e}),_t(wo,{sx:{...vo,flex:1,pt:.2},children:h})]})}function Ch({task:e,statusOptions:h,projectLabel:b,searchText:l,todayStr:o,dimCompleted:s=!0,onRequestToggleCompleted:r,onOpenDetail:t,onTaskContextMenu:n,targetSummary:c="",ackInfo:i,completeLocked:a=!1,unread:d=!1,noticeReadOnly:f=!1,onAckConfirm:u,onAckListClick:g,myManaged:m=!1}){let x=e.is_event?vs(e):lr(e),_=String(e.due_date??"").slice(11,16),B=e.is_event?String(e.event_time??"").trim():/^\d{2}:\d{2}$/.test(_)?_:String(e.estimated_time??"").trim(),A=hn(e.start_date),j=hn(e.due_date),D=A&&B&&!j?`${A} ${B}`:A,P=j&&B?`${j} ${B}`:j,N=!e.is_notice&&!e.is_event&&!String(e.due_date??"").trim(),q=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<o,z=(e.receiver_names??[]).filter(Boolean);return zi(wo,{role:"button",tabIndex:0,onClick:()=>t(e),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),t(e))},onContextMenu:T=>n(e,T),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",opacity:N?.6:1,position:"relative"},children:[m?_t(wo,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,zi(wo,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[e.is_event?(()=>{let T=wt(e.icon||ar);return T?_t(T,{sx:{fontSize:21,flexShrink:0,mt:.2,color:e.icon_color||"#1e3a8a"}}):null})():!f&&!a?_t(Tw,{checked:e.completed,icon:_t(Cw,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:_t(Th,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:T=>T.stopPropagation(),onChange:(T,C)=>r({anchorEl:T.currentTarget,taskSeq:e.seq,nextCompleted:C}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{if(!e.is_notice)return null;let T=wt(e.icon||or);return T?_t(T,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:e.icon_color||"#e5484d"}}):null})(),_t(Wo,{sx:{fontSize:kr(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed&&s?"#9a9a97":N?"#5f5e5b":"#111827",textDecoration:e.completed&&s?"line-through":"none"},children:_t(il,{text:e.title,keyword:l})}),d&&!e.completed?_t(wo,{component:"span",sx:{flexShrink:0,px:.55,fontSize:kr(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),zi(wo,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[_t(Kn,{label:x?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:zi(wo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1.25},children:[x?_t(At,{option:x,small:!0}):null,_t(Lr,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?_t(Kn,{label:"\uB77C\uBCA8",children:_t(No,{labelKeys:e.label_keys,labelOptions:h})}):null,b?_t(Kn,{label:"\uD504\uB85C\uC81D\uD2B8",children:_t(Wo,{sx:vo,children:b})}):null,D?_t(Kn,{label:"\uC2DC\uC791",children:_t(Wo,{sx:vo,children:D})}):null,P?_t(Kn,{label:"\uB9C8\uAC10",children:zi(Wo,{sx:{...vo,color:q?"#e5484d":vo.color,fontWeight:q?600:400},children:[P,q?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?_t(Kn,{label:"\uB300\uC0C1\uC790",children:_t(Wo,{sx:vo,children:c||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&i?_t(Kn,{label:"\uD655\uC778",children:_t(Sw,{size:"small",variant:i.canAck?"contained":"outlined",color:"inherit",startIcon:i.acked?_t(Th,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:T=>{T.stopPropagation(),i.canAck?u?.(e):g?.(e,T.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:kr(13),...i.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:i.canAck?"\uD655\uC778":`${i.count}/${i.total}`})}):null,!e.is_notice&&e.manager_name?_t(Kn,{label:"\uCC45\uC784\uC790",children:_t(Wo,{sx:vo,children:_t(il,{text:e.manager_name,keyword:l})})}):null,!e.is_notice&&z.length>0?_t(Kn,{label:"\uCC38\uC870\uC790",children:_t(Wo,{sx:vo,children:z.join(", ")})}):null,e.note?_t(Kn,{label:"\uBE44\uACE0",children:_t(Wo,{sx:vo,children:_t(il,{text:e.note,keyword:l})})}):null]})]})}import{jsx as Fi,jsxs as Rw}from"react/jsx-runtime";function AA({tasks:e,statusOptions:h,customTabs:b,loading:l,dimCompleted:o=!0,searchText:s,todayStr:r,onToggleCompleted:t,onOpenDetail:n,onTaskContextMenu:c,getTargetSummary:i,getAckInfo:a,getNoticeReadOnly:d,isTaskUnread:f,getCompleteLocked:u,onAckConfirm:g,onAckListClick:m,onEndReached:x,myAccountSeq:_=0}){let B=new Map(b.map(P=>[P.key,P.label])),[A,j]=Mw(null),D=Ew(null);return Iw(()=>{let P=D.current;if(!x||!P)return;let N=new IntersectionObserver(q=>{q[0]?.isIntersecting&&x()});return N.observe(P),()=>N.disconnect()},[x,e.length]),e.length===0?l?Fi(_h,{}):Fi(lu,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Rw(lu,{sx:{minWidth:0},children:[Fi(kh,{children:e.map(P=>Fi(Ch,{dimCompleted:o,myManaged:_>0&&!P.is_notice&&!P.is_event&&(P.manager_account_seq??0)===_,task:P,statusOptions:h,projectLabel:P.tab_key?B.get(P.tab_key)??"":"",searchText:s,todayStr:r,onRequestToggleCompleted:j,onOpenDetail:n,onTaskContextMenu:c,targetSummary:P.is_notice?i?.(P):void 0,ackInfo:P.is_notice?a?.(P):void 0,noticeReadOnly:P.is_notice?d?.(P):!1,unread:f?.(P)??!1,completeLocked:u?.(P)??!1,onAckConfirm:g,onAckListClick:m},P.seq))}),x?Fi(lu,{ref:D,sx:{height:"1px"}}):null,Fi(Dt,{open:!!A,anchorEl:A?.anchorEl??null,title:A?.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:A?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>j(null),onConfirm:()=>{A&&t(A.taskSeq,A.nextCompleted),j(null)}})]})}import{useState as Rs}from"react";import{Box as er,Checkbox as Ow,Menu as Aw,MenuItem as Bh,Tooltip as Dw}from"@mui/material";import Pw from"@mui/icons-material/CheckCircle";import Nw from"@mui/icons-material/CheckCircleOutlineOutlined";import Lw from"@mui/icons-material/NotesOutlined";import jw from"@mui/icons-material/AutorenewOutlined";import zw from"@mui/icons-material/CalendarTodayOutlined";import Fw from"@mui/icons-material/EventOutlined";import qw from"@mui/icons-material/PersonOutlineOutlined";import $w from"@mui/icons-material/PeopleAltOutlined";import Hw from"@mui/icons-material/StickyNote2Outlined";import{Fragment as Vw,jsx as mt,jsxs as Uo}from"react/jsx-runtime";var cu={completed:{label:"\uC644\uB8CC",width:"44px",align:"center",icon:null},title:{label:"\uC81C\uBAA9",width:"1fr",align:"left",icon:mt(Lw,{sx:{fontSize:15}})},manager_name:{label:"\uCC45\uC784\uC790",width:"112px",align:"center",icon:mt(qw,{sx:{fontSize:15}})},receiver_names:{label:"\uCC38\uC870\uC790",width:"120px",align:"center",icon:mt($w,{sx:{fontSize:15}})},status:{label:"\uC0C1\uD0DC",width:"104px",align:"center",icon:mt(jw,{sx:{fontSize:15}})},priority:{label:"\uC911\uC694\uB3C4",width:"88px",align:"center",icon:null},start_date:{label:"\uC2DC\uC791\uC77C\uC2DC",width:"110px",align:"center",icon:mt(zw,{sx:{fontSize:15}})},due_date:{label:"\uB9C8\uAC10\uC608\uC815",width:"110px",align:"center",icon:mt(Fw,{sx:{fontSize:15}})},note:{label:"\uBE44\uACE0",width:"1fr",align:"left",icon:mt(Hw,{sx:{fontSize:15}})}},Ww=[{id:"completed"},{id:"title"},{id:"manager_name"},{id:"due_date"},{id:"status"}],Uw=new Set(["manager_name","status","due_date"]);function Ih(e){let h=String(e??"").trim();return h?h.slice(2,10).replaceAll("-","."):""}function iD(e,h){return h>0?e.filter(b=>!b.is_notice&&!b.completed&&!b.archived&&kn(b)==="group"&&Number(b.visibility_group_seq??0)===h).sort((b,l)=>{let o=String(b.due_date??"").trim(),s=String(l.due_date??"").trim();return o!==s?o?s?o.localeCompare(s):-1:1:Number(b.seq)-Number(l.seq)}):[]}function sD({tasks:e,columns:h=Ww,loading:b=!1,emptyText:l="\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",myAccountSeq:o=0,avatarSrcByName:s,managerCandidates:r=[],canAssignManager:t,onOpenDetail:n,onToggleCompleted:c,onChangeStatus:i,onChangeDueDate:a,onChangeReminder:d,onChangeManager:f,onClaimTask:u}){let g=ct(),[m,x]=Rs(null),[_,B]=Rs(null),[A,j]=Rs(null),[D,P]=Rs(null),[N,q]=Rs(null),z=h.map(R=>R.width??cu[R.id].width).join(" "),T=(R,p)=>mt(fn,{src:s?.get(R)??"",name:R,avatarSx:{width:p,height:p,fontSize:Math.round(p/2),flexShrink:0,borderRadius:"50%"},iconFontSize:Math.round(p*.6)}),C=(R,p)=>{let v=cu[R.id].align==="center";switch(R.id){case"completed":if(p.is_event){let w=wt(p.icon||ar);return mt(er,{className:"cell",sx:{justifyContent:"center"},children:w?mt(w,{sx:{fontSize:19,color:p.icon_color||"#1e3a8a"}}):null},R.id)}return mt(er,{className:"cell",sx:{justifyContent:"center",...c?{"&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:mt(Dw,{title:p.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,children:mt(Ow,{checked:!!p.completed,icon:mt(Nw,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:mt(Pw,{sx:{fontSize:20,color:"#2f80ed"}}),onChange:w=>P({anchorEl:w.currentTarget,task:p}),sx:{p:.5}})})},R.id);case"title":{let w=p.is_notice?wt(p.icon||or):null,k=p.icon_color||"#e5484d";return Uo(er,{className:"cell",onClick:()=>n(p),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}},children:[w?mt(w,{sx:{fontSize:18,flexShrink:0,color:k}}):null,mt(er,{component:"span",sx:{fontSize:14.5,fontWeight:g.table.rowTitleFontWeight,color:g.table.rowTitleColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.title||"(\uC81C\uBAA9 \uC5C6\uC74C)"})]},R.id)}case"manager_name":{let w=t?t(p):!1,k=o>0&&Number(p.manager_account_seq??0)===o;return w&&f?Uo(er,{className:"cell",onClick:S=>j({anchorEl:S.currentTarget,task:p}),sx:{gap:.75,justifyContent:"center",cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}},children:[p.manager_name?T(p.manager_name,22):null,mt(er,{component:"span",sx:{fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.manager_name||""})]},R.id):mt(er,{className:"cell",sx:{gap:.75,justifyContent:"center"},children:p.manager_name?Uo(Vw,{children:[T(p.manager_name,22),mt(er,{component:"span",sx:{fontSize:14,fontWeight:k?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.manager_name})]}):u?mt(Ln,{onClick:S=>q({anchorEl:S.currentTarget,taskSeq:Number(p.seq)}),children:"\uAC00\uC838\uAC00\uAE30"}):null},R.id)}case"receiver_names":return mt(er,{className:"cell",sx:{justifyContent:"center",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(p.receiver_names??[]).join(", ")},R.id);case"status":return mt(er,{className:"cell",onClick:i?w=>x({anchorEl:w.currentTarget,task:p}):void 0,sx:{py:.5,justifyContent:"center",...i?{cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:mt(At,{option:lr(p)})},R.id);case"priority":return mt(er,{className:"cell",sx:{justifyContent:"center"},children:mt(Lr,{priority:p.priority,plain:!0})},R.id);case"start_date":return mt(er,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14},children:Ih(p.start_date)},R.id);case"due_date":return mt(er,{className:"cell",onClick:a?w=>B({anchorEl:w.currentTarget,taskSeq:Number(p.seq),date:String(p.due_date??"").slice(0,10),reminders:zn(p)}):void 0,sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14,...a?{cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:Ih(p.due_date)},R.id);case"note":return mt(er,{className:"cell",sx:{justifyContent:v?"center":"flex-start",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.note||""},R.id);default:return null}};return Uo(er,{sx:{border:`1px solid ${g.table.borderColor}`,borderRadius:1,overflow:"hidden",bgcolor:g.table.bg,color:g.table.rowColor},children:[mt(er,{sx:{display:"grid",gridTemplateColumns:z,borderBottom:`1px solid ${g.table.borderColor}`,bgcolor:g.table.headerBg,"& > *":{display:"flex",alignItems:"center",gap:.5,px:1,py:1,minWidth:0,fontSize:g.table.headerFontSize,whiteSpace:"nowrap",userSelect:"none",borderRight:`1px solid ${g.table.rowBorderColor}`},"& > *:first-of-type":{px:.5},"& > *:last-child":{borderRight:"none",pr:2}},children:h.map(R=>{let p=cu[R.id];return Uo(er,{sx:{justifyContent:p.align==="center"?"center":"flex-start",color:Uw.has(R.id)?g.table.headerActiveColor:g.table.headerColor},children:[p.icon,R.label??p.label]},R.id)})}),b?mt(er,{sx:{py:3,textAlign:"center",color:g.table.emptyColor,fontSize:14},children:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"}):e.length===0?mt(er,{sx:{py:3,textAlign:"center",color:g.table.emptyColor,fontSize:14},children:l}):e.map((R,p)=>mt(er,{sx:{display:"grid",gridTemplateColumns:z,minHeight:44,fontSize:15,bgcolor:g.table.rowBg,borderTop:p===0?"none":`1px solid ${g.table.rowBorderColor}`,"&:hover":{bgcolor:g.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${g.table.rowBorderColor}`},"& > .cell:first-of-type":{px:.5},"& > .cell:last-child":{borderRight:"none",pr:2}},children:h.map(y=>C(y,R))},R.seq)),mt(Ei,{anchorEl:m?.anchorEl??null,value:String(m?.task.status??""),options:m?Ba(m.task):void 0,onSelect:R=>{m&&i?.(Number(m.task.seq),R),x(null)},onClose:()=>x(null)}),Uo(Aw,{anchorEl:A?.anchorEl??null,open:!!A,onClose:()=>j(null),transitionDuration:0,children:[Uo(Bh,{onClick:()=>{A&&f?.(Number(A.task.seq),"",0),j(null)},sx:{fontSize:14,minWidth:170,gap:1,color:g.table.headerColor},children:[mt(er,{sx:{width:24,flexShrink:0}}),"\uC9C0\uC815 \uC548 \uD568"]}),r.map(R=>Uo(Bh,{selected:Number(A?.task.manager_account_seq??0)===Number(R.account_seq??0),onClick:()=>{A&&f?.(Number(A.task.seq),R.name,Number(R.account_seq??0)),j(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[T(R.name,24),R.name,R.role_name?mt(er,{component:"span",sx:{color:g.table.headerColor,fontSize:13},children:R.role_name}):null]},R.seq))]}),mt(pn,{anchorEl:_?.anchorEl??null,open:!!_,date:_?.date??"",reminders:_?.reminders??[],hideReminder:!d,onClose:()=>B(null),onDateChange:R=>{_&&(a?.(_.taskSeq,R),B(p=>p?{...p,date:R}:null))},onReminderChange:R=>{_&&(d?.(_.taskSeq,R),B(p=>p?{...p,reminders:R}:null))}}),mt(Dt,{open:!!D,anchorEl:D?.anchorEl??null,title:D?.task.completed?"\uC644\uB8CC\uB97C \uD574\uC81C\uD560\uAE4C\uC694?":"\uC644\uB8CC \uCC98\uB9AC\uD560\uAE4C\uC694?",confirmText:D?.task.completed?"\uD574\uC81C":"\uC644\uB8CC",onCancel:()=>P(null),onConfirm:()=>{D&&c?.(D.task,!D.task.completed),P(null)}}),mt(Dt,{open:!!N,anchorEl:N?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uB97C \uB9E1\uC744\uAE4C\uC694?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>q(null),onConfirm:()=>{N&&u?.(N.taskSeq),q(null)}})]})}var Os=[{value:"daily",label:"\uB9E4\uC77C"},{value:"weekly",label:"\uB9E4\uC8FC"},{value:"monthly",label:"\uB9E4\uC6D4"},{value:"yearly",label:"\uB9E4\uB144"}];function sl(e){return Os.find(h=>h.value===e)?.label??"\uC5C6\uC74C"}function Kw(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let h=new Date(`${e}T00:00:00`);return Number.isNaN(h.getTime())?null:h}function al(e,h){let b=Kw(e);if(!b)return"";let l=new Date(b);h==="daily"?l.setMonth(l.getMonth()+1):h==="weekly"?l.setMonth(l.getMonth()+3):h==="monthly"?l.setFullYear(l.getFullYear()+1):l.setFullYear(l.getFullYear()+3);let o=s=>String(s).padStart(2,"0");return`${l.getFullYear()}-${o(l.getMonth()+1)}-${o(l.getDate())}`}function Gw(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}function Eh(e,h){let b=String(e??"").slice(0,10);if(!Gw(b)||typeof h!="number"||!Number.isFinite(h))return"";let l=new Date(`${b}T12:00:00`);l.setDate(l.getDate()+Math.trunc(h));let o=l.getFullYear(),s=String(l.getMonth()+1).padStart(2,"0"),r=String(l.getDate()).padStart(2,"0");return`${o}-${s}-${r}`}function Yw(e,h,b){return{title:String(e.title??"").trim(),content:String(e.content??""),start_date:Eh(h,e.start_offset_days),due_date:Eh(h,e.due_offset_days),priority:e.priority??"medium",label_keys:[...e.label_keys??[]],manager_account_seq:Number(e.manager_account_seq)||0,manager_name:String(e.manager_name??""),checklist:(e.checklist??[]).map(l=>String(l??"").trim()).filter(l=>l.length>0).map(l=>({label:l,checked:!1})),group_seq:b}}function Mh(e,h){let b=Number(e.group_seq)||0;return(e.items??[]).map(l=>Yw(l,h,b)).filter(l=>l.title.length>0)}function uD(e){return typeof e!="number"||!Number.isFinite(e)?"-":e===0?"\uAE30\uC900\uC77C":e>0?`\uAE30\uC900\uC77C +${Math.trunc(e)}\uC77C`:`\uAE30\uC900\uC77C ${Math.trunc(e)}\uC77C`}import{useEffect as v5,useRef as w5,useState as dp}from"react";import{Box as ko,Button as Eu,ButtonBase as _5,Divider as fp,Drawer as k5,IconButton as S5,Tooltip as T5}from"@mui/material";import C5 from"@mui/icons-material/Close";import B5 from"@ehfuse/overlay-scrollbar";import{FormDialog as I5}from"@ehfuse/mui-form-dialog";import{useState as Ns}from"react";import{Box as mi,ButtonBase as c5,Divider as Ls,Menu as Cu,MenuItem as Bu,Tooltip as u5}from"@mui/material";import d5 from"@mui/icons-material/SubjectOutlined";import f5 from"@mui/icons-material/StickyNote2Outlined";import h5 from"@mui/icons-material/LabelOutlined";import p5 from"@mui/icons-material/DirectionsRunOutlined";import sp from"@mui/icons-material/LockOutlined";import ap from"@mui/icons-material/PublicOutlined";import lp from"@mui/icons-material/Group";import m5 from"@mui/icons-material/Repeat";import g5 from"@mui/icons-material/EventOutlined";import b5 from"@mui/icons-material/SpeedOutlined";import{TextField as y5}from"@ehfuse/mui-form-controls";import{InfoAlert as cp}from"@ehfuse/alerts";import{useState as hi}from"react";import{Box as Lh,Divider as p3,ListItemIcon as m3,Menu as fu,MenuItem as As}from"@mui/material";import g3 from"@mui/icons-material/Add";import cl from"@mui/icons-material/Check";import b3 from"@mui/icons-material/ViewKanbanOutlined";import y3 from"@mui/icons-material/CalendarTodayOutlined";import x3 from"@mui/icons-material/EventOutlined";import v3 from"@mui/icons-material/PersonOutlineOutlined";import Ph from"@mui/icons-material/PeopleAltOutlined";import w3 from"@mui/icons-material/FlagOutlined";import _3 from"@mui/icons-material/TimerOutlined";import k3 from"@mui/icons-material/NotificationsNoneOutlined";import S3 from"@mui/icons-material/InboxOutlined";import T3 from"@mui/icons-material/PlaceOutlined";import C3 from"@mui/icons-material/MapOutlined";import{TimePicker as B3}from"@ehfuse/mui-datetime-picker";import{InfoAlert as I3}from"@ehfuse/alerts";var Bn="@media (max-width: 719.95px)";function Gn(e){return{[Bn]:{order:e}}}import{useEffect as Xw,useState as Zw}from"react";import{Box as Jw}from"@mui/material";import{jsx as Qw}from"react/jsx-runtime";function _o({value:e,placeholder:h,readOnly:b,onCommit:l}){let o=ct(),[s,r]=Zw(e);return Xw(()=>r(e),[e]),Qw(Jw,{component:"input",spellCheck:!1,value:s,readOnly:b,placeholder:h,onChange:t=>r(t.target.value),onBlur:()=>{s.trim()!==e&&l(s.trim())},onKeyDown:t=>{t.key==="Enter"&&t.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:o.colors.textPrimary,caretColor:o.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as uu}from"@mui/material";import{jsx as e3,jsxs as Rh}from"react/jsx-runtime";function pt({icon:e,label:h,onClick:b,sx:l,children:o}){return Rh(uu,{sx:[{display:"flex",alignItems:"center",minHeight:32},...Array.isArray(l)?l:[l]],children:[Rh(uu,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,h]}),e3(uu,{onClick:b?s=>b(s.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:b?"pointer":"default","&:hover":b?{bgcolor:"#f2f2f0"}:void 0,[Bn]:{py:.25}},children:o})]})}import{Suspense as t3,lazy as r3,useEffect as n3,useState as Oh}from"react";import{Box as du,Dialog as o3,DialogContent as i3,DialogTitle as s3,IconButton as Ah,Tooltip as a3}from"@mui/material";import l3 from"@mui/icons-material/Close";import c3 from"@mui/icons-material/Search";import{Fragment as h3,jsx as In,jsxs as ll}from"react/jsx-runtime";function u3(e){return In(du,{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 d3=r3(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:u3})));function f3(e){if(e.addressType!=="R")return e.address;let h="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(h+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(h+=h!==""?`, ${e.buildingName}`:e.buildingName),h!==""?`${e.address} (${h})`:e.address}function Dh({value:e,placeholder:h="\uC8FC\uC18C \uC785\uB825",readOnly:b,onCommit:l}){let[o,s]=Oh(e),[r,t]=Oh(!1),n=Sr().slots?.addressSearch;n3(()=>s(e),[e]);let c=a=>{s(a),t(!1),a!==e&&l(a)};return ll(h3,{children:[ll(du,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[In(du,{component:"input",spellCheck:!1,value:o,readOnly:b,placeholder:h,onChange:a=>s(a.target.value),onBlur:()=>{r||o.trim()!==e&&l(o.trim())},onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),!b&&t(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),b?null:In(a3,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:In(Ah,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>t(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:In(c3,{sx:{fontSize:17}})})})]}),n?In(n,{open:r,onComplete:c,onClose:()=>t(!1)}):ll(o3,{open:r,onClose:()=>t(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[ll(s3,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",In(Ah,{"aria-label":"\uC8FC\uC18C \uAC80\uC0C9 \uB2EB\uAE30",onClick:()=>t(!1),size:"small",children:In(l3,{})})]}),In(i3,{style:{padding:0},dividers:!0,children:r?In(t3,{fallback:null,children:In(d3,{onComplete:a=>{c(f3(a))},onClose:()=>t(!1),defaultQuery:o,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as ul,jsx as ot,jsxs as En}from"react/jsx-runtime";function Nh(e){return String(e??"").includes(" ")?on(e):hn(e)}function E3(e){let[h="00",b="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(h)?h:"00",minute:/^\d{2}$/.test(b)?b:"00"}}function qi({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return ot(Lh,{component:"span",sx:{color:"#9a9a97"},children:e})}var tr=e=>({gridColumn:`${e}`,[Bn]:{gridColumn:"auto"}});function dl({values:e,customTabs:h,avatarSrcByName:b,managerLocked:l=!1,notice:o=!1,event:s=!1,hideDueDate:r=!1,hideReminder:t=!1,beforeStart:n,pinColumns:c=!1,projectColumn:i=1,afterProject:a,readOnly:d=!1,targetSummary:f="",narrowCollapsedSx:u,reminderLocked:g=!1,managerAction:m,hideProject:x=!1,leading:_,trailing:B,onChangeProject:A,onChangeStartDate:j,onChangeDueDate:D,onChangeReminder:P,onChangePriority:N,onChangeEventTime:q,onChangeEventPlace:z,onChangeEventAddress:T,onMemberEdit:C,onAddProject:R}){let[p,y]=hi(null),[v,w]=hi(!1),[k,S]=hi(null),[E,L]=hi(null),[$,U]=hi(null),[O,W]=hi(null),[M,I]=hi(null),F=Lt(),V=Nn(),Y=c&&!s,K=(X,ee,ne=!1)=>[Gn(X),...ne&&u?Array.isArray(u)?u:[u]:[],...Y&&ee?[tr(ee)]:[]],H=h.find(X=>X.key===e.tabKey),Z=h.filter(X=>!X.archived),J=X=>{let ee=!!String(e.startDate??"").trim();if(j(X),ee||o||s)return;let ne=xc(X);Number.isNaN(ne.getTime())||ne.getTime()<=Date.now()||I3("\uC2DC\uC791\uC77C\uC2DC\uAC00 \uB418\uBA74 \uCC45\uC784\uC790\uC5D0\uAC8C \uC54C\uB9BC\uC774 \uBC1C\uC1A1\uB429\uB2C8\uB2E4.")},G=ot(pt,{icon:ot(k3,{sx:{fontSize:17}}),label:"\uC0AC\uC804\uC54C\uB9BC",onClick:d||g?void 0:X=>L(X),sx:K(s?8:5,2,!0),children:e.reminders.length===0?ot(qi,{label:"\uC5C6\uC74C"}):Ac(e.reminders)});return En(ul,{children:[En(Lh,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gridAutoFlow:"row dense",columnGap:3,rowGap:0,px:2,[Bn]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[_,x?null:ot(pt,{icon:ot(b3,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:d?void 0:X=>y(X),sx:Y&&i==="full"?[K(1,void 0,!0),{gridColumn:"1 / -1"}]:K(1,i==="full"?1:i,!0),children:H?(()=>{let X=wt(H.icon);return En(ul,{children:[X?ot(X,{sx:{fontSize:16,color:"#1e3a8a"}}):null,H.label]})})():"\uAE30\uBCF8"}),a,o?ot(pt,{icon:ot(Ph,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:d?void 0:()=>C("targets"),sx:K(7,1),children:f||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!o&&!s?ot(pt,{icon:ot(v3,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:l||d||!e.managerName&&m?void 0:()=>C("manager"),sx:K(7,1),children:e.managerName?En(ul,{children:[ot(jr,{names:[e.managerName],size:20,avatarSrcByName:b}),e.managerName]}):m??ot(qi,{})}):null,n,s?null:ot(pt,{icon:ot(y3,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC2DC",onClick:d?void 0:X=>U(X),sx:K(2,2),children:e.startDate?Nh(e.startDate):ot(qi,{})}),o?null:ot(pt,{icon:ot(Ph,{sx:{fontSize:17}}),label:s?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:d?void 0:()=>C("receivers"),sx:K(s?7:8,1),children:e.receiverNames.length>0?En(ul,{children:[ot(jr,{names:e.receiverNames,size:20,avatarSrcByName:b}),e.receiverNames.length===1?e.receiverNames[0]:null]}):ot(qi,{})}),r?null:ot(pt,{icon:ot(x3,{sx:{fontSize:17}}),label:s?"\uB0A0\uC9DC":"\uB9C8\uAC10\uC608\uC815",onClick:d?void 0:X=>W(X),sx:K(3,2),children:e.dueDate?s?hn(e.dueDate):Nh(e.dueDate):ot(qi,{})}),s?ot(pt,{icon:ot(_3,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:d?void 0:X=>I(X),sx:Gn(4),children:e.eventTime?e.eventTime:ot(qi,{label:"\uC885\uC77C"})}):null,s?ot(pt,{icon:ot(T3,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:Gn(5),children:ot(_o,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:d,onCommit:X=>z?.(X)})}):null,!t&&s?G:null,s?ot(pt,{icon:ot(C3,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},Gn(6)],children:ot(Dh,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:d,onCommit:X=>T?.(X)})}):null,s?null:ot(pt,{icon:ot(w3,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:d?void 0:X=>S(X),sx:K(6,1,!0),children:ot(Lr,{priority:e.priority,small:!0})}),!t&&!s?G:null,B]}),En(fu,{transitionDuration:0,anchorEl:p,open:!!p,onClose:()=>y(null),...V,children:[En(As,{selected:!e.tabKey,onClick:()=>{A(""),y(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ot(S3,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),Z.map(X=>{let ee=wt(X.icon),ne=e.tabKey===X.key;return En(As,{selected:ne,onClick:()=>{A(X.key),y(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ee?ot(ee,{sx:{fontSize:17,color:"#1e3a8a"}}):null,X.label,ne?ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},X.key)}),R?[ot(p3,{},"add-project-divider"),En(As,{onClick:()=>w(!0),sx:{fontSize:14,color:"#787774"},children:[ot(m3,{children:ot(g3,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),R?ot(qa,{open:v,onClose:()=>w(!1),onSubmit:(X,ee,ne)=>{(async()=>{let re=await R(X,ee,ne);re&&A(re)})(),y(null)}}):null,ot(fu,{transitionDuration:0,anchorEl:k,open:!!k,onClose:()=>S(null),...V,children:["high","medium","low"].map(X=>En(As,{selected:e.priority===X,onClick:()=>{N(X),S(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[ot(Lr,{priority:X,small:!0}),e.priority===X?ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},X))}),ot(fu,{transitionDuration:0,anchorEl:E,open:!!E,onClose:()=>L(null),...V,children:Oc(s?!!e.eventTime:String(e.dueDate??"").includes(" ")).map(X=>{let ee=X.value==="none"?e.reminders.length===0:e.reminders.includes(X.value);return En(As,{selected:ee,onClick:()=>{P(za(e.reminders,X.value)),X.value==="none"&&L(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[X.label,ee?ot(cl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},X.value)})}),s?ot(B3,{anchorEl:M,open:!!M,onClose:()=>I(null),value:E3(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:F,locale:"ko",onChange:(X,ee)=>{q?.(`${X}:${ee}`),I(null)}}):null,ot(pn,{anchorEl:$,open:!!$,date:e.startDate,reminders:[],hideReminder:!0,showTime:!0,centered:F,onClose:()=>U(null),onDateChange:J,onReminderChange:()=>{}}),ot(pn,{anchorEl:O,open:!!O,date:e.dueDate,reminders:e.reminders,hideReminder:g||t,showTime:!s,centered:F,onClose:()=>W(null),onDateChange:D,onReminderChange:P})]})}import{useState as M3}from"react";import{Box as R3,Menu as O3,MenuItem as A3}from"@mui/material";import D3 from"@mui/icons-material/RepeatOutlined";import P3 from"@mui/icons-material/DevicesOutlined";import N3 from"@mui/icons-material/ScreenSearchDesktopOutlined";import L3 from"@mui/icons-material/SellOutlined";import j3 from"@mui/icons-material/TaskAltOutlined";import{Fragment as jh,jsx as yr,jsxs as zh}from"react/jsx-runtime";function hu({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return yr(R3,{component:"span",sx:{color:"#9a9a97"},children:e})}function fl({values:e,readOnly:h=!1,showResolution:b=!1,onChangeRepro:l,onChangeDevice:o,onChangeWhere:s,onChangeVersion:r,onChangeResolution:t}){let[n,c]=M3(null),i=n?.field==="repro"?fc:n?.field==="device"?hc:pc,a=d=>{n?.field==="repro"?l(d):n?.field==="device"?o(d):n?.field==="resolution"&&t?.(d),c(null)};return zh(jh,{children:[zh(jh,{children:[yr(pt,{icon:yr(D3,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:h?void 0:d=>c({field:"repro",el:d}),children:Kd(e.repro)||yr(hu,{label:"\uC120\uD0DD"})}),yr(pt,{icon:yr(P3,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:h?void 0:d=>c({field:"device",el:d}),children:Gd(e.device)||yr(hu,{label:"\uC120\uD0DD"})}),yr(pt,{icon:yr(N3,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:yr(_o,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:h,onCommit:s})}),yr(pt,{icon:yr(L3,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:yr(_o,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:h,onCommit:r})}),b?yr(pt,{icon:yr(j3,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:h?void 0:d=>c({field:"resolution",el:d}),children:Sa(e.resolution)||yr(hu,{label:"\uC120\uD0DD"})}):null]}),yr(O3,{open:!!n,anchorEl:n?.el??null,onClose:()=>c(null),transitionDuration:0,children:i.map(d=>yr(A3,{onClick:()=>a(d.key),sx:{fontSize:14},children:d.name},d.key))})]})}import{Box as Fh}from"@mui/material";import{jsxs as qh}from"react/jsx-runtime";var pu=16;function bn({icon:e,title:h,titleExtra:b,children:l}){return qh(Fh,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[qh(Fh,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:pu,fontWeight:500,color:"#37352f"},children:[e,h,b]}),l]})}import{useState as mu}from"react";import{Box as gu,Button as z3,Divider as F3,IconButton as $h,Menu as q3,MenuItem as bu,Tooltip as $3}from"@mui/material";import H3 from"@mui/icons-material/MoreVert";import{ConfirmDialog as W3}from"@ehfuse/alerts";import{FormDialog as U3}from"@ehfuse/mui-form-dialog";import{ClearTextField as V3}from"@ehfuse/mui-form-controls";import{Fragment as K3,jsx as an,jsxs as hl}from"react/jsx-runtime";function Hh(e){return String(e??"").replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").trim().length>0}function pl({content:e,templates:h,onApply:b,onSave:l,onRemove:o}){let[s,r]=mu(null),[t,n]=mu(!1),[c,i]=mu(""),a=async d=>{r(null),!(Hh(e)&&!await W3({title:"\uC591\uC2DD \uBD88\uB7EC\uC624\uAE30",message:`\uC9C0\uAE08 \uC4F4 \uB0B4\uC6A9\uC744 "${d.name}" \uC591\uC2DD\uC73C\uB85C \uBC14\uAFC9\uB2C8\uB2E4. \uACC4\uC18D\uD560\uAE4C\uC694?`}))&&b(d.content)};return hl(K3,{children:[an($3,{title:"\uBCF8\uBB38 \uC591\uC2DD",arrow:!0,disableInteractive:!0,children:an($h,{size:"small","aria-label":"\uBCF8\uBB38 \uC591\uC2DD",onClick:d=>r(d.currentTarget),sx:{ml:"auto",color:"#9a9a97"},children:an(H3,{sx:{fontSize:18}})})}),hl(q3,{anchorEl:s,open:!!s,onClose:()=>r(null),transitionDuration:0,children:[l?an(bu,{disabled:!Hh(e),onClick:()=>{r(null),i(""),n(!0)},sx:{fontSize:14,minWidth:220},children:"\uD604\uC7AC \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5"}):null,l?an(F3,{sx:{my:.5}}):null,h.length===0?an(bu,{disabled:!0,sx:{fontSize:14,minWidth:220},children:"\uC800\uC7A5\uB41C \uC591\uC2DD\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}):h.map(d=>hl(bu,{onClick:()=>{a(d)},sx:{fontSize:14,minWidth:220,gap:1},children:[an(gu,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.name}),o?an($h,{size:"small","aria-label":`${d.name} \uC591\uC2DD \uC0AD\uC81C`,onClick:f=>{f.stopPropagation(),o(d.seq)},sx:{color:"#9a9a97"},children:an(cr,{sx:{fontSize:16}})}):null]},d.seq))]}),an(U3,{open:t,onClose:()=>n(!1),maxWidth:"xs",title:"\uC591\uC2DD\uC73C\uB85C \uC800\uC7A5",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,right:an(z3,{variant:"contained",disabled:!c.trim(),onClick:()=>{l?.(c.trim(),e),n(!1)},children:"\uC800\uC7A5"})},sections:[{id:"template-name",title:"",showTitle:!1,children:hl(gu,{sx:{display:"flex",flexDirection:"column",gap:1},children:[an(gu,{sx:{fontSize:15,color:"#37352f"},children:"\uC9C0\uAE08 \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5\uD569\uB2C8\uB2E4. \uB2E4\uC74C\uBD80\uD130 \uC774 \uC774\uB984\uC73C\uB85C \uAEBC\uB0B4 \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4."}),an(V3,{size:"medium",fullWidth:!0,autoFocus:!0,placeholder:"\uC591\uC2DD \uC774\uB984 (\uC608: \uC624\uB958 \uC2E0\uACE0 \uC11C\uC2DD)",value:c,onChange:d=>i(d.target.value)})]})}]})]})}import{useEffect as yu,useRef as Vo,useState as G3}from"react";import{Box as xu,IconButton as Y3,Tooltip as X3}from"@mui/material";import Z3 from"@mui/icons-material/ContentCopyOutlined";import J3 from"@mui/icons-material/Check";import{EhfuseEditor as Q3,ImageResizePlugin as e_,minimalToolbarOptions as t_}from"@ehfuse/editor";import{jsx as pi,jsxs as n_}from"react/jsx-runtime";function vu(e){let h=e.trim();return h?h.startsWith("<")?e:`<p>${h}</p>`:"<p></p>"}function r_(e){let h=e.replace(/<br\s*\/?>/gi,`
31
31
  `).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
32
32
  `),b=document.createElement("div");return b.innerHTML=h,(b.textContent??"").replace(/\n{3,}/g,`
33
33
 
@@ -38,11 +38,11 @@ use chrome, FireFox or Internet Explorer 11`)}var r=e("safe-buffer"),t=e("random
38
38
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&amp;/gi,"&").replace(/\n{3,}/g,`
39
39
 
40
40
  `).trim():"";function K5(e){let h=[`[\uC5C5\uBB34] ${e.title}`],b=hn(e.start_date),l=hn(e.due_date);(b||l)&&h.push(`\uAE30\uAC04: ${b&&l?`${b} ~ ${l}`:b||l}`),e.manager_name&&h.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let o=lr(e).name;o&&h.push(`\uC0C1\uD0DC: ${o}`);let s=_p(e.content);s&&h.push("",s);let r=String(e.note??"").trim();return r&&h.push("",`\uBE44\uACE0: ${r}`),h.join(`
41
- `)}function kp(e){navigator.clipboard.writeText(e).then(()=>V5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>U5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Ki(e,h){let b=K5(e);if(h&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&kp(b)});return}kp(b)}import{Fragment as t4,jsx as Bt,jsxs as Sp}from"react/jsx-runtime";function Tp({task:e,myAccountSeq:h=0,onToggleCompleted:b,onChangeTitle:l,onChangeIcon:o,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:c,onLoadActivity:i,onPrint:a,onDelete:d,canDelete:f}){let u=Lt(),[g,m]=Fs(!1),[x,_]=Fs(null),[B,A]=Fs(null),[j,D]=Fs(null),[P,N]=Fs(null),q=!!e.is_notice,z=!!e.is_event,T=q?wt(e.icon||or):z?wt(e.icon||ar):null,C=q&&h>0&&(e.author_account_seq??0)===h,R=!lo(e,h),p=!!d&&(f??(h>0&&(e.author_account_seq??0)===h)),y=!z&&(q?C:(e.author_account_seq??0)===h||(e.manager_account_seq??0)===h);return Sp(t4,{children:[Sp(Gi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Yi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(X5,{})}):null,y&&!t?Bt(Xi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${on(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Gi,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Ln,{onClick:v=>N({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!T?null:z&&!R?Bt(Xi,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(G5,{onClick:v=>A(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(T,{sx:{fontSize:20}})})}):Bt(Gi,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(T,{sx:{fontSize:20}})}),x!==null?Bt(Gi,{component:"input",autoFocus:!0,spellCheck:!1,value:x,onChange:v=>_(v.target.value),onBlur:()=>{x.trim()&&x.trim()!==e.title&&l(e.seq,x.trim()),_(null)},onKeyDown:v=>{v.key==="Enter"&&v.target.blur(),v.key==="Escape"&&_(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Bt(Gi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":z?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Gi,{onClick:R?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:R?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?Bt(Xi,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Yi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(Q5,{sx:{fontSize:20}})})}):null,Bt(Xi,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Yi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Ki(e,u),sx:{color:"#6b7280"},children:u?Bt(Z5,{sx:{fontSize:20}}):Bt(J5,{sx:{fontSize:20}})})}),a?Bt(Xi,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Yi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(e4,{sx:{fontSize:20}})})}):null,p?Bt(Xi,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Yi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(cr,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Yi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(Y5,{})}):null]}),Bt(Dt,{open:!!P,anchorEl:P?.anchorEl??null,title:P?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:P?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>N(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),N(null)}}),Bt(zo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{o(e.seq,v),A(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>A(null)}),Bt(Dt,{open:!!j,anchorEl:j,title:"\uC774 \uC5C5\uBB34\uB97C \uD734\uC9C0\uD1B5\uC73C\uB85C \uBCF4\uB0B4\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>D(null),onConfirm:()=>{D(null),d?.(e)}}),Bt(Ml,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:i,onClose:()=>m(!1)})]})}import{useRef as d4,useState as yn}from"react";import{Box as Xt,Button as Zi,ButtonBase as Rp,Checkbox as f4,Divider as yi,Menu as Nu,MenuItem as Lu}from"@mui/material";import h4 from"@mui/icons-material/ExpandLess";import p4 from"@mui/icons-material/ExpandMore";import m4 from"@mui/icons-material/ConfirmationNumberOutlined";import Op from"@mui/icons-material/Check";import g4 from"@mui/icons-material/DirectionsRunOutlined";import b4 from"@mui/icons-material/SpeedOutlined";import ju from"@mui/icons-material/CheckCircle";import y4 from"@mui/icons-material/CheckCircleOutlineOutlined";import zu from"@mui/icons-material/CheckCircleOutlined";import Ap from"@mui/icons-material/AccessTimeOutlined";import x4 from"@mui/icons-material/AutorenewOutlined";import v4 from"@mui/icons-material/LabelOutlined";import w4 from"@mui/icons-material/PersonOutlineOutlined";import _4 from"@mui/icons-material/SubjectOutlined";import k4 from"@mui/icons-material/StickyNote2Outlined";import S4 from"@mui/icons-material/PanToolAltOutlined";import Dp from"@mui/icons-material/LockOutlined";import Pp from"@mui/icons-material/PublicOutlined";import Np from"@mui/icons-material/Group";import T4 from"@mui/icons-material/Repeat";import C4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as Lp,InfoAlert as B4}from"@ehfuse/alerts";import{DatePicker as I4}from"@ehfuse/mui-datetime-picker";import{useState as r4}from"react";import{TextField as n4}from"@ehfuse/mui-form-controls";import{jsx as o4}from"react/jsx-runtime";function Cp({value:e,onCommit:h,onDraftChange:b,readOnly:l=!1}){let[o,s]=r4(null);return o4(n4,{value:o??e,placeholder:l?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:l}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&h(o),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Du,useState as Pu}from"react";import{Box as Or,Button as Ep,IconButton as i4}from"@mui/material";import s4 from"@mui/icons-material/AccountTreeOutlined";import a4 from"@mui/icons-material/LinkOutlined";import l4 from"@mui/icons-material/Close";import c4 from"@mui/icons-material/RedoOutlined";function bi(e){return e.relations??[]}function fz(e,h,b){return bi(e).some(l=>l.type===b&&l.task_seq===h.seq)||bi(h).some(l=>l.type===b&&l.task_seq===e.seq)}function Bp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Ou(e,h){let b=new Map(h.map(u=>[u.seq,u]));b.set(e.seq,e);let l=new Map,o=(u,g)=>{l.has(u)||l.set(u,new Set),l.has(g)||l.set(g,new Set),l.get(u).add(g),l.get(g).add(u)};for(let u of b.values())for(let g of bi(u))g.type==="follow_up"&&b.has(g.task_seq)&&o(u.seq,g.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let u=r.shift();for(let g of l.get(u)??[])s.has(g)||(s.add(g),r.push(g))}let t=[...s].map(u=>b.get(u)).filter(u=>!!u).sort((u,g)=>Bp(u).localeCompare(Bp(g))),n=new Set;for(let u of bi(e))u.type==="related"&&n.add(u.task_seq);for(let u of b.values())u.seq!==e.seq&&bi(u).some(g=>g.type==="related"&&g.task_seq===e.seq)&&n.add(u.seq);let c=[...n].map(u=>b.get(u)).filter(u=>u!==void 0&&u.seq!==e.seq),i=[...b.values()].filter(u=>u.seq!==e.seq&&bi(u).some(g=>g.type==="duplicate_of"&&g.task_seq===e.seq)),a=bi(e).find(u=>u.type==="duplicate_of")?.task_seq,d=a?b.get(a)??null:null,f=[...b.values()].filter(u=>u.seq!==e.seq&&(u.checklist??[]).some(g=>Number(g.task_seq??0)===e.seq));return{lineage:t,related:c,duplicates:i,duplicateOf:d,parents:f}}function Au(e,h){let b=Ou(e,h);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)+b.parents.length}function Ip(e,h){return Au(e,h)>0}import{Fragment as u4,jsx as Wt,jsxs as Rn}from"react/jsx-runtime";function Rl({item:e,caption:h,onOpen:b,onUnlink:l}){let o=e.is_notice||e.is_event?wt(e.icon||(e.is_notice?or:ar)):null;return Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[h?Wt(Or,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:h}):null,o?Wt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Rn(Or,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Wt(At,{option:lr(e),small:!0}),l?Wt(i4,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:l,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Wt(l4,{sx:{fontSize:15}})}):null]})}function Mp({task:e,tasks:h,readOnly:b=!1,onOpenTask:l,onLink:o,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Pu(!1),[c,i]=Pu(null),[a,d]=Pu(null),f=Du(()=>Ou(e,h),[e,h]),u=f.lineage.length>=2,g=Du(()=>Au(e,h),[e,h]),m=Du(()=>{let _=new Set;for(let B of f.lineage)_.add(B.seq);for(let B of f.related)_.add(B.seq);for(let B of f.duplicates)_.add(B.seq);for(let B of f.parents)_.add(B.seq);return f.duplicateOf&&_.add(f.duplicateOf.seq),[..._]},[f]),x=(_,B,A)=>{d({anchorEl:_,targetSeq:B,type:A})};return Rn(bn,{icon:Wt(s4,{sx:{fontSize:19,display:"block"}}),title:Rn(u4,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?Wt(Or,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:Rn(Or,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(c4,{sx:{fontSize:16}}),onClick:_=>i(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(a4,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?Wt(Or,{sx:{mb:f.related.length||f.duplicates.length||f.duplicateOf?1:0},children:f.lineage.map((_,B)=>{let A=_.seq===e.seq,j=B===f.lineage.length-1;return Rn(Or,{sx:{display:"flex",gap:1},children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Wt(Or,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":_.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),j?null:Wt(Or,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Rn(Or,{sx:{flex:1,minWidth:0,pb:j?0:.5},children:[Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Rn(Or,{component:"span",onClick:!A&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Wt(At,{option:lr(_),small:!0})]}),Wt(Or,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,f.parents.map(_=>Wt(Rl,{item:_,caption:"\uC0C1\uC704 \uC5C5\uBB34",onOpen:l?()=>l(_.seq):void 0},`parent-${_.seq}`)),f.duplicateOf?Wt(Rl,{item:f.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(f.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,f.duplicateOf.seq,"duplicate_of"):void 0}):null,f.duplicates.map(_=>Wt(Rl,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),f.related.map(_=>Wt(Rl,{item:_,onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"related"):void 0},`rel-${_.seq}`)),g===0?Wt(Or,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?Wt(bl,{open:t,task:e,tasks:h,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(_,B)=>o(e.seq,_,B)}):null,Wt(Dt,{open:!!c,anchorEl:c,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),Wt(Dt,{open:!!a,anchorEl:a?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>d(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),d(null)}})]})}import{Fragment as qr,jsx as we,jsxs as Ut}from"react/jsx-runtime";function Ko({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return we(Xt,{component:"span",sx:{color:"#9a9a97"},children:e})}function jp({task:e,customTabs:h,statusOptions:b,avatarSrcByName:l,onChangeStatus:o,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:c,onChangeReminder:i,onMemberEdit:a,onChangePriority:d,onChangeVisibility:f,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:N,contentLoading:q=!1,onChangeContentHeight:z,onAddChecklistItem:T,onToggleChecklistItem:C,onRemoveChecklistItem:R,onUpdateChecklistItem:p,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:S,relatedTasksPool:E,onOpenRelatedTask:L,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:O,onAddAttachments:W,onRemoveAttachment:M,onPreview:I,onDownload:F,onUpdateComment:V,onRemoveComment:Y,onToggleCommentReaction:K,currentUserName:H="",myAccountSeq:Z=0,noticeAdmin:J=!1,hideProject:G=!1,hideLabel:X=!1,showTitle:ee=!1,onChangeTitle:ne,onToggleCompleted:re,onChangeIcon:oe,onChangeIconColor:se,employees:ge=[],onAckConfirm:ve,onRequestConfirm:_e,onChangeBugField:De,sprints:pe=[],sprintProject:de=!1,hideSprint:Ve=!1,onChangeSprint:Pe,onChangeStoryPoints:ie,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ze,Te]=yn(null),ce=d4(!1),[Re,Se]=yn(null),[Ce,lt]=yn(null),[Le,qe]=yn(null),[kt,$e]=yn(!1),Ne={[Bn]:kt?{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"}},[vt,et]=yn(null),[Ke,bt]=yn(null),[tt,te]=yn(null),[ue,me]=yn(null),[ke,Je]=yn(null),[Me,Ae]=yn(null),[yt,We]=yn(null),Ie=!!e.is_notice,Ue=!!e.is_event,rt=!!e.is_bug,dt=!!ye&&Ra(e,Z),St=!!ye&&Oa(e,Z),Rt=!!xe&&rt&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(ae=>ae.account_seq===Z),xt=!lo(e,Z),Qt=!e.is_event&&(e.is_notice?Z>0&&(e.author_account_seq??0)===Z:(e.author_account_seq??0)===Z||(e.manager_account_seq??0)===Z),Nt=e.is_notice||e.is_event?wt(e.icon||(e.is_notice?or:ar)):null,Vt=Ie?!Ma(e,Z):xt,Q=dt||St?Ut(Ln,{onClick:ae=>We(ae.currentTarget),children:[we(S4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,le=Ie?Tl(e,ge):"",be=Ie?op(e,ge,Z):null,fe=Ie?null:Va(e,Z),Ee=!!(fe&&fe.total>0||Ie&&be),je=!Ie,ze=Ut(qr,{children:[we(pt,{icon:we(w4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Gn(9),Ne??null,...Ue?[]:[tr(1)]],children:e.created_by?Ut(qr,{children:[we(jr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Ko,{})}),we(pt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Gn(11),Ne??null,...Ue?[]:[tr(2)]],children:e.created_time?on(e.created_time):we(Ko,{})})]});return Ut(qr,{children:[ee?Ut(Xt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Qt?we(f4,{checked:e.completed,icon:we(y4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(ju,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(ae,Fe)=>{Ce||lt({anchorEl:ae.currentTarget,nextCompleted:Fe})},sx:{p:0,mt:.25}}):null,Nt?Ue&&!xt?we(Rp,{onClick:ae=>Se(ae.currentTarget),sx:{display:"flex",p:.25,mt:.1,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:we(Nt,{sx:{fontSize:20}})}):we(Xt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(Ie?"#e5484d":"#1e3a8a")},children:we(Nt,{sx:{fontSize:20}})}):null,we(Xt,{sx:{flex:1,minWidth:0},children:Ze!==null?we(Xt,{component:"div",contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,ref:ae=>{if(!ae||ae.dataset.focused)return;ae.dataset.focused="1",ae.focus();let Fe=document.createRange();Fe.selectNodeContents(ae),Fe.collapse(!1);let Ye=window.getSelection();Ye?.removeAllRanges(),Ye?.addRange(Fe)},onBlur:ae=>{let Fe=(ae.currentTarget.textContent??"").replace(/\n/g," ").trim();!ce.current&&Fe&&Fe!==e.title&&ne(e.seq,Fe),ce.current=!1,Te(null)},onKeyDown:ae=>{ae.key==="Enter"&&(ae.preventDefault(),ae.target.blur()),ae.key==="Escape"&&(ce.current=!0,ae.target.blur())},onPaste:ae=>{ae.preventDefault();let Fe=ae.clipboardData.getData("text/plain").replace(/\n/g," ");document.execCommand("insertText",!1,Fe)},sx:{outline:"none",fontSize:19,fontWeight:600,color:"#37352f",lineHeight:"26px",cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text",wordBreak:"break-word"},children:Ze}):we(Xt,{onClick:()=>Te(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:"26px",cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text",wordBreak:"break-word"},children:e.title})}),we(Dt,{open:!!Ce,anchorEl:Ce?.anchorEl??null,title:Ce?.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:Ce?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>lt(null),onConfirm:()=>{Ce&&re(e.seq,Ce.nextCompleted),lt(null)}})]}):null,Ut(Xt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[Bn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(dl,{hideProject:G,pinColumns:!0,projectColumn:!Ue&&!X?2:"full",values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminders:zn(e),priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:h,avatarSrcByName:l,hideDueDate:!Ue&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:Ie,event:Ue,readOnly:xt,targetSummary:le,onChangeProject:ae=>t(e.seq,ae),onAddProject:n,onChangeStartDate:ae=>c(e.seq,"start_date",ae),onChangeDueDate:ae=>c(e.seq,"due_date",ae),onChangeReminder:ae=>i(e.seq,ae),onChangePriority:ae=>d(e.seq,ae),onChangeEventTime:ae=>m?.(e.seq,ae),onChangeEventPlace:ae=>x?.(e.seq,ae),onChangeEventAddress:ae=>_?.(e.seq,ae),onMemberEdit:ae=>a(e,ae,null),narrowCollapsedSx:Ne,reminderLocked:e.completed,managerAction:Q,leading:Ut(qr,{children:[Rt||Q&&(Ie||Ue)?Ut(Xt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[Ie||Ue?Q:null,Rt?Ut(qr,{children:[we(Zi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Zi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,rt&&e.ticket_no?we(pt,{icon:we(m4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:tr(1),children:we(Xt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ue?null:we(Xt,{sx:rt&&e.ticket_no||je||Ee?tr(rt&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(pt,{icon:we(x4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:xt||e.completed?void 0:ae=>et(ae),children:we(At,{option:lr(e)})})}),Ie?null:(()=>{let ae=kn(e),Fe=ae==="all"?we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}):ae==="group"?we(Np,{sx:{fontSize:17,color:"#d9730d"}}):we(Dp,{sx:{fontSize:17}}),Ye=ae==="all"?"\uC804\uCCB4\uACF5\uAC1C":ae==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(Qe=>Qe.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return we(Xt,{sx:Ue?void 0:tr(rt?1:2),children:we(pt,{icon:Fe,label:"\uACF5\uAC1C",onClick:xt||!f?void 0:Qe=>bt(Qe),children:Ye})})})(),!Ie&&!rt?we(Xt,{sx:Ue?void 0:tr(1),children:we(pt,{icon:we(T4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:xt||!u?void 0:ae=>te(ae),children:e.repeat_rule?sl(e.repeat_rule):we(Ko,{label:"\uC5C6\uC74C"})})}):null,!Ie&&!rt&&e.repeat_rule?we(Xt,{sx:Ue?void 0:tr(2),children:we(pt,{icon:we(C4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:xt||!u?void 0:ae=>me(ae),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:we(Ko,{})})}):null,fe&&fe.total>0?we(Xt,{sx:Ue?void 0:tr(2),children:we(pt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:fe.canConfirm?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Ut(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:fe.myTime?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:ae=>qe({anchorEl:ae.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[fe.count," / ",fe.total]})})}):null,Ie&&be?we(Xt,{sx:tr(2),children:we(pt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Xt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:be.canAck?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):we(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:be.acked?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:ae=>qe({anchorEl:ae.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:be.total>0&&be.count>=be.total?"\uC644\uB8CC":Ut(qr,{children:[be.count,we(Xt,{component:"span",sx:{mx:.4},children:"/"}),be.total]})})})})}):null,de&&!Ve&&!Ue&&!Ie?Ut(qr,{children:[we(pt,{icon:we(g4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:xt?void 0:ae=>Je(ae),sx:tr(1),children:(e.sprint_seq??0)>0?pe.find(ae=>ae.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":we(Ko,{label:"\uBBF8\uBC30\uC815"})}),we(pt,{icon:we(b4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:tr(2),children:we(_o,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:xt,onCommit:ae=>ie?.(e.seq,Number(ae.replace(/[^0-9.]/g,""))||0)})})]}):null,Ue||X?null:we(Xt,{sx:[G?{gridColumn:"1 / -1"}:tr(1),Ne??null],children:we(pt,{icon:we(v4,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:xt?void 0:ae=>Ae(ae),children:(e.label_keys??[]).length>0?we(No,{labelKeys:e.label_keys??[],labelOptions:b}):we(Ko,{})})})]}),afterProject:Ue?null:ze,trailing:Ut(qr,{children:[rt?we(fl,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:xt,showResolution:!!e.completed,onChangeRepro:ae=>De?.(e.seq,"bug_repro",ae),onChangeDevice:ae=>De?.(e.seq,"bug_device",ae),onChangeWhere:ae=>De?.(e.seq,"bug_where",ae),onChangeVersion:ae=>De?.(e.seq,"bug_version",ae),onChangeResolution:ae=>Be?.(e.seq,ae)}):null,Ue?ze:null,e.completed?Ut(qr,{children:[we(pt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Gn(10),Ne??null,...Ue?[]:[tr(1)]],children:e.completed_by?Ut(qr,{children:[we(jr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Ko,{})}),we(pt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Gn(12),Ne??null,...Ue?[]:[tr(2)]],children:e.completed_time?on(e.completed_time):we(Ko,{})})]}):null]})}),Ut(Xt,{sx:{display:"none",[Bn]:{display:"block",mt:1.5,mb:0}},children:[we(yi,{sx:{borderColor:"#e6e6e3"}}),we(Rp,{onClick:()=>$e(ae=>!ae),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:kt?Ut(qr,{children:["\uC811\uAE30 ",we(h4,{sx:{fontSize:18}})]}):Ut(qr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we(p4,{sx:{fontSize:18}})]})})]}),Ut(Xt,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3",[Bn]:{mt:0,mb:1.25}}}),we(bn,{icon:we(_4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!xt?we(pl,{content:e.content??"",templates:D,onApply:ae=>j?.(e.seq,ae),onSave:P,onRemove:N}):void 0,children:we(Xt,{sx:{userSelect:"text"},children:q?we(Xt,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:we($a,{})}):we(ml,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:z?ae=>z(e.seq,ae):void 0,readOnly:xt,onChange:ae=>j(e.seq,ae)})})}),e.is_bug?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(bn,{icon:we(k4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Xt,{sx:{userSelect:"text"},children:we(Cp,{value:e.note,readOnly:Vt,onCommit:ae=>B(e.seq,ae),onDraftChange:A?ae=>A(e.seq,ae):void 0})})})]}),Ue?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(yl,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Vt,onAdd:T,onToggle:C,onRemove:R,onUpdate:p,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:S,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ue&&!Ie&&Ip(e,E)?Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(Mp,{task:e,tasks:E,readOnly:xt,onOpenTask:L,onLink:$,onUnlink:U,onCreateFollowUp:O})]}):null,we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(_l,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Vt,onAdd:W,onRemove:M,onPreview:I?ae=>I({...ae,taskSeq:e.seq}):void 0,onDownload:F?ae=>F({...ae,taskSeq:e.seq}):void 0})]}),we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(xp,{taskSeq:e.seq,comments:e.comments??[],currentUserName:H,myAccountSeq:Z,avatarSrcByName:l,onUpdate:V,onRemove:Y,onToggleReaction:K,onPreview:I?ae=>I({...ae,taskSeq:e.seq}):void 0,onDownload:F?ae=>F({...ae,taskSeq:e.seq}):void 0})]}),we(Ei,{anchorEl:vt,value:e.status,options:Ie?ys:rt?ni:xs,onSelect:ae=>o(e.seq,ae),onClose:()=>et(null)}),we(Nu,{transitionDuration:0,anchorEl:tt,open:!!tt,onClose:()=>te(null),children:[{value:"",label:"\uC5C6\uC74C"},...Os].map(ae=>we(Lu,{selected:(e.repeat_rule??"")===ae.value,onClick:()=>{te(null),(async()=>{let Fe=e.repeat_rule??"";if(ae.value===Fe)return;if(ae.value===""){await Lp({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let Ye=String(e.due_date??"").slice(0,10);if(!Ye){B4(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}Fe&&!await Lp({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,ae.value,al(Ye,ae.value))})()},sx:{fontSize:14,minWidth:140},children:ae.label},ae.value||"none"))}),we(I4,{anchorEl:ue,open:!!ue,onClose:()=>me(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:ae=>{me(null);let Fe=qt=>String(qt).padStart(2,"0"),Ye=`${ae.getFullYear()}-${Fe(ae.getMonth()+1)}-${Fe(ae.getDate())}`,Qe=e.repeat_rule??"";Qe&&u?.(e.seq,Qe,Ye)}}),we(Nu,{transitionDuration:0,anchorEl:Ke,open:!!Ke,onClose:()=>bt(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(Dp,{sx:{fontSize:17,color:"#57564f"}}),selected:kn(e)==="involved",onPick:()=>f?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}),selected:kn(e)==="all",onPick:()=>f?.(e.seq,"all",0)},...g.map(ae=>({key:`group-${ae.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${ae.name}`,icon:we(Np,{sx:{fontSize:17,color:"#d9730d"}}),selected:kn(e)==="group"&&(e.visibility_group_seq??0)===ae.seq,onPick:()=>f?.(e.seq,"group",ae.seq)}))].map(ae=>Ut(Lu,{selected:ae.selected,onClick:()=>{ae.onPick(),bt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ae.icon,ae.label,ae.selected?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},ae.key))}),we(Nu,{transitionDuration:0,anchorEl:ke,open:!!ke,onClose:()=>Je(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...pe.filter(ae=>`custom-${ae.group_seq}`===String(e.tab_key??"")).map(ae=>({seq:ae.seq,label:mn(ae)}))].map(ae=>Ut(Lu,{onClick:()=>{Pe?.(e.seq,ae.seq),Je(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ae.label,(e.sprint_seq??0)===ae.seq?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},ae.seq))}),we(Ua,{anchorEl:Le?.anchorEl??null,open:!!Le?.open,acks:e.acks??[],total:be?.total??fe?.total??0,pendingNames:be?.pendingNames??fe?.pendingNames??[],avatarSrcByName:l,onRequestConfirm:_e&&(be?be.count<be.total:fe&&fe.count<fe.total)?()=>{_e(e.seq),qe(ae=>ae?{...ae,open:!1}:null)}:void 0,onClose:()=>qe(ae=>ae?{...ae,open:!1}:null)}),we(Sl,{anchorEl:Me,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:ae=>s(e.seq,Ia(e.label_keys??[],ae)),onAddLabel:r,onClose:()=>Ae(null)}),we(zo,{anchorEl:Re,value:e.icon??"",color:e.icon_color??"",onSelect:ae=>{oe(e.seq,ae),Se(null)},onSelectColor:se?ae=>se(e.seq,ae):void 0,onClose:()=>Se(null)}),we(Dt,{open:!!yt,anchorEl:yt,title:dt?"\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:()=>We(null),onConfirm:()=>{ye?.(e.seq),We(null)}})]})}import{Fragment as P4,jsx as $r,jsxs as Wp}from"react/jsx-runtime";function GF(){let e=new Date,h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function YF({open:e,task:h,onClose:b,onAddComment:l,onSaveFields:o,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Lt(),B=Fp(null);h&&(B.current=h);let A=h??B.current,[j,D]=qp(!1),[P,N]=qp({}),q=Object.keys(P).length>0;zp(()=>{N({})},[h?.seq,e]);let z=Fp(null);if(zp(()=>{z.current?.scrollTo({top:0})},[h?.seq]),!A)return null;let T=_&&q?{...A,...P}:A,C=T.checklist??[],R=(S,E)=>{_?N(L=>({...L,...S})):E()},p=()=>{let S=P;N({});let E=A.seq,L=S.title===void 0?void 0:String(S.title).trim();if(o){let $={...S};L!==void 0&&(L?$.title=L:delete $.title),Object.keys($).length>0&&o(E,$),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}L&&n(E,L),S.icon!==void 0&&c(E,String(S.icon)),S.icon_color!==void 0&&i?.(E,String(S.icon_color)),S.status!==void 0&&x.onChangeStatus(E,S.status),S.label_keys!==void 0&&x.onChangeLabels(E,S.label_keys??[]),S.tab_key!==void 0&&x.onChangeProject(E,String(S.tab_key??"")),S.start_date!==void 0&&x.onChangeDate(E,"start_date",String(S.start_date??"")),S.due_date!==void 0&&x.onChangeDate(E,"due_date",String(S.due_date??"")),S.reminders!==void 0&&x.onChangeReminder(E,S.reminders),S.priority!==void 0&&x.onChangePriority(E,S.priority),S.event_time!==void 0&&x.onChangeEventTime?.(E,String(S.event_time??"")),S.event_place!==void 0&&x.onChangeEventPlace?.(E,String(S.event_place??"")),S.event_address!==void 0&&x.onChangeEventAddress?.(E,String(S.event_address??"")),S.content!==void 0&&x.onChangeContent(E,String(S.content??"")),S.note!==void 0&&x.onChangeNote(E,String(S.note??"")),S.visibility!==void 0&&x.onChangeVisibility?.(E,S.visibility,Number(S.visibility_group_seq??0)),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(S,E)=>R({status:E},()=>x.onChangeStatus(S,E)),onChangeLabels:(S,E)=>R({label_keys:E},()=>x.onChangeLabels(S,E)),onChangeProject:(S,E)=>R({tab_key:E},()=>x.onChangeProject(S,E)),onChangeDate:(S,E,L)=>R({[E]:L},()=>x.onChangeDate(S,E,L)),onChangeReminder:(S,E)=>R({reminders:E},()=>x.onChangeReminder(S,E)),onChangePriority:(S,E)=>R({priority:E},()=>x.onChangePriority(S,E)),onChangeEventTime:(S,E)=>R({event_time:E},()=>x.onChangeEventTime?.(S,E)),onChangeEventPlace:(S,E)=>R({event_place:E},()=>x.onChangeEventPlace?.(S,E)),onChangeEventAddress:(S,E)=>R({event_address:E},()=>x.onChangeEventAddress?.(S,E)),onChangeContent:(S,E)=>R({content:E},()=>x.onChangeContent(S,E)),onChangeNote:(S,E)=>R({note:E},()=>x.onChangeNote(S,E)),onMemberEdit:(S,E)=>x.onMemberEdit(S,E,_?L=>N($=>({...$,...L})):null),onChangeNoteDraft:_?(S,E)=>R({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(S,E,L)=>R({visibility:E,visibility_group_seq:L},()=>x.onChangeVisibility?.(S,E,L)):void 0,onAddChecklistItem:(S,E)=>R({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(S,E)),onToggleChecklistItem:(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,checked:L}:$)},()=>x.onToggleChecklistItem(S,E,L)),onRemoveChecklistItem:(S,E)=>R({checklist:C.filter((L,$)=>$!==E)},()=>x.onRemoveChecklistItem(S,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,label:L}:$)},()=>x.onUpdateChecklistItem?.(S,E,L)):void 0,onReorderChecklist:x.onReorderChecklist?(S,E)=>R({checklist:E},()=>x.onReorderChecklist?.(S,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(S,E,L)=>R({checklist:[...C,{label:L,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(S,E,L)):void 0},v=$r(jp,{...y,task:T,myAccountSeq:r,onChangeTitle:(S,E)=>R({title:E},()=>n(S,E)),onToggleCompleted:t,onChangeIcon:(S,E)=>R({icon:E},()=>c(S,E)),onChangeIconColor:(S,E)=>R({icon_color:E},()=>i?.(S,E)),showTitle:_||s==="dialog"}),w=$r(vp,{onSubmit:(S,E)=>l(T.seq,S,E)},T.seq);return _||s==="dialog"?Wp(P4,{children:[$r(D4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:T.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":T.is_event?"\uC77C\uC815":T.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...f?[{icon:$r(O4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:$r(R4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Ki(T,!0)},..._?[{raw:!0,icon:$r(E4,{variant:"contained",size:"small",disableElevation:!0,disabled:!q,onClick:q?p:void 0,sx:{ml:1.5,height:32,minWidth:64,px:1.75,py:0,borderRadius:1,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#f2f2f0",color:"#c9c8c5"}},children:"\uC800\uC7A5\uD558\uAE30"})}]:[]]},fullScreen:_,maxWidth:_?void 0:"md",width:_?void 0:720,mobilePresentation:_?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:w},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:$r(Ol,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},A.seq),$r(Ml,{open:j,taskSeq:T.seq,items:a,loading:d,onLoad:f,onClose:()=>D(!1)})]}):$r(M4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Wp(Ol,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[$r(Tp,{task:T,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,onClose:b,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m}),$r($p,{sx:{borderColor:"#e6e6e3"}}),$r(Ol,{sx:{flex:1,minHeight:0},children:$r(A4,{ref:z,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),$r($p,{sx:{borderColor:"#37352f"}}),$r(Ol,{sx:{flexShrink:0},children:w})]})})}import{useEffect as W4,useState as Bo}from"react";import{Box as Hr,Button as Hu,IconButton as Kp}from"@mui/material";import{FormDialog as Gp}from"@ehfuse/mui-form-dialog";import U4 from"@mui/icons-material/Add";import V4 from"@mui/icons-material/DirectionsRunOutlined";import K4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Yp}from"@ehfuse/alerts";import{ClearTextField as Xp,DateTextField as Zp,LabelSelect as Jp}from"@ehfuse/mui-form-controls";import{useEffect as N4,useState as Up}from"react";import{Box as Co,Button as L4,FormControlLabel as Fu,Radio as qu,RadioGroup as j4}from"@mui/material";import{FormDialog as z4}from"@ehfuse/mui-form-dialog";import{LabelSelect as F4}from"@ehfuse/mui-form-controls";import q4 from"@ehfuse/overlay-scrollbar";import{Fragment as $4,jsx as Ar,jsxs as Ji}from"react/jsx-runtime";function Vp({open:e,sprint:h,remainingTasks:b,sprints:l,onClose:o,onConfirm:s}){let r=l.filter(d=>d.seq!==h?.seq&&d.group_seq===(h?.group_seq??0)&&d.status!=="closed"),[t,n]=Up("backlog"),[c,i]=Up(0);N4(()=>{e&&(n(r.length>0?"move":"backlog"),i(r[0]?.seq??0))},[e]);let a=b.length>0;return Ar(z4,{open:e,onClose:o,maxWidth:"sm",title:"\uBAA9\uD45C \uB9C8\uAC10",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-close",tabs:{visible:!1},actions:{showCancelButton:!0,right:Ar(L4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(d=>d.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:Ji(Co,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Ji(Co,{sx:{fontSize:18,color:"#37352f"},children:[Ar(Co,{component:"span",sx:{fontWeight:600},children:h?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?Ji($4,{children:[Ji(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:["\uB05D\uB098\uC9C0 \uC54A\uC740 \uC5C5\uBB34\uAC00"," ",b.length,"\uAC74 \uC788\uC2B5\uB2C8\uB2E4. \uC5B4\uB5BB\uAC8C \uD560\uAE4C\uC694?"]}),Ar(Co,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Ar(q4,{style:{maxHeight:220},thumb:{width:6},children:b.map(d=>Ji(Co,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Ar(Co,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Ar(At,{option:lr(d)})]},d.seq))})}),Ji(j4,{value:t,onChange:(d,f)=>n(f),children:[r.length>0?Ar(Fu,{value:"move",control:Ar(qu,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Ar(Co,{sx:{pl:4,pb:1},children:Ar(F4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(d=>({value:String(d.seq),label:d.name})),onChange:d=>i(Number(d.target.value)||0)})}):null,Ar(Fu,{value:"backlog",control:Ar(qu,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Ar(Fu,{value:"keep",control:Ar(qu,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Ar(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:"\uB0A8\uC740 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774\uB300\uB85C \uB9C8\uAC10\uD558\uBA74 \uBAA9\uD45C\uAC00 \uC885\uB8CC\uB429\uB2C8\uB2E4."})]})}]})}var $u="custom-";function H4(e){return e.startsWith($u)}function aq(e){return e>0?`${$u}${e}`:""}function Go(e){if(!H4(e))return 0;let h=Number(e.slice($u.length));return Number.isInteger(h)&&h>0?h:0}import{Fragment as em,jsx as Ft,jsxs as Yo}from"react/jsx-runtime";var G4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function Qp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function vq({open:e,customTabs:h,sprints:b,onClose:l,onCreate:o,onUpdate:s,onChangeStatus:r,tasks:t=[],onCloseSprint:n,onRemove:c}){let i=h.filter(E=>E.useSprints&&!E.archived),[a,d]=Bo(""),[f,u]=Bo(""),[g,m]=Bo(""),[x,_]=Bo(""),[B,A]=Bo(""),[j,D]=Bo(!1),[P,N]=Bo(!1),[q,z]=Bo(null),T=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,R]=Bo(0);W4(()=>{e&&(d(i.length===1?i[0].key:""),u(""),m(""),_(""),A(""),R(0))},[e]);let p=()=>{u(""),m(""),_(""),A(""),R(0),N(!1)},y=E=>{R(E.seq),d(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),A(E.end_date)},v=C>0||P,w=async()=>{let E=Go(a);if(!E){Yp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!f.trim()){Yp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:f.trim(),goal:g.trim(),start_date:x,end_date:B}),p();return}await o({group_seq:E,name:f.trim(),goal:g.trim(),start_date:x,end_date:B})&&p()}finally{D(!1)}},k=new Map(h.map(E=>[Go(E.key),E.label])),S=Ft(Hr,{children:i.length===0?Ft(Hr,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):Ft(em,{children:Ft(Hr,{children:b.length===0?Yo(Hr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ft(V4,{sx:{fontSize:48,color:"#d9d9d6"}}),Ft(Hr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Yo(Hr,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Yo(Hr,{sx:{minWidth:0},children:[Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Ft(Hr,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),Ft(Hr,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:k.get(E.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Yo(Hr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Qp(E.start_date)," ~"," ",Qp(E.end_date)]})]}),E.goal?Ft(Hr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Ft(Jp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:G4.map(L=>({value:L.value,label:L.label})),onChange:L=>{let $=String(L.target.value);if($==="closed"&&n){z(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),Ft(Kp,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Ft(K4,{sx:{fontSize:18}})}),Ft(Kp,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Ft(cr,{style:{width:16,height:16}})})]})]},E.seq))})})});return Yo(em,{children:[Ft(Gp,{open:e,onClose:l,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:i.length>0?Ft(Hu,{startIcon:Ft(U4,{}),onClick:()=>{p(),N(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:Ft(Hu,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),Ft(Vp,{open:q!==null,sprint:q,remainingTasks:T,sprints:b,onClose:()=>z(null),onConfirm:E=>{q&&n?.(q.seq,E),z(null)}}),Ft(Gp,{open:v,onClose:()=>{N(!1),p()},maxWidth:"sm",title:C>0?"\uBAA9\uD45C \uC218\uC815":"\uC0C8 \uBAA9\uD45C",locale:"ko",backdropClick:!1,tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-form",sections:[{id:"sprint-form",title:"",showTitle:!1,children:Ft(Hr,{sx:{pt:1},children:Yo(Hr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Ft(Jp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:i.map(E=>({value:E.key,label:E.label})),onChange:E=>d(String(E.target.value)),disabled:C>0}),Ft(Xp,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:f,onChange:E=>u(E.target.value)}),Ft(Zp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),Ft(Zp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>A(E.target.value)}),Ft(Xp,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:g,onChange:E=>m(E.target.value),sx:{gridColumn:"1 / -1"}})]})})}],actions:{showCancelButton:!0,right:Ft(Hu,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{Box as Jr,Button as om,Tooltip as Y4}from"@mui/material";import{FormDialog as X4}from"@ehfuse/mui-form-dialog";import Z4 from"@mui/icons-material/CalendarMonthOutlined";import J4 from"@mui/icons-material/FileUploadOutlined";import Q4 from"@mui/icons-material/FileDownloadOutlined";var Wu={google:{key:"google",name:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.google.com/calendar",defaultCalendarName:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > **URL\uB85C \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > **\uC124\uC815 \uBC0F \uACF5\uC720**\uB97C \uC5FD\uB2C8\uB2E4.","**\uCE98\uB9B0\uB354 \uD1B5\uD569** \uC139\uC158\uC758 **iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",buildSubscribeUrl:e=>`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(e.replace(/^https?:\/\//,"webcal://"))}`},apple:{key:"apple",name:"\uC560\uD50C \uCE98\uB9B0\uB354",homeUrl:"https://www.icloud.com/calendar",defaultCalendarName:"\uC560\uD50C \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uC544\uC774\uD3F0\xB7\uC544\uC774\uD328\uB4DC: **\uC124\uC815 > \uCE98\uB9B0\uB354 > \uACC4\uC815 > \uACC4\uC815 \uCD94\uAC00 > \uAE30\uD0C0 > \uAD6C\uB3C5 \uCE98\uB9B0\uB354 \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB9E5: \uCE98\uB9B0\uB354 \uC571 > **\uD30C\uC77C > \uC0C8\uB85C\uC6B4 \uCE98\uB9B0\uB354 \uAD6C\uB3C5**\uC5D0 \uBD99\uC5EC\uB123\uC2B5\uB2C8\uB2E4.","iCloud.com(\uC6F9)\uC5D0\uC11C\uB294 \uAD6C\uB3C5\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uAE30\uAE30\uC5D0\uC11C \uCD94\uAC00\uD558\uBA74 iCloud \uB85C \uB3D9\uAE30\uD654\uB429\uB2C8\uB2E4."],importSteps:["iCloud.com > \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354 \uC606 **\uACF5\uC720 \uC544\uC774\uCF58**\uC744 \uB204\uB985\uB2C8\uB2E4.","**\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB97C \uCF1C\uACE0 \uB098\uC624\uB294 **\uB9C1\uD06C\uB97C \uBCF5\uC0AC**\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694(webcal:// \uC8FC\uC18C\uB3C4 \uADF8\uB300\uB85C \uB429\uB2C8\uB2E4)."],importPlaceholder:"webcal://p00-calendars.icloud.com/published/\u2026",importWarning:"\uC560\uD50C\uC740 **\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB85C \uBC14\uAFD4\uC57C \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},naver:{key:"naver",name:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.naver.com",defaultCalendarName:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uB0B4 \uCE98\uB9B0\uB354** \uC606 **+** > **URL\uB85C \uAD6C\uB3C5\uD558\uAE30**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB124\uC774\uBC84\uAC00 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uB124\uC774\uBC84 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAD6C\uB3C5\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uCE98\uB9B0\uB354 \uC124\uC815**(\uD1B1\uB2C8)\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uB97C \uACE0\uB985\uB2C8\uB2E4.","**\uC678\uBD80 \uACF5\uAC1C** \uD56D\uBAA9\uC5D0\uC11C **\uCE98\uB9B0\uB354 \uACF5\uAC1C**\uB97C \uCCB4\uD06C\uD558\uBA74 \uB098\uC624\uB294 **iCal \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.naver.com/\u2026(iCal \uC8FC\uC18C)",importWarning:"\uB124\uC774\uBC84\uB294 **\uCE98\uB9B0\uB354\uB97C \uACF5\uAC1C**\uD574\uC57C iCal \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."}},tm=Object.values(Wu);function Al(e){return Wu[e??"google"]??Wu.google}import{jsx as dr,jsxs as Qi}from"react/jsx-runtime";function Mq({open:e,imports:h=[],onOpenExport:b,onOpenImport:l,onClose:o}){let s=Qi(Jr,{sx:{display:"flex",flexDirection:"column",gap:"24px"},children:[Qi(Jr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,color:"#37352f",display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uB0B4\uBCF4\uB0B4\uAE30"}),"\uB294 \uB0B4 \uC5C5\uBB34\uB97C \uB2E4\uB978 \uCE98\uB9B0\uB354\uC5D0\uC11C"," ",dr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uBCF4\uAC8C \uD569\uB2C8\uB2E4."]})}),dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uAC00\uC838\uC624\uAE30"}),"\uB294 \uADF8 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uACB9\uCCD0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."]})}),dr(Jr,{children:dr(Jr,{component:"span",children:"\uB450 \uBC29\uD5A5 \uBAA8\uB450 \uC6D0\uBCF8\uC744 \uACE0\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})})]}),dr(Jr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:tm.map((r,t)=>Qi(Jr,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.75,borderTop:t>0?"1px solid #f2f2f0":"none"},children:[dr(Z4,{sx:{fontSize:22,color:"#787774",flexShrink:0}}),Qi(Jr,{sx:{flex:1,minWidth:0},children:[dr(Jr,{sx:{fontSize:16,color:"#37352f"},children:r.name}),r.exportBlockedReason??r.importBlockedReason?dr(Jr,{sx:{fontSize:13.5,color:"#8a6d1d",mt:.25,lineHeight:1.6},children:r.exportBlockedReason??r.importBlockedReason}):null]}),dr(nm,{label:"\uB0B4\uBCF4\uB0B4\uAE30",icon:dr(J4,{sx:{fontSize:18}}),supported:r.exportSupported,reason:r.exportBlockedReason,onClick:()=>b(r.key)}),dr(nm,{label:rm(h,r.key)>0?`\uAC00\uC838\uC624\uAE30 (${rm(h,r.key)})`:"\uAC00\uC838\uC624\uAE30",icon:dr(Q4,{sx:{fontSize:18}}),supported:r.importSupported,reason:r.importBlockedReason,onClick:()=>l(r.key)})]},r.key))})]});return dr(X4,{open:e,onClose:o,width:680,title:"\uCE98\uB9B0\uB354 \uC5F0\uB3D9",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-link",sectionContentPaddingTop:0,sections:[{id:"calendar-link",showTitle:!1,children:s}],actions:{showCancelButton:!1,right:dr(om,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}function rm(e,h){return e.filter(b=>b.provider===h).length}function nm({label:e,icon:h,supported:b,reason:l,onClick:o}){let s=dr(Jr,{component:"span",sx:{flexShrink:0},children:dr(om,{size:"medium",variant:"outlined",startIcon:h,disabled:!b,onClick:o,sx:{minWidth:132,whiteSpace:"nowrap"},children:e})});return b?s:dr(Y4,{title:l??"\uC774 \uC11C\uBE44\uC2A4\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",arrow:!0,children:s})}import{useState as im}from"react";import{Box as xr,Button as Vu,Divider as r6,IconButton as n6,TextField as o6}from"@mui/material";import{FormDialog as i6}from"@ehfuse/mui-form-dialog";import s6 from"@mui/icons-material/OpenInNewOutlined";import a6 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as l6}from"@ehfuse/alerts";import{Fragment as e6}from"react";import{Fragment as t6,jsx as Uu}from"react/jsx-runtime";function qs({text:e}){let h=String(e??"").split("**");return Uu(t6,{children:h.map((b,l)=>l%2===1?Uu("b",{children:b},l):Uu(e6,{children:b},l))})}import{jsx as zt,jsxs as $s}from"react/jsx-runtime";function Uq({open:e,imports:h,provider:b,onRegister:l,onRemove:o,onClose:s}){let r=Al(b),[t,n]=im(""),[c,i]=im(!1),a=async()=>{let u=t.trim();if(u){i(!0);try{await l(u)&&n("")}finally{i(!1)}}},d=async u=>{await l6({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||r.defaultCalendarName}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&o(u.seq)},f=$s(xr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[$s(xr,{sx:{color:"#37352f",lineHeight:1.7},children:[r.name,"\uC758 \uC77C\uC815\uC744 ",zt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",zt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",zt("b",{children:"\uC678\uBD80 \uCE98\uB9B0\uB354 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),zt(xr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),h.length>0?zt(xr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:h.map((u,g)=>$s(xr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:g>0?"1px solid #efefed":"none"},children:[zt(a6,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),zt(xr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||r.defaultCalendarName}),zt(n6,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{d(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(cr,{sx:{fontSize:18}})})]},u.seq))}):zt(xr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),zt(r6,{sx:{my:1,borderColor:"#e6e6e3"}}),zt(xr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),$s(xr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[r.importSteps.map(u=>zt(xr,{children:zt(xr,{component:"span",children:zt(qs,{text:u})})},u)),zt(xr,{children:zt(xr,{component:"span",children:"\uB4F1\uB85D\uD55C \uC8FC\uC18C\uB294 \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),zt(xr,{children:zt(xr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})}),r.importWarning?zt(xr,{children:zt(xr,{component:"span",children:zt(qs,{text:r.importWarning})})}):null]}),$s(xr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[zt(o6,{value:t,onChange:u=>n(u.target.value),fullWidth:!0,label:"iCal \uC8FC\uC18C",placeholder:r.importPlaceholder,slotProps:{input:{spellCheck:!1}}}),zt(Vu,{variant:"contained",disabled:!t.trim()||c,onClick:()=>{a()},sx:{flexShrink:0},children:c?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return zt(i6,{open:e,onClose:s,width:680,title:`${r.name} \uAC00\uC838\uC624\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:f}],actions:{showCancelButton:!1,left:zt(Vu,{variant:"outlined",startIcon:zt(s6,{sx:{fontSize:16}}),onClick:()=>window.open(r.homeUrl,"_blank"),children:r.name}),right:zt(Vu,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{Box as xi,Button as Hs,TextField as c6}from"@mui/material";import{FormDialog as u6}from"@ehfuse/mui-form-dialog";import d6 from"@mui/icons-material/ContentCopyOutlined";import sm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as am}from"@ehfuse/alerts";import{Fragment as h6,jsx as Tr,jsxs as vi}from"react/jsx-runtime";function f6(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function t$({open:e,feed:h,feedTaskCount:b,provider:l,buildFeedUrl:o,onSubscribe:s,onClose:r}){let t=Al(l),n=o??f6,c=h.subscribed?n(h.token):"",i=()=>{navigator.clipboard.writeText(c).then(()=>am("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>am("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},a=()=>{let f=t.buildSubscribeUrl?.(c);f&&window.open(f,"_blank")},d=vi(xi,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[vi(xi,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Tr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C ",t.name,"\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?vi(xi,{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.",Tr("br",{}),Tr("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",h.subscribed?`${t.name}\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.`:"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):h.subscribed&&h.enabled?vi(h6,{children:[Tr(c6,{value:c,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),vi(xi,{sx:{display:"flex",gap:2},children:[Tr(Hs,{variant:"outlined",startIcon:Tr(d6,{}),onClick:i,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),t.buildSubscribeUrl?vi(Hs,{variant:"contained",startIcon:Tr(sm,{}),onClick:a,children:[t.name,"\uC5D0 \uCD94\uAC00"]}):null]}),vi(xi,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[t.subscribeSteps.map(f=>Tr(xi,{children:Tr("span",{children:Tr(qs,{text:f})})},f)),Tr(xi,{children:Tr("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."})})]})]}):Tr(Hs,{variant:"contained",onClick:s,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Tr(u6,{open:e,onClose:r,width:680,title:`${t.name}\uB85C \uB0B4\uBCF4\uB0B4\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:d}],actions:{showCancelButton:!1,left:Tr(Hs,{variant:"outlined",startIcon:Tr(sm,{sx:{fontSize:16}}),onClick:()=>window.open(t.homeUrl,"_blank"),children:t.name}),right:Tr(Hs,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{useEffect as p6,useMemo as Ku,useState as Gu}from"react";import{Box as Ws,Button as m6,Typography as g6}from"@mui/material";import{FormDialog as b6}from"@ehfuse/mui-form-dialog";import{SearchTextField as y6}from"@ehfuse/mui-form-controls";import{TreeView as x6}from"@ehfuse/tree-view";import{Fragment as T6,jsx as On,jsxs as C6}from"react/jsx-runtime";function lm(e){return`${e.name}#${e.seq}`}function v6(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function w6(e){let h=[],b=l=>{for(let o of l.employees??[])h.push(o);for(let o of l.groups??[])b(o)};for(let l of e)b(l);return h}function _6(e,h){return h?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(h)):!0}function k6(e){let h=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:lm(e),renderLabel:On(Ws,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:On(Ws,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:h})})}}function cm(e,h){let b=(e.groups??[]).map(o=>cm(o,h)).filter(o=>o!==null),l=(e.employees??[]).filter(o=>_6(o,h)).map(k6);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function S6({groups:e,allEmployees:h,initialSelectedSeqs:b,multiple:l,isMobile:o,onSelectionChange:s}){let[r,t]=Gu(""),n=Ku(()=>e.map(i=>cm(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),c=Ku(()=>h.filter(i=>b.includes(i.seq)).map(lm),[]);return C6(T6,{children:[On(Ws,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:On(y6,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),On(Ws,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:On(x6,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:i=>s(i.map(v6).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function u$({open:e,title:h="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:l,multiple:o=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let c=Lt(),[i,a]=Gu([]),[d,f]=Gu(0),u=Ku(()=>w6(l),[l]),g=s??[];p6(()=>{e&&(a(g),f(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>i.includes(_.seq));t(o?x:x.slice(0,1)),n()};return On(b6,{open:e,onClose:n,title:`${h}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:c,mobilePresentation:c?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:On(Ws,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:On(S6,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:c,onSelectionChange:a},d)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?On(g6,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:On(m6,{variant:"contained",onClick:m,children:r})}})}import{useEffect as Xk,useMemo as Wm,useState as Zs}from"react";import{Box as Mo,Button as Um}from"@mui/material";import{FormDialog as Zk}from"@ehfuse/mui-form-dialog";import{LabelSelect as od}from"@ehfuse/mui-form-controls";import Jk from"@mui/icons-material/SpeedOutlined";import{useEffect as B6,useState as I6}from"react";import{Box as Qr,Button as E6}from"@mui/material";import{FormDialog as M6}from"@ehfuse/mui-form-dialog";import{LabelSelect as R6,NumberField as um}from"@ehfuse/mui-form-controls";import O6 from"@ehfuse/overlay-scrollbar";import{jsx as Wr,jsxs as Us}from"react/jsx-runtime";var A6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function dm({open:e,capacity:h,employees:b,onClose:l,onSave:o}){let[s,r]=I6(h??io);B6(()=>{e&&r(h??io)},[e,h]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,i)=>{let a=Math.max(0,Math.floor(Number(i)||0));r(d=>{let f={...d.by_account};return a>0?f[c]=a:delete f[c],{...d,by_account:f}})};return Wr(M6,{open:e,onClose:l,maxWidth:"sm",title:"\uC778\uC6D0 \uC6A9\uB7C9",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-capacity",tabs:{visible:!1},actions:{showCancelButton:!0,right:Wr(E6,{variant:"contained",onClick:()=>{o(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:Us(Qr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Wr(Qr,{sx:{fontSize:15,color:"#37352f"},children:"\uD55C \uC0AC\uB78C\uC774 \uB3D9\uC2DC\uC5D0 \uC548\uC744 \uC218 \uC788\uB294 \uC591\uC744 \uC815\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC744 \uB118\uAE30\uBA74 \uC6CC\uD06C\uB85C\uB4DC \uCC28\uD2B8\uC5D0\uC11C \uBD89\uAC8C \uD45C\uC2DC\uB429\uB2C8\uB2E4. 0 \uC73C\uB85C \uB450\uBA74 \uC6A9\uB7C9\uC744 \uC4F0\uC9C0 \uC54A\uACE0 \uD300 \uD3C9\uADE0\uC744 \uAE30\uC900\uC73C\uB85C \uBD05\uB2C8\uB2E4."}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Wr(R6,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:A6,onChange:c=>r(i=>({...i,basis:c.target.value}))})]}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Wr(um,{size:"medium",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,value:s.default_capacity,onValueChange:c=>r(i=>({...i,default_capacity:Math.max(0,Math.floor(Number(c)||0))}))})]}),Wr(Qr,{sx:{pl:"119px",mt:-1.25,fontSize:13.5,color:"#37352f"},children:`\uC804\uC6D0 \uACF5\uD1B5 \uAE30\uC900(${t}) \xB7 0 = \uC6A9\uB7C9 \uC548 \uC500`}),Wr(Qr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Wr(Qr,{sx:{fontSize:15,color:"#787774"},children:"\uC9C1\uC6D0 \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uAE30\uBCF8 \uC6A9\uB7C9\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."}):Wr(Qr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Wr(O6,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Us(Qr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Wr(Qr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Wr(Qr,{sx:{width:132,flexShrink:0},children:Wr(um,{size:"small",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,clearWhenZero:!0,value:s.by_account[Number(c.account_seq)]??0,onValueChange:i=>n(Number(c.account_seq),String(i??""))})})]},c.account_seq))})})]})}]})}import{Box as Pl}from"@mui/material";import{Bar as L6,BarChart as j6,CartesianGrid as z6,Cell as F6,ReferenceLine as q6,ResponsiveContainer as $6,Tooltip as H6,XAxis as W6,YAxis as U6}from"recharts";import{Box as D6}from"@mui/material";import{jsx as P6}from"react/jsx-runtime";function Ur({text:e,height:h}){return P6(D6,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof h=="number"?{height:h,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}import{createElement as N6}from"react";var Dl="#2f80ed",fm="#a9c9f5",wi="#9a9a97",Yu="#2e9e6b",Jn="#3d7eff",Xu="#c3c8ce",Vs="#f2a30f",Ks={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},es={...Ks,cursor:!1},ts={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>N6("span",{style:{paddingRight:14,color:"#37352f"}},e)};function fr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var Dr={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function Qn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as An,jsxs as Gs}from"react/jsx-runtime";function V6(e,h){let b=h.filter(l=>l.sprint_seq===e.seq&&!l.archived&&l.completed);return{points:b.reduce((l,o)=>l+(o.story_points??0),0),count:b.length}}function hm({sprints:e,tasks:h,height:b=200}){let o=[...e].sort((i,a)=>`${i.start_date}|${i.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(i=>({sprint:i,...V6(i,h)})),s=o.some(i=>i.points>0),r=s?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>s?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,a)=>i+a,0)/t.length*10)/10:null,c=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?An(Ur,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Gs(Pl,{sx:fr(b),children:[Gs(Pl,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Gs("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Gs("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",An(Pl,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),An(Pl,{sx:Qn(b),children:An($6,{width:"100%",height:"100%",children:Gs(j6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[An(z6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),An(W6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),An(U6,{tick:{fontSize:13},width:40,allowDecimals:!1}),An(H6,{...es,formatter:i=>`${Number(i??0)}${r}`}),n!==null?An(q6,{y:n,stroke:wi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,An(L6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(i=>An(F6,{fill:i.closed?Dl:fm},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as K6}from"react";import{Box as eo}from"@mui/material";import{CartesianGrid as G6,Line as pm,LineChart as Y6,ResponsiveContainer as X6,Tooltip as Z6,XAxis as J6,YAxis as Q6}from"recharts";import{jsx as en,jsxs as Xo}from"react/jsx-runtime";function mm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function ek(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function tk(e){return e.slice(5).replace("-",".")}function gm({sprint:e,tasks:h,todayStr:b,height:l=200,headerLeft:o}){let s=K6(()=>{let a=mm(e.start_date),d=mm(e.end_date);if(!a||!d||d<a||Math.round((d.getTime()-a.getTime())/864e5)+1>366)return null;let u=h.filter(P=>P.sprint_seq===e.seq&&!P.archived);if(u.length===0)return{empty:!0};let g=u.some(P=>(P.story_points??0)>0),m=P=>g?P.story_points??0:1,x=u.reduce((P,N)=>P+m(N),0),_=new Map;for(let P of u){if(!P.completed)continue;let N=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(N)?N:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=d;P.setDate(P.getDate()+1))B.push(ek(P));let A=x,j=x;return{empty:!1,data:B.map((P,N)=>{let q=B.length===1?0:x*(1-N/(B.length-1));return P<=b&&(A-=_.get(P)??0,j=Math.max(0,A)),{\uB0A0\uC9DC:tk(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,A):null}}),total:x,usePoints:g,last:j}},[e,h,b]);if(!s)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:l})]});if(s.empty)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]});let{data:r,total:t,usePoints:n,last:c}=s,i=n?"SP":"\uAC74";return Xo(eo,{sx:fr(l),children:[Xo(eo,{sx:Dr,children:[o?en(eo,{sx:{flexShrink:0},children:o}):null,Xo(eo,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Xo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Xo("span",{children:["\uD604\uC7AC"," ",en(eo,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),i," \uB0A8\uC74C"]})]})]}),en(eo,{sx:Qn(l),children:en(X6,{width:"100%",height:"100%",children:Xo(Y6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[en(G6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),en(J6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),en(Q6,{tick:{fontSize:13},width:40,allowDecimals:!1}),en(Z6,{...Ks,formatter:a=>`${Number(a??0)}${i}`}),en(pm,{type:"linear",dataKey:"\uC774\uC0C1",stroke:wi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),en(pm,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Dl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as km}from"react";import{Box as to}from"@mui/material";import{Area as Qu,AreaChart as ik,CartesianGrid as sk,Legend as ak,ResponsiveContainer as lk,Tooltip as ck,XAxis as uk,YAxis as dk}from"recharts";function Io(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function Nl(e,h=new Date){let b=new Date(h);return b.setMonth(b.getMonth()-e),b}function z$(e=new Date){return{fromDate:Io(Nl(1,e)),toDate:Io(e)}}var Ju=864e5,Ys=[0,1,2,3,5,8,13,21];function xm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Zu(e){let h=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(h);if(!b)return null;let l=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(l)?null:l}function rs(e){let h=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(h)?h.slice(0,10):""}function rk(e){let h=rs(e.created_time)||rs(e.start_date)||rs(e.completed_time);if(!h)return null;let b=rs(e.start_date),l=b&&b>h?b:h,o=e.completed?rs(e.completed_time)||h:"";return{created:h,started:l,done:o}}function vm(e,h){let b=/^\d{4}-\d{2}-\d{2}$/.test(h)?new Date(`${h}T00:00:00`):new Date,l=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let s=l-1;s>=0;s-=1)o.push(Io(new Date(b.getTime()-s*Ju)));return o}function wm(e,h,b){let l=vm(h,b),o=e.filter(xm).map(rk).filter(n=>n!==null),s=l.map(n=>{let c=0,i=0,a=0;for(let d of o)d.created>n||(d.done&&d.done<=n?c+=1:d.started<=n?i+=1:a+=1);return{day:n,done:c,inProgress:i,waiting:a}}),r=s[s.length-1],t=s.reduce((n,c)=>Math.max(n,c.done+c.inProgress+c.waiting),0);return{points:s,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function nk(e,h){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*h)-1));return e[b]}function bm(e){if(e.length===0)return null;let h=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,l=Math.floor(h.length/2),o=h.length%2===1?h[l]:(h[l-1]+h[l])/2;return{count:h.length,median:b(o),average:b(h.reduce((s,r)=>s+r,0)/h.length),p85:b(nk(h,.85))}}function ym(e){for(let h=Ys.length-1;h>=0;h-=1)if(e>=Ys[h])return h;return 0}function ok(){return Ys.map((e,h)=>h===Ys.length-1?`${e}\uC77C+`:`${e}~${Ys[h+1]}\uC77C`)}function _m(e,h,b){let l=vm(h,b),o=l[0],s=l[l.length-1],r=ok(),t=r.map(()=>0),n=r.map(()=>0),c=[],i=[];for(let a of e){if(!xm(a)||!a.completed)continue;let d=rs(a.completed_time);if(!d||d<o||d>s)continue;let f=Zu(a.completed_time),u=Zu(a.created_time);if(f===null||u===null)continue;let g=Math.max(0,(f-u)/Ju);c.push(g),t[ym(g)]+=1;let m=Zu(a.start_date);if(m===null||m>f)continue;let x=Math.max(0,(f-Math.max(m,u))/Ju);i.push(x),n[ym(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:bm(c),cycle:bm(i)}}import{jsx as Vr,jsxs as Zo}from"react/jsx-runtime";function fk(e){return e.slice(5).replace("-",".")}function Sm({tasks:e,todayStr:h,days:b=30,height:l=220,headerLeft:o}){let s=km(()=>wm(e,b,h),[e,b,h]),r=km(()=>s.points.map(n=>({\uB0A0\uC9DC:fk(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Zo(to,{sx:Dr,children:[o?Vr(to,{sx:{flexShrink:0},children:o}):null,Zo(to,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Zo(to,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Zo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Zo("span",{children:["\uC9C4\uD589 \uC911"," ",Vr(to,{component:"span",sx:{color:Jn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Vr(to,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||s.max===0?Zo(to,{sx:fr(l),children:[o?Vr(to,{sx:Dr,children:o}):null,Vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Zo(to,{sx:fr(l),children:[t,Vr(to,{sx:Qn(l),children:Vr(lk,{width:"100%",height:"100%",children:Zo(ik,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Vr(sk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Vr(uk,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Vr(dk,{tick:{fontSize:13},width:40,allowDecimals:!1}),Vr(ck,{...Ks,formatter:n=>`${Number(n??0)}\uAC74`}),Vr(ak,{...ts}),Vr(Qu,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Yu,fill:Yu,fillOpacity:.9}),Vr(Qu,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Jn,fill:Jn,fillOpacity:.85}),Vr(Qu,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Xu,fill:Xu,fillOpacity:.9})]})})})]})}import{useMemo as Tm}from"react";import{Box as tn}from"@mui/material";import{Bar as Cm,BarChart as hk,CartesianGrid as pk,Legend as mk,ResponsiveContainer as gk,Tooltip as bk,XAxis as yk,YAxis as xk}from"recharts";import{jsx as vr,jsxs as xn}from"react/jsx-runtime";function Bm({label:e,color:h,summary:b}){let l=xn(tn,{sx:{display:"flex",alignItems:"center",gap:.75},children:[vr(tn,{sx:{width:10,height:10,borderRadius:.5,bgcolor:h,flexShrink:0}}),vr(tn,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?xn(tn,{sx:{display:"contents"},children:[l,xn("span",{children:[b.count,"\uAC74"]}),xn("span",{children:["\uC911\uC559\uAC12"," ",vr(tn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),xn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),xn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):xn(tn,{sx:{display:"contents"},children:[l,vr(tn,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Im({tasks:e,todayStr:h,days:b=30,height:l=200,headerLeft:o}){let s=Tm(()=>_m(e,b,h),[e,b,h]),r=Tm(()=>s.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:s.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:s.cycleCounts[n]})),[s]);return s.lead?xn(tn,{sx:fr(l),children:[xn(tn,{sx:Dr,children:[o?vr(tn,{sx:{flexShrink:0},children:o}):null,xn(tn,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:3,rowGap:.5,fontSize:14,color:"#000"},children:[vr(Bm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Jn,summary:s.lead}),vr(Bm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Vs,summary:s.cycle})]})]}),vr(tn,{sx:Qn(l),children:vr(gk,{width:"100%",height:"100%",children:xn(hk,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[vr(pk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),vr(yk,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),vr(xk,{tick:{fontSize:13},width:40,allowDecimals:!1}),vr(bk,{...es,formatter:t=>`${Number(t??0)}\uAC74`}),vr(mk,{...ts}),vr(Cm,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Jn,radius:[3,3,0,0]}),vr(Cm,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Vs,radius:[3,3,0,0]})]})})})]}):xn(tn,{sx:fr(l),children:[o?vr(tn,{sx:Dr,children:o}):null,vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as Om}from"react";import{Box as _i}from"@mui/material";import{Bar as td,BarChart as Sk,CartesianGrid as Tk,Cell as Ck,Legend as Bk,ReferenceLine as Am,ResponsiveContainer as Ik,Tooltip as Ek,XAxis as Mk,YAxis as Rk}from"recharts";function vk(e,h){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return null;let b=new Date(`${e}T00:00:00`).getTime(),l=new Date(`${h}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(l)?null:Math.round((l-b)/864e5)}function wk(e,h,b){let l=String(e.due_date??"").slice(0,10),o=vk(h,l);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function Ll(e,h){let{todayStr:b,soonDays:l=7,includeUnassigned:o=!0,limit:s,capacity:r}=h,t=r??io,n=new Map;for(let i of e){if(i.completed||i.archived||i.is_notice||i.is_event||i.linked_only)continue;let a=Number(i.manager_account_seq??0);if(!a&&!o)continue;let d=a?String(i.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",f=n.get(a)??{accountSeq:a,name:d,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};f[wk(i,b,l)]+=1,f.total+=1,f.points+=Number(i.story_points??0)||0,n.set(a,f)}for(let i of n.values())i.capacity=_k(i.accountSeq,t),i.load=t.basis==="points"?i.points:i.total,i.ratio=i.capacity>0?i.load/i.capacity:0;let c=[...n.values()].sort((i,a)=>i.accountSeq===0!=(a.accountSeq===0)?i.accountSeq===0?1:-1:i.overdue!==a.overdue?a.overdue-i.overdue:i.total!==a.total?a.total-i.total:i.name.localeCompare(a.name));return typeof s=="number"&&s>0?c.slice(0,s):c}function jl(e,h){return e.filter(b=>b.completed||b.archived||b.is_notice||b.is_event||b.linked_only?!1:Number(b.manager_account_seq??0)===h).sort((b,l)=>{let o=String(b.due_date??"").slice(0,10),s=String(l.due_date??"").slice(0,10);return!o!=!s?o?-1:1:o!==s?o.localeCompare(s):String(b.title??"").localeCompare(String(l.title??""))})}function _k(e,h){if(!(e>0))return 0;let b=Math.max(0,Math.floor(Number(h.by_account?.[e])||0));return b>0?b:Math.max(0,Math.floor(Number(h.default_capacity)||0))}function zl(e){return e.capacity>0&&e.load>e.capacity}function Em(e,h){return h>0&&e.total>=h}function Mm(e){let h=e.filter(b=>b.accountSeq>0);return h.length===0?0:h.reduce((b,l)=>b+l.total,0)/h.length}function ed(e,h){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+h);let l=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${l(b.getMonth()+1)}-${l(b.getDate())}`}function kk(e){let h=new Date(`${e}T00:00:00`);if(Number.isNaN(h.getTime()))return e;let b=(h.getDay()+6)%7;return ed(e,-b)}function Rm(e,h){let{todayStr:b,includeUnassigned:l=!0,weeks:o=6,limit:s}=h,r=kk(b),t=Array.from({length:Math.max(1,o)},(f,u)=>{let g=ed(r,u*7),m=ed(g,6),[,x,_]=g.split("-");return{start:g,end:m,label:`${Number(x)}/${Number(_)}`,isCurrent:u===0}}),n=t[t.length-1].end,c=new Map;for(let f of e){if(f.completed||f.archived||f.is_notice||f.is_event||f.linked_only)continue;let u=Number(f.manager_account_seq??0);if(!u&&!l)continue;let g=u?String(f.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=c.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},x=String(f.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(x))m.noDue+=1;else if(x<b)m.overdue+=1;else if(x>n)m.beyond+=1;else{let _=t.findIndex(B=>x>=B.start&&x<=B.end);_>=0?m.byWeek[_]+=1:m.beyond+=1}c.set(u,m)}let i=[...c.values()].sort((f,u)=>f.accountSeq===0!=(u.accountSeq===0)?f.accountSeq===0?1:-1:f.overdue!==u.overdue?u.overdue-f.overdue:f.total!==u.total?u.total-f.total:f.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?i.slice(0,s):i,d=a.reduce((f,u)=>Math.max(f,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:d}}import{Fragment as Dm,jsx as wr,jsxs as Jo}from"react/jsx-runtime";var Xs="#e5484d";function Pm({tasks:e,todayStr:h,soonDays:b=7,overloadThreshold:l=0,capacity:o=io,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=Om(()=>Ll(e,{todayStr:h,soonDays:b,capacity:o}),[e,h,b,o]),i=Om(()=>Mm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(i*1.5)),d=o.default_capacity>0||Object.keys(o.by_account).length>0,f=o.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(d?zl(g):Em(g,a))).length;return c.length===0?Jo(_i,{sx:fr(s),children:[r?wr(_i,{sx:Dr,children:r}):null,wr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Jo(_i,{sx:fr(s),children:[Jo(_i,{sx:Dr,children:[r,Jo(_i,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",wr("b",{children:i.toFixed(1)}),"\uAC74 \xB7"," ",d?Jo(Dm,{children:["\uC6A9\uB7C9 ",wr("b",{children:o.default_capacity||"\uAC1C\uC778\uBCC4"}),o.default_capacity?f:""]}):Jo(Dm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",wr("b",{children:a}),"\uAC74"]}),u>0?Jo(_i,{component:"span",sx:{ml:1,color:Xs,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),wr(_i,{sx:Qn(s),children:wr(Ik,{width:"100%",height:"100%",children:Jo(Sk,{data:c,layout:"vertical",onClick:n?g=>{let m=c.find(x=>x.name===String(g?.activeLabel??""));m&&n(m.accountSeq===t?0:m.accountSeq)}:void 0,style:n?{cursor:"pointer"}:void 0,margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:c.length>8?4:10,children:[wr(Tk,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),wr(Mk,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),wr(Rk,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),wr(Ek,{...es,formatter:(g,m)=>[`${Number(g)||0}\uAC74`,String(m)],labelFormatter:g=>{let m=c.find(x=>x.name===g);return!m||!(m.capacity>0)?String(g):`${g} \u2014 \uC6A9\uB7C9 ${m.capacity}${f} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),wr(Bk,{...ts}),i>0?wr(Am,{x:i,stroke:wi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:wi}}):null,o.default_capacity>0?wr(Am,{x:o.default_capacity,stroke:Xs,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Xs}}):null,wr(td,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Xs}),wr(td,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Vs}),wr(td,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Jn,radius:[0,3,3,0],children:c.map(g=>wr(Ck,{fill:d&&zl(g)?Xs:Jn,fillOpacity:d&&zl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as zk,useState as Fk}from"react";import{Box as qk,Button as $k}from"@mui/material";import{FormDialog as Hk}from"@ehfuse/mui-form-dialog";import{useState as Ok}from"react";import{Box as hr,Button as Ak,Menu as Dk,MenuItem as Pk}from"@mui/material";import Nk from"@mui/icons-material/PersonOutlineOutlined";import Lk from"@ehfuse/overlay-scrollbar";import{jsx as Cr,jsxs as Eo}from"react/jsx-runtime";var Nm=56,Lm=68,jm=96;function jk(e){let h=String(e.due_date??"").slice(0,10);return h?h.slice(5).replace("-","/"):"-"}function zm(e,h){let b=String(e.due_date??"").slice(0,10);return!!b&&b<h}function Fm({tasks:e,row:h,todayStr:b,employees:l,rows:o,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,i]=Ok(null),a=jl(e,h.accountSeq),d=f=>o.find(u=>u.accountSeq===f)?.total??0;return Eo(hr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Cr(hr,{component:"span",sx:{fontWeight:700},children:h.name}),Eo(hr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),h.capacity>0?Eo(hr,{component:"span",sx:{color:h.load>h.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",h.capacity," \uC911 ",h.load]}):null]}),Eo(hr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,flexShrink:0,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0},children:"\uB9C8\uAC10"}),Cr(hr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Cr(hr,{sx:{width:Lm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Cr(hr,{sx:{width:jm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Cr(hr,{sx:{flex:1,minHeight:0},children:Cr(Lk,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Cr(hr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(f=>Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0,fontSize:13.5,color:zm(f,b)?"#e5484d":"#787774",fontWeight:zm(f,b)?700:400},children:jk(f)}),Cr(hr,{onClick:n?()=>n(f.seq):void 0,sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{cursor:"pointer","&:hover":{textDecoration:"underline"}}:{}},children:f.title}),Cr(hr,{sx:{width:Lm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Lr,{priority:f.priority})}),t?Cr(hr,{sx:{width:jm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Ak,{size:"small",variant:"outlined",startIcon:Cr(Nk,{sx:{fontSize:17}}),onClick:u=>i({el:u.currentTarget,taskSeq:f.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},f.seq))})})]}),Cr(Dk,{anchorEl:c?.el??null,open:!!c,onClose:()=>i(null),transitionDuration:0,children:l.filter(f=>Number(f.account_seq)>0&&Number(f.account_seq)!==h.accountSeq).map(f=>Eo(Pk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(f.account_seq),f.name),i(null)},sx:{fontSize:14,minWidth:200},children:[Cr(hr,{sx:{flex:1},children:f.name}),Eo(hr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[d(Number(f.account_seq)),"\uAC74"]})]},f.account_seq))})]})}import{jsx as Fl}from"react/jsx-runtime";function qm({open:e,row:h,rows:b,tasks:l,todayStr:o,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,i]=Fk(h);zk(()=>{h&&i(h)},[h]);let a=h??c,d=a?jl(l,a.accountSeq).length:0;return Fl(Hk,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${d})`:"\uC5C5\uBB34",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-person",tabs:{visible:!1},actions:{showCancelButton:!1,right:Fl($k,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Fl(qk,{sx:{minHeight:0},children:a?Fl(Fm,{tasks:l,row:a,rows:b,todayStr:o,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as Wk}from"react";import{Box as ln,Tooltip as Uk}from"@mui/material";import{OverlayScrollbar as Vk}from"@ehfuse/overlay-scrollbar";import{jsx as Kr,jsxs as $l}from"react/jsx-runtime";var $m="#e5484d",Kk="#2f80ed",Gk="#9a9a97",rd=30,Yk=96,ql=56;function nd({count:e,max:h,color:b,title:l}){let o=e>0&&h>0?.18+e/h*.72:0;return Kr(Uk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Kr(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function Hm({tasks:e,todayStr:h,weeks:b=6,height:l=200}){let o=Wk(()=>Rm(e,{todayStr:h,weeks:b}),[e,h,b]);if(o.rows.length===0)return Kr(ln,{sx:fr(l),children:Kr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${Yk}px ${ql}px repeat(${o.weeks.length}, minmax(${ql}px, 1fr)) ${ql}px ${ql}px`,r={height:rd,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Kr(ln,{sx:fr(l),children:Kr(Vk,{style:{height:"100%"},thumb:{width:8},children:$l(ln,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${rd}px repeat(${o.rows.length}, minmax(${rd}px, 1fr))`},children:[Kr(ln,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Kr(ln,{sx:{...r,color:$m},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Kr(ln,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Kr(ln,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Kr(ln,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>$l(ln,{sx:{display:"contents"},children:[Kr(ln,{sx:{display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Kr(nd,{count:t.overdue,max:o.maxCell,color:$m,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Kr(nd,{count:n,max:o.maxCell,color:Kk,title:`${t.name} \xB7 ${o.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[c].start)),Kr(nd,{count:t.noDue,max:o.maxCell,color:Gk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),$l(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?$l(ln,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Vm,jsx as Zt,jsxs as Hl}from"react/jsx-runtime";var Km="min(560px, 62vh)",Qk=`calc(${Km} - 4px)`,e8=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function nW({open:e,sprints:h,tasks:b,todayStr:l,showSprintCharts:o,capacity:s=io,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:i=0,onClose:a}){let[d,f]=Zs(0),[u,g]=Zs(30);Xk(()=>{if(!e)return;let y=h.find(w=>w.status==="active")??h[0],v=h.find(w=>w.seq===i)??y;f(v?.seq??0)},[e]);let m=Wm(()=>h.find(y=>y.seq===d)??null,[h,d]),x={height:Qk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Zt(od,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:d?String(d):"",options:h.map(y=>({value:String(y.seq),label:mn(y)})),onChange:y=>f(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,A]=Zs("distribution"),j=Zt(od,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:B,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:y=>A(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Zs(!1),[N,q]=Zs(0),z=Wm(()=>Ll(b,{todayStr:l,capacity:s}),[b,l,s]),T=z.find(y=>y.accountSeq===N)??null,C=Hl(Vm,{children:[j,t?Zt(Um,{size:"small",variant:"outlined",startIcon:Zt(Jk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),R=o??h.length>0,p=Zt(od,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:e8,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Hl(Vm,{children:[Zt(Zk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Km,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...R?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Zt(Mo,{sx:x,children:Zt(hm,{sprints:h,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Zt(Mo,{sx:x,children:m?Zt(gm,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Hl(Mo,{sx:fr("100%"),children:[Zt(Mo,{sx:Dr,children:_}),Zt(Ur,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:Zt(Mo,{sx:x,children:Zt(Sm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:Zt(Mo,{sx:x,children:B==="timeline"?Hl(Mo,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Zt(Mo,{sx:Dr,children:C}),Zt(Hm,{tasks:b,todayStr:l,height:"100%"})]}):Zt(Pm,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:N,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Zt(Mo,{sx:x,children:Zt(Im,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}],actions:{showCancelButton:!1,right:Zt(Um,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Zt(qm,{open:N>0,row:T,rows:z,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Zt(dm,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as t8,Divider as r8,Menu as n8,MenuItem as id}from"@mui/material";import{jsx as Js,jsxs as Gm}from"react/jsx-runtime";function lW({anchorEl:e,candidates:h,selectedNames:b,avatarSrcByName:l,onToggle:o,onClear:s,onClose:r}){return Gm(n8,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[h.length===0?Js(id,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):h.map(t=>{let n=b.includes(t.name);return Gm(id,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Js(t8,{size:"small",checked:n,sx:{p:0}}),Js(jr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Js(r8,{}),Js(id,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as o8}from"react";import{ButtonBase as i8,Menu as s8,MenuItem as a8}from"@mui/material";import l8 from"@mui/icons-material/KeyboardArrowDown";import c8 from"@mui/icons-material/Check";import{Fragment as u8,jsx as sd,jsxs as ad}from"react/jsx-runtime";function gW({value:e,onChange:h,options:b}){let[l,o]=o8(null),s=b??vc,r=vc.find(t=>t.value===e)?.label??"";return ad(u8,{children:[ad(i8,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,sd(l8,{sx:{fontSize:17,color:"#9a9a97"}})]}),sd(s8,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>o(null),children:s.map(t=>ad(a8,{selected:t.value===e,onClick:()=>{h(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?sd(c8,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Wl,ButtonBase as d8}from"@mui/material";import{DateTextField as Ym}from"@ehfuse/mui-form-controls";import{jsx as Qs,jsxs as Xm}from"react/jsx-runtime";var f8=[{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 Zm({fromDate:e,toDate:h,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Io(Nl(s)),Io(new Date))},o=s=>s<=0?!e&&!h:!e||!h?!1:e===Io(Nl(s))&&h===Io(new Date);return Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Qs(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5},children:f8.map(s=>{let r=o(s.months);return Qs(d8,{onClick:()=>l(s.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:s.label},s.label)})}),Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Qs(Ym,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,h),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Qs(Wl,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Qs(Ym,{value:h,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:s=>b(e,s.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as h8}from"@mui/material";import{jsx as Jm}from"react/jsx-runtime";function CW({anchorEl:e,fromDate:h,toDate:b,onChange:l,onClose:o}){return Jm(h8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Jm(Zm,{fromDate:h,toDate:b,onChange:l})})}import{Box as p8,ButtonBase as m8,Tab as g8,Tabs as b8}from"@mui/material";import y8 from"@mui/icons-material/Checklist";import x8 from"@mui/icons-material/Face";import v8 from"@mui/icons-material/Publish";import w8 from"@mui/icons-material/NotificationsOutlined";import _8 from"@mui/icons-material/BugReportOutlined";import k8 from"@mui/icons-material/DescriptionOutlined";import S8 from"@mui/icons-material/Inventory2Outlined";import{jsx as Dn}from"react/jsx-runtime";function Qm(e,h){return h>0?`${e} (${h})`:e}var zW=[{id:"my",label:"\uC804\uCCB4",icon:Dn(y8,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Dn(x8,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Dn(v8,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Dn(_8,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Dn(w8,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Dn(S8,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Dn(k8,{sx:{fontSize:18}}),hideCount:!0}];function T8(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 FW({items:e,activeTab:h,counts:b,onChange:l,compact:o=!1}){let s=ct(),r=T8(s.tabs),t=e;return o?Dn(p8,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=h===n.id;return Dn(m8,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:kr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:c?s.tabs.selectedBg:s.tabs.bg,color:c?s.tabs.selectedColor:s.tabs.color,borderColor:c?s.tabs.selectedBg:s.tabs.borderColor},children:Qm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):Dn(b8,{value:h,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>Dn(g8,{value:n.id,label:Qm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as C8,useMemo as B8,useState as ld}from"react";import{Divider as Ul,ListItemIcon as Gr,Menu as cd,MenuItem as _r}from"@mui/material";import I8 from"@mui/icons-material/OpenInNewOutlined";import E8 from"@mui/icons-material/RestoreFromTrashOutlined";import M8 from"@mui/icons-material/Check";import R8 from"@mui/icons-material/CheckCircleOutlined";import O8 from"@mui/icons-material/RadioButtonUnchecked";import A8 from"@mui/icons-material/SendOutlined";import D8 from"@mui/icons-material/EventOutlined";import P8 from"@mui/icons-material/PersonOutlineOutlined";import N8 from"@mui/icons-material/ViewKanbanOutlined";import L8 from"@mui/icons-material/ContentCopyOutlined";import j8 from"@mui/icons-material/NextPlanOutlined";import z8 from"@mui/icons-material/ContentPasteOutlined";import F8 from"@mui/icons-material/ShareOutlined";import q8 from"@mui/icons-material/DirectionsRunOutlined";import e0 from"@mui/icons-material/ChevronRight";import $8 from"@mui/icons-material/ArchiveOutlined";import H8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as t0}from"@ehfuse/alerts";import{Fragment as r0,jsx as ut,jsxs as pr}from"react/jsx-runtime";function yU({target:e,onClose:h,customTabs:b,sprints:l=[],myAccountSeq:o=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:c,onMemberEdit:i,onMoveProject:a,onDuplicate:d,onCreateFollowUp:f,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let A=Lt(),j=Nn(),[D,P]=ld(null),[N,q]=ld(null),[z,T]=ld(null);C8(()=>{e||(P(null),q(null),T(null))},[e]);let C=e?.task??null,R=!!C?.is_notice,p=!!C?.is_event,y=C?!lo(C,o):!1,v=!!C?.deleted,w=B8(()=>new Set(b.filter(L=>L.useSprints).map(L=>L.key)),[b]),k=async(L="one")=>{let $=C;if(h(),!$)return;await t0({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:L==="series"?`"${$.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${$.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&x($.seq,L)},S=async()=>{let L=C;if(h(),!L)return;await t0({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${L.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(L.seq)},E=()=>{C&&m(C.seq,!C.archived),h()};return pr(r0,{children:[pr(cd,{open:!!e,onClose:h,transitionDuration:0,anchorReference:A?"none":"anchorPosition",anchorPosition:!A&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...A?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:A?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[pr(_r,{onClick:()=>{C&&s(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(I8,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut(Ul,{}):null,v&&_?pr(_r,{onClick:()=>{C&&_(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(E8,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?pr(_r,{onClick:()=>{S()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:pr(r0,{children:[pr(_r,{disabled:R?(C?.author_account_seq??0)!==o:(C?.author_account_seq??0)!==o&&(C?.manager_account_seq??0)!==o,onClick:()=>{C&&r(C.seq,!C.completed),h()},sx:{fontSize:14},children:[ut(Gr,{children:C?.completed?ut(O8,{sx:{fontSize:19}}):ut(R8,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!R&&t?pr(_r,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(A8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,p?null:ut(Ul,{}),p?null:pr(_r,{disabled:y,onClick:L=>{C&&P({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(D8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!R&&!p&&i?pr(_r,{onClick:()=>{C&&i(C,"manager"),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(P8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,p?null:pr(_r,{disabled:y,onClick:L=>{C&&q({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(N8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut(Ul,{}),d?pr(_r,{disabled:y,onClick:()=>{C&&d(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(L8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,f&&C&&!C.is_event&&!C.is_notice?pr(_r,{onClick:()=>{C&&f(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(j8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,pr(_r,{onClick:()=>{C&&(u?u(C):Ki(C,A)),h()},sx:{fontSize:14},children:[ut(Gr,{children:A?ut(F8,{sx:{fontSize:19}}):ut(z8,{sx:{fontSize:19}})}),A?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?pr(_r,{onClick:L=>T(L.currentTarget),sx:{fontSize:14},children:[ut(Gr,{children:ut(q8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,pr(_r,{onClick:E,disabled:y||!C?.archived&&!(C&&Ta(C)),sx:{fontSize:14},children:[ut(Gr,{children:C?.archived?ut(H8,{sx:{fontSize:19}}):ut($8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut(Ul,{}),pr(_r,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),(C?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(C?.repeat_group_key??0)>0?pr(_r,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(pn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminders:zn(D?.task),hideReminder:!!D?.task.completed,centered:A,onClose:()=>{P(null),h()},onDateChange:L=>{D&&n(D.task.seq,L)},onReminderChange:L=>{D&&c?.(D.task.seq,L)}}),pr(cd,{transitionDuration:0,anchorEl:N?.anchorEl??null,open:!!N,onClose:()=>{q(null),h()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(_r,{selected:!N?.task.tab_key,onClick:()=>{N&&a(N.task.seq,""),q(null),h()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(L=>!L.archived).map(L=>ut(_r,{selected:N?.task.tab_key===L.key,onClick:()=>{N&&a(N.task.seq,L.key),q(null),h()},sx:{fontSize:14,minWidth:170},children:L.label},L.key))]}),ut(cd,{transitionDuration:0,anchorEl:z,open:!!z,onClose:()=>T(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(L=>`custom-${L.group_seq}`===String(C?.tab_key??"")).map(L=>({seq:L.seq,label:mn(L)}))].map(L=>pr(_r,{onClick:()=>{C&&g?.(C.seq,L.seq),T(null),h()},sx:{fontSize:14,minWidth:160,gap:1},children:[L.label,(C?.sprint_seq??0)===L.seq?ut(M8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},L.seq))})]})}import{Checkbox as W8,Divider as U8,Menu as V8,MenuItem as n0}from"@mui/material";import{jsx as Vl,jsxs as o0}from"react/jsx-runtime";function kU({anchorEl:e,labelOptions:h,selectedKeys:b,onToggle:l,onClear:o,onClose:s}){return o0(V8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[h.map(r=>{let t=b.includes(r.key);return o0(n0,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Vl(W8,{size:"small",checked:t,sx:{p:0}}),Vl(At,{option:r})]},r.key)}),Vl(U8,{}),Vl(n0,{disabled:b.length===0,onClick:()=>{o(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as K8,Menu as G8,MenuItem as i0}from"@mui/material";import Y8 from"@mui/icons-material/Check";import X8 from"@mui/icons-material/SettingsOutlined";import{jsx as ud,jsxs as dd}from"react/jsx-runtime";function MU(e){let{anchorEl:h,sprints:b,value:l,onSelect:o,onManage:s,onClose:r}=e;return dd(G8,{transitionDuration:0,anchorEl:h,open:!!h,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:mn(t)}))].map(t=>dd(i0,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?ud(Y8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ud(K8,{}),dd(i0,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[ud(X8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var Z8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function J8(e){return Z8[e]??"tasks"}var a0={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"},s0=["list","calendar","month","card","kanban","sprint","timeline"],Q8=["list","card"];function AU(e){let h=J8(e);switch(h){case"notice":return{kind:h,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:h,viewOptions:s0,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:h,viewOptions:Q8,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:h,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:h,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:h,viewOptions:s0,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as eS}from"react";import{useKeyboardState as tS}from"@ehfuse/keyboard-state";var l0=[{key:"g l",view:"list"},{key:"g b",view:"card"},{key:"g k",view:"kanban"},{key:"g s",view:"sprint"},{key:"g c",view:"calendar"},{key:"g m",view:"month"},{key:"g t",view:"timeline"}];function jU(e,h={}){let{enabled:b=!0,views:l}=h,{onCreateTask:o,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:c}=e,i=l?l.join(","):"",a=eS(()=>{let d=[];if(o&&d.push({key:"n",callback:o,options:{preventDefault:!0}}),s&&d.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&d.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&d.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),c&&d.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let f of c0(i?i.split(","):void 0))d.push({key:f.key,callback:()=>t(f.view),options:{preventDefault:!0}});return d},[o,s,r,t,n,c,i]);tS(b?a:[])}function c0(e){if(!e)return l0;let h=new Set(e);return l0.filter(b=>h.has(b.view))}function fd(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...c0(e).map(h=>({keys:h.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${a0[h.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var zU=fd();import{Box as ea,Button as rS}from"@mui/material";import nS from"@mui/icons-material/ArrowRightAlt";import{FormDialog as oS}from"@ehfuse/mui-form-dialog";import{jsx as Qo,jsxs as u0}from"react/jsx-runtime";function iS({keys:e}){return Qo(ea,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((h,b)=>u0(ea,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Qo(nS,{sx:{fontSize:18,color:"#9a9a97"}}):null,Qo(ea,{component:"span",sx:{minWidth:32,height:32,px:.75,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:13.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:h})]},`${h}-${b}`))})}function UU({open:e,onClose:h,views:b}){let l=fd(b);return Qo(oS,{open:e,onClose:h,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"shortcuts",showTitle:!1,children:Qo(ea,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(o=>u0(ea,{sx:{display:"contents"},children:[Qo(iS,{keys:o.keys}),Qo("span",{children:o.description})]},o.keys))})}],actions:{showCancelButton:!1,right:Qo(rS,{variant:"contained",onClick:h,children:"\uB2EB\uAE30"})}})}import{useEffect as d0,useRef as sS,useState as ns}from"react";import{Box as nr,Button as Pn,IconButton as hd,Menu as f0,MenuItem as h0,Switch as aS,Tooltip as p0}from"@mui/material";import{FormDialog as m0}from"@ehfuse/mui-form-dialog";import pd from"@mui/icons-material/Add";import lS from"@mui/icons-material/ArrowRightAlt";import cS from"@mui/icons-material/BoltOutlined";import uS from"@mui/icons-material/Close";import dS from"@mui/icons-material/EditOutlined";import{ErrorAlert as g0}from"@ehfuse/alerts";import{ClearTextField as ta,LabelSelect as cn}from"@ehfuse/mui-form-controls";import{Fragment as y0,jsx as Xe,jsxs as vn}from"react/jsx-runtime";var md=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"commented",label:"\uB313\uAE00\uC774 \uB2EC\uB838\uC744 \uB54C",hint:"\uB313\uAE00\uC774 \uC0C8\uB85C \uB2EC\uB9AC\uAC70\uB098 \uC218\uC815\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD68C\uC2E0\uC744 \uBC1B\uC740 \uC790\uB9AC)."},{value:"manager_assigned",label:"\uCC45\uC784\uC790\uAC00 \uC9C0\uC815\uB410\uC744 \uB54C",hint:"\uCC45\uC784\uC790\uAC00 \uC0C8\uB85C \uC9C0\uC815\uB418\uAC70\uB098 \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"attachment_added",label:"\uCCA8\uBD80\uAC00 \uC62C\uB77C\uC654\uC744 \uB54C",hint:"\uC5C5\uBB34\uC5D0 \uD30C\uC77C\uC774 \uCCA8\uBD80\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uC99D\uBE59 \uC811\uC218 \uC790\uB9AC)."},{value:"field_changed",label:"\uD544\uB4DC\uAC00 \uBC14\uB00C\uC5C8\uC744 \uB54C",hint:"\uC9C0\uC815\uD55C \uD544\uB4DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD544\uB4DC\uB97C \uC548 \uACE0\uB974\uBA74 \uC544\uBB34 \uC218\uC815\uC5D0\uB098 \uC2E4\uD589)."},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uB9E4\uC77C \uC810\uAC80\uD574 \uC2E4\uD589\uD569\uB2C8\uB2E4."}],ra=[{value:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC"},{value:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC"},{value:"priority",label:"\uC911\uC694\uB3C4"},{value:"manager_account_seq",label:"\uCC45\uC784\uC790"},{value:"receiver_account_seqs",label:"\uCC38\uC870\uC790"},{value:"label_keys",label:"\uB77C\uBCA8"},{value:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8"},{value:"sprint_seq",label:"\uBAA9\uD45C"},{value:"content",label:"\uB0B4\uC6A9"},{value:"note",label:"\uBE44\uACE0"}],Yl=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Kl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Gl(e){return nn.find(h=>h.key===e)?.name??e}function fS(e,h,b){let{condition:l,action:o}=e,s=[];if(l.group_seq){let n=h.find(c=>Go(c.key)===l.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${n?.label??`#${l.group_seq}`}`)}l.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),l.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),l.priority&&s.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===l.priority)?.label}`),l.label_key&&s.push(`\uB77C\uBCA8=${b.find(n=>n.key===l.label_key)?.name??l.label_key}`),l.title_contains&&s.push(`\uC81C\uBAA9\uC5D0 "${l.title_contains}" \uD3EC\uD568`),l.status&&s.push(`\uC0C1\uD0DC=${Gl(l.status)}`),l.from_status&&s.push(`${Gl(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Gl(l.to_status)}\uB85C`),l.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),l.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),l.manager_account_seq&&s.push(`\uCC45\uC784\uC790=${l.manager_name||`\uACC4\uC815 #${l.manager_account_seq}`}`),l.receiver_account_seq&&s.push(`\uCC38\uC870\uC790\uC5D0 ${l.receiver_name||`\uACC4\uC815 #${l.receiver_account_seq}`}`),l.changed_field&&s.push(`${ra.find(n=>n.value===l.changed_field)?.label??l.changed_field} \uBCC0\uACBD`),l.comment_contains&&s.push(`\uB313\uAE00\uC5D0 "${l.comment_contains}" \uD3EC\uD568`),l.comment_by_others===!0&&s.push("\uB0A8\uC774 \uC4F4 \uB313\uAE00"),typeof l.overdue_days=="number"&&s.push(`${l.overdue_days}\uC77C \uACBD\uACFC`);let r=[];o.set_status&&r.push(`\uC0C1\uD0DC=${Gl(o.set_status)}`),o.set_priority&&r.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===o.set_priority)?.label}`),o.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790=${o.assign_manager_name||"\uC9C0\uC815"}`),o.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${o.add_receiver_name||"\uC9C0\uC815"}`),o.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(n=>n.key===o.add_label_key)?.name??o.add_label_key}`),o.apply_content_template_seq&&r.push(`\uBCF8\uBB38 \uC591\uC2DD=${o.apply_content_template_name||"\uC9C0\uC815"}`),o.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=md.find(n=>n.value===e.trigger)?.label??e.trigger;return{left:s.length>0?`${t} \xB7 ${s.join(", ")}`:t,right:r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}}var b0={fontSize:16,fontWeight:700,color:"#37352f"},hS={display:"flex",alignItems:"center",gap:1},pS={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function aV({open:e,rules:h,customTabs:b,statusOptions:l,contentTemplates:o=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:i}){let[a,d]=ns(!1),[f,u]=ns(0),[g,m]=ns(Kl()),[x,_]=ns(!1),B=sS(null),[A,j]=ns(null),[D,P]=ns(null);d0(()=>{if(e)return;let H=window.setTimeout(()=>{d(!1),u(0),m(Kl())},500);return()=>window.clearTimeout(H)},[e]),d0(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let N=f>0,q=g.trigger,z=()=>{d(!1),u(0),m(Kl())},T=(H,Z)=>{m(J=>{let G={...J.condition};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,condition:G}})},C=(H,Z)=>{m(J=>{let G={...J.action};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,action:G}})},R=H=>{m(Z=>{let J={...Z.condition};return H!=="status_changed"&&(delete J.from_status,delete J.to_status),H!=="overdue"&&delete J.overdue_days,H!=="field_changed"&&delete J.changed_field,H!=="commented"&&(delete J.comment_contains,delete J.comment_by_others),H==="field_changed"&&J.changed_field===void 0&&(J.changed_field=ra[0]?.value??""),{...Z,trigger:H,condition:J}})},p=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=nn.map(H=>({value:H.key,label:H.name})),w=p.map(H=>({value:String(Go(H.key)),label:H.label})),{condition:k,action:S}=g,E=k.is_bug!==void 0||k.is_event!==void 0,L=[...k.group_seq===void 0&&w.length>0?[{key:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...E?[]:[{key:"kind",label:"\uC885\uB958\uAC00 \uC624\uB958/\uC77C\uC815\uC778 \uACBD\uC6B0"}],...k.priority===void 0?[{key:"priority",label:"\uC911\uC694\uB3C4\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...k.label_key===void 0&&y.length>0?[{key:"label_key",label:"\uB77C\uBCA8\uC774 \uBD99\uC5B4 \uC788\uB294 \uACBD\uC6B0"}]:[],...k.title_contains===void 0?[{key:"title_contains",label:"\uC81C\uBAA9\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...k.manager_empty===void 0?[{key:"manager_empty",label:"\uCC45\uC784\uC790\uAC00 \uC5C6\uB294/\uC788\uB294 \uACBD\uC6B0"}]:[],...s&&k.manager_account_seq===void 0?[{key:"manager_account",label:"\uCC45\uC784\uC790\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...s&&k.receiver_account_seq===void 0?[{key:"receiver_account",label:"\uCC38\uC870\uC790\uC5D0 ~\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.from_status===void 0?[{key:"from_status",label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.to_status===void 0?[{key:"to_status",label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="field_changed"&&k.changed_field===void 0?[{key:"changed_field",label:"~ \uD544\uB4DC\uAC00 \uBCC0\uACBD\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_contains===void 0?[{key:"comment_contains",label:"\uB313\uAE00\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_by_others===void 0?[{key:"comment_by_others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C\uC774 \uC4F4 \uACBD\uC6B0"}]:[],...q==="overdue"&&k.overdue_days===void 0?[{key:"overdue_days",label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB09C \uACBD\uC6B0"}]:[]],$=async H=>{if(!s)return;let Z=H==="manager_account"?k.manager_account_seq??0:k.receiver_account_seq??0,J=await s(Z,H==="manager_account"?"\uCC45\uC784\uC790":"\uCC38\uC870\uC790");J&&m(G=>{let X={...G.condition};return H==="manager_account"?(X.manager_account_seq=J.accountSeq,X.manager_name=J.name):(X.receiver_account_seq=J.accountSeq,X.receiver_name=J.name),{...G,condition:X}})},U=H=>{j(null),H==="group_seq"?T("group_seq",Number(w[0]?.value)||0):H==="kind"?T("is_bug",!0):H==="priority"?T("priority","high"):H==="label_key"?T("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?T("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?T("from_status",nn[0]?.key??""):H==="to_status"?T("to_status",nn[0]?.key??""):H==="changed_field"?T("changed_field",ra[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?T("comment_by_others",!0):H==="overdue_days"&&T("overdue_days",1)},O=H=>{if(H==="kind"){T("is_bug",""),T("is_event","");return}if(H==="manager_account"){T("manager_account_seq",""),T("manager_name","");return}if(H==="receiver_account"){T("receiver_account_seq",""),T("receiver_name","");return}T(H==="group_seq"?"group_seq":H,"")},W=[...S.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...S.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...S.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&S.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&S.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...o.length>0&&S.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&S.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],M=async H=>{if(!s)return;let Z=H==="assign_manager"?S.assign_manager_account_seq??0:H==="add_receiver"?S.add_receiver_account_seq??0:S.notify_account_seq??0,J=await s(Z,H==="assign_manager"?"\uCC45\uC784\uC790":H==="add_receiver"?"\uCC38\uC870\uC790":"\uC54C\uB9BC \uBC1B\uC744 \uC0AC\uB78C");J&&m(G=>{let X={...G.action};return H==="assign_manager"?(X.assign_manager_account_seq=J.accountSeq,X.assign_manager_name=J.name):H==="add_receiver"?(X.add_receiver_account_seq=J.accountSeq,X.add_receiver_name=J.name):(X.notify_account_seq=J.accountSeq,X.notify_name=J.name),{...G,action:X}})},I=H=>{if(P(null),H==="set_status")C("set_status",nn[0]?.key??"");else if(H==="set_priority")C("set_priority","high");else if(H==="add_label_key")C("add_label_key",y[0]?.value??"");else if(H==="apply_content_template"){let Z=o[0];m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}else M(H)},F=H=>{H==="assign_manager"?(C("assign_manager_account_seq",""),C("assign_manager_name","")):H==="add_receiver"?(C("add_receiver_account_seq",""),C("add_receiver_name","")):H==="apply_content_template"?(C("apply_content_template_seq",""),C("apply_content_template_name","")):H==="notify"?(C("notify_account_seq",""),C("notify_name",""),C("notify_message","")):C(H,"")},V=async()=>{if(!g.name.trim()){g0({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){g0({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=N?g.sort_no:h.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=N?await n(f,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&z()},Y=(H,Z,J,G)=>vn(nr,{sx:hS,children:[Xe(nr,{sx:pS,children:H}),vn(nr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Xe(nr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Xe(p0,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Xe(hd,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Xe(uS,{sx:{fontSize:16}})})})]}),K=()=>vn(nr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Xe(ta,{size:"medium",label:"\uADDC\uCE59 \uC774\uB984",inputRef:B,placeholder:"\uC608: \uC811\uC218 \uC624\uB958 \uC790\uB3D9 \uBC30\uC815",value:g.name,onChange:H=>m(Z=>({...Z,name:H.target.value}))}),Xe(nr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:md.map(H=>{let Z=q===H.value;return Xe(Pn,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>R(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Xe(nr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:md.find(H=>H.value===q)?.hint}),vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Xe(nr,{sx:b0,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),L.length>0?Xe(Pn,{size:"small",startIcon:Xe(pd,{sx:{fontSize:16}}),onClick:H=>j(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uC870\uAC74 \uCD94\uAC00"}):null]}),k.group_seq!==void 0?Y("\uD504\uB85C\uC81D\uD2B8",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>T("group_seq",Number(H.target.value)||"")}),()=>O("group_seq")):null,E?Y("\uC885\uB958",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.is_bug?"bug":"event",options:[{value:"bug",label:"\uC624\uB958\uB9CC"},{value:"event",label:"\uC77C\uC815\uB9CC"}],onChange:H=>{let Z=H.target.value==="bug";T("is_bug",Z?!0:""),T("is_event",Z?"":!0)}}),()=>O("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:Yl,onChange:H=>T("priority",H.target.value)}),()=>O("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>T("label_key",H.target.value)}),()=>O("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Xe(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uAE34\uAE09)",value:k.title_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,title_contains:H.target.value}}))}),()=>O("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>T("manager_empty",H.target.value==="empty")}),()=>O("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>O("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>O("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>T("from_status",H.target.value)}),()=>O("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>T("to_status",H.target.value)}),()=>O("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:ra,onChange:H=>T("changed_field",H.target.value)}),()=>O("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Xe(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uD68C\uC2E0)",value:k.comment_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,comment_contains:H.target.value}}))}),()=>O("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.comment_by_others?"others":"any",options:[{value:"others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C"},{value:"any",label:"\uB204\uAD6C\uB4E0"}],onChange:H=>T("comment_by_others",H.target.value==="others")}),()=>O("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Xe(ta,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>T("overdue_days",Math.max(0,Number(H.target.value)||0)),helperText:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130 \uC2E4\uD589\uD560\uC9C0"}),()=>O("overdue_days")):null,Object.keys(k).length===0?Xe(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Xe(nr,{sx:b0,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Xe(Pn,{size:"small",startIcon:Xe(pd,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),S.set_status!==void 0?Y("\uC0C1\uD0DC",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>F("set_status")):null,S.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_priority,options:Yl,onChange:H=>C("set_priority",H.target.value)}),()=>F("set_priority")):null,S.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:String(S.apply_content_template_seq),options:o.map(H=>({value:String(H.seq),label:H.name})),onChange:H=>{let Z=o.find(J=>String(J.seq)===String(H.target.value));m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}}),()=>F("apply_content_template"),"\uBCF8\uBB38\uC774 \uBE44\uC5B4 \uC788\uC744 \uB54C\uB9CC \uCC44\uC6C1\uB2C8\uB2E4(\uC4F4 \uB0B4\uC6A9\uC744 \uB36E\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)"):null,S.add_label_key!==void 0?Y("\uB77C\uBCA8",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:S.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>F("add_label_key")):null,S.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("assign_manager")},children:S.assign_manager_name||`\uACC4\uC815 #${S.assign_manager_account_seq}`}),()=>F("assign_manager")):null,S.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("add_receiver")},children:S.add_receiver_name||`\uACC4\uC815 #${S.add_receiver_account_seq}`}),()=>F("add_receiver")):null,S.notify_account_seq!==void 0?Y("\uC54C\uB9BC",vn(y0,{children:[Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("notify")},sx:{flexShrink:0},children:S.notify_name||`\uACC4\uC815 #${S.notify_account_seq}`}),Xe(ta,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:S.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>F("notify")):null,Object.keys(S).length===0?Xe(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:'"+ \uB3D9\uC791 \uCD94\uAC00" \uB85C \uD560 \uC77C\uC744 \uD558\uB098 \uC774\uC0C1 \uACE8\uB77C \uC8FC\uC138\uC694.'}):null,Xe(f0,{transitionDuration:0,anchorEl:A,open:!!A,onClose:()=>j(null),children:L.map(H=>Xe(h0,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Xe(f0,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Xe(h0,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return vn(y0,{children:[Xe(m0,{open:e,onClose:r,maxWidth:"sm",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-manage",tabs:{visible:!1},contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionContentPaddingTop:0,sections:[{id:"rules",title:"",showTitle:!1,children:vn(nr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[h.length===0?vn(nr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Xe(cS,{sx:{fontSize:48,color:"#d9d9d6"}}),Xe(nr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,h.map(H=>vn(nr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Xe(p0,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Xe(aS,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),vn(nr,{sx:{flex:1,minWidth:0},children:[Xe(nr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=fS(H,b,l);return vn(nr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Xe(nr,{component:"span",children:Z.left}),Xe(lS,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Xe(nr,{component:"span",children:Z.right})]})})()]}),Xe(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC218\uC815`,onClick:()=>{u(H.seq),m({name:H.name,trigger:H.trigger,enabled:H.enabled,sort_no:H.sort_no,condition:{...H.condition,...H.trigger==="field_changed"&&H.condition.changed_field===void 0?{changed_field:ra[0]?.value??""}:{}},action:{...H.action}}),d(!0)},children:Xe(dS,{sx:{fontSize:18}})}),Xe(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>i(H.seq),children:Xe(cr,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Xe(Pn,{startIcon:Xe(pd,{}),onClick:()=>{u(0),m(Kl()),d(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Xe(Pn,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Xe(m0,{open:a,onClose:z,maxWidth:"sm",title:N?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-form",tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"rule-form",title:"",showTitle:!1,children:K()}],actions:{showCancelButton:!0,right:Xe(Pn,{variant:"contained",onClick:()=>{V()},disabled:x,children:N?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as x0,useRef as gd,useState as os}from"react";import{Box as Jt,Button as is,IconButton as na,Tooltip as oa}from"@mui/material";import v0 from"@mui/icons-material/Add";import mS from"@mui/icons-material/EditOutlined";import gS from"@mui/icons-material/ContentCopyOutlined";import bS from"@mui/icons-material/DragIndicator";import yS from"@mui/icons-material/Close";import xS from"@mui/icons-material/PlaylistAddCheckOutlined";import{DndContext as vS,PointerSensor as wS,closestCenter as _S,useSensor as kS,useSensors as SS}from"@dnd-kit/core";import{restrictToParentElement as TS,restrictToVerticalAxis as CS}from"@dnd-kit/modifiers";import{SortableContext as BS,arrayMove as w0,useSortable as IS,verticalListSortingStrategy as ES}from"@dnd-kit/sortable";import{CSS as MS}from"@dnd-kit/utilities";import{FormDialog as _0}from"@ehfuse/mui-form-dialog";import{ClearTextField as bd,LabelSelect as k0,NumberField as S0}from"@ehfuse/mui-form-controls";import RS from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as OS,ErrorAlert as T0}from"@ehfuse/alerts";import{Fragment as LS,jsx as st,jsxs as wn}from"react/jsx-runtime";var AS=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}],C0="\uC5C5\uBB34 \uC81C\uBAA9",yd=2,Xl={flex:1,minWidth:0},B0=56,I0=20,DS=`${I0+yd*8}px`;function Zl(){return{name:"",description:"",group_seq:0,items:[]}}function PS(){return{title:"",start_offset_days:0,due_offset_days:0,priority:"medium"}}function NS({id:e,children:h}){let{attributes:b,listeners:l,setNodeRef:o,transform:s,transition:r,isDragging:t}=IS({id:e});return st(Jt,{ref:o,sx:{transform:MS.Transform.toString(s),transition:r,...t?{opacity:.6,position:"relative",zIndex:1}:{}},children:h({handleProps:{...b,...l},dragging:t})})}function IV({open:e,templates:h,customTabs:b,onPickAccount:l,onClose:o,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,i]=os(!1),[a,d]=os(0),[f,u]=os(Zl()),[g,m]=os(!1),[x,_]=os([]),B=gd(0),[A,j]=os(0),D=gd(null),P=gd(null);x0(()=>{if(e)return;let L=window.setTimeout(()=>{i(!1),d(0),u(Zl()),_([])},500);return()=>window.clearTimeout(L)},[e]);let N=()=>(B.current+=1,`template-item-${B.current}`),q=(L,$)=>{d(L),u($),_($.items.map(()=>N())),i(!0)},z=f.items.map((L,$)=>x[$]??`template-item-fallback-${$}`),T=()=>{let L=P.current?.getScrollContainer()??null;if(L){L.scrollTop=L.scrollHeight;return}let $=D.current?.querySelectorAll("*")??[];for(let U of Array.from($))if(U.scrollHeight>U.clientHeight+1){U.scrollTop=U.scrollHeight;return}},C=()=>{let L=D.current;if(!L)return null;let $=L.querySelectorAll("input[data-template-title]"),U=$.length?$:L.querySelectorAll(`input[placeholder="${C0}"]`);return U.length?U[U.length-1]:null};x0(()=>{if(A===0)return;let L=0,$=0,U=()=>{T();let W=C();W&&document.activeElement!==W&&W.focus(),L+=1,!(W&&document.activeElement===W)&&L<8&&($=window.setTimeout(U,50))},O=window.requestAnimationFrame(U);return()=>{window.cancelAnimationFrame(O),window.clearTimeout($)}},[A]);let R=b.filter(L=>!L.archived).map(L=>({value:String(Go(L.key)),label:L.label})),p=(L,$)=>{u(U=>({...U,items:U.items.map((O,W)=>W===L?{...O,...$}:O)}))},y=SS(kS(wS,{activationConstraint:{distance:5}})),v=L=>{let $=String(L.active?.id??""),U=String(L.over?.id??"");if(!$||!U||$===U)return;let O=z.indexOf($),W=z.indexOf(U);O<0||W<0||(u(M=>({...M,items:w0(M.items,O,W)})),_(M=>w0(M,O,W)))},w=async L=>{if(!l)return;let $=await l(f.items[L]?.manager_account_seq??0,"\uCC45\uC784\uC790");$&&p(L,{manager_account_seq:$.accountSeq,manager_name:$.name})},k=async()=>{let L=f.name.trim();if(!L){T0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let $=f.items.filter(W=>W.title.trim().length>0);if($.length===0){T0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}m(!0);let U={...f,name:L,items:$},O=a>0?await r(a,U):await s(U);m(!1),O&&(i(!1),d(0),u(Zl()))},S=st(Jt,{children:h.length===0?wn(Jt,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[st(xS,{sx:{fontSize:48,color:"#d9d9d6"}}),st(Jt,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):h.map(L=>wn(Jt,{sx:{display:"flex",alignItems:"center",gap:2.5,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[wn(Jt,{sx:{flex:1,minWidth:0},children:[st(Jt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:L.name}),wn(Jt,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",L.items.length,"\uAC74",L.description?` \xB7 ${L.description}`:""]})]}),n?st(is,{size:"medium",variant:"outlined",onClick:()=>n(L),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,st(oa,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>q(L.seq,{name:L.name,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:st(mS,{sx:{fontSize:19}})})}),st(oa,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>q(0,{name:`${L.name} \uC0AC\uBCF8`,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:st(gS,{sx:{fontSize:18}})})}),st(oa,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await OS({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${L.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(L.seq))()},children:st(cr,{sx:{fontSize:18}})})})]},L.seq))}),E=wn(Jt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[st(bd,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:f.name,onChange:L=>u($=>({...$,name:L.target.value}))}),wn(Jt,{sx:{display:"grid",gridTemplateColumns:R.length>0?"1fr 1fr":"1fr",gap:2},children:[st(bd,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:f.description??"",onChange:L=>u($=>({...$,description:L.target.value}))}),R.length>0?st(k0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(f.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...R],onChange:L=>u($=>({...$,group_seq:Number(L.target.value)||0}))}):null]}),wn(Jt,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[st(Jt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),st(Jt,{sx:{fontSize:14,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."})]}),f.items.length===0?st(Jt,{sx:{fontSize:14,color:"#9a9a97",py:2},children:'\uC544\uC9C1 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. "\uD56D\uBAA9 \uCD94\uAC00" \uB85C \uC808\uCC28\uB97C \uC21C\uC11C\uB300\uB85C \uC801\uC73C\uC138\uC694.'}):st(Jt,{ref:D,sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:st(RS,{ref:P,style:{maxHeight:"min(560px, 52vh)"},thumb:{width:6},children:st(vS,{sensors:y,collisionDetection:_S,modifiers:[CS,TS],onDragEnd:v,children:st(BS,{items:z,strategy:ES,children:f.items.map((L,$)=>st(NS,{id:z[$],children:({handleProps:U})=>wn(Jt,{sx:{borderBottom:$===f.items.length-1?"none":"1px solid #f2f2f0",px:yd,py:2,gap:2,display:"flex",flexDirection:"column"},children:[wn(Jt,{sx:{display:"flex",alignItems:"center",gap:yd},children:[st(Jt,{...U,"aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC21C\uC11C \uC774\uB3D9`,sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:"#c9c8c5",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:st(bS,{sx:{fontSize:I0}})}),st(bd,{size:"medium",fullWidth:!0,placeholder:C0,slotProps:{htmlInput:{"data-template-title":$}},value:L.title,onChange:O=>p($,{title:O.target.value})})]}),wn(Jt,{sx:{display:"flex",alignItems:"center",gap:2,pl:DS},children:[st(Jt,{sx:Xl,children:st(S0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.start_offset_days??null,onValueChange:O=>p($,{start_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),st(Jt,{sx:Xl,children:st(S0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.due_offset_days??null,onValueChange:O=>p($,{due_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),st(Jt,{sx:Xl,children:st(k0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:L.priority??"medium",options:AS,onChange:O=>p($,{priority:O.target.value})})}),l?wn(Jt,{sx:{...Xl,position:"relative"},children:[st(is,{variant:"outlined",fullWidth:!0,onClick:()=>{w($)},sx:{height:B0,display:"block",textAlign:"left",textTransform:"none",fontSize:16,fontWeight:400,lineHeight:`${B0-2}px`,py:0,px:1.75,pr:L.manager_account_seq?4.5:1.75,borderColor:"#c4c4c4",color:L.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{borderColor:"#37352f",bgcolor:"transparent"}},children:L.manager_name||"\uCC45\uC784\uC790"}),L.manager_account_seq?st(oa,{title:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30",arrow:!0,disableInteractive:!0,children:st(na,{size:"small","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uCC45\uC784\uC790 \uBE44\uC6B0\uAE30`,onClick:O=>{O.stopPropagation(),p($,{manager_account_seq:0,manager_name:""})},sx:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)"},children:st(yS,{sx:{fontSize:18}})})}):null]}):null,st(oa,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(O=>({...O,items:O.items.filter((W,M)=>M!==$)})),_(O=>O.filter((W,M)=>M!==$))},children:st(cr,{sx:{fontSize:18}})})})]})]})},z[$]))})})})})]});return wn(LS,{children:[st(_0,{open:e,onClose:o,maxWidth:"md",title:"\uC5C5\uBB34 \uD15C\uD50C\uB9BF",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template",tabs:{visible:!1},actions:{showCancelButton:!1,left:st(is,{startIcon:st(v0,{sx:{fontSize:18}}),onClick:()=>q(0,Zl()),children:"\uC0C8 \uD15C\uD50C\uB9BF"}),right:st(is,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})},sectionContentPaddingTop:0,sections:[{id:"templates",title:"",showTitle:!1,children:S}]}),st(_0,{open:c,onClose:()=>i(!1),maxWidth:"md",title:a>0?"\uD15C\uD50C\uB9BF \uC218\uC815":"\uC0C8 \uD15C\uD50C\uB9BF",locale:"ko",backdropClick:!1,fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template-form",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,left:st(is,{startIcon:st(v0,{sx:{fontSize:18}}),onClick:()=>{u(L=>({...L,items:[...L.items,PS()]})),_(L=>[...L,N()]),j(L=>L+1)},children:"\uD56D\uBAA9 \uCD94\uAC00"}),right:st(is,{variant:"contained",disabled:g,onClick:()=>{k()},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"template-form",title:"",showTitle:!1,children:E}]})]})}import{useEffect as E0,useState as M0}from"react";import{Box as Pr,Button as jS}from"@mui/material";import{FormDialog as zS}from"@ehfuse/mui-form-dialog";import{DateTextField as FS}from"@ehfuse/mui-form-controls";import qS from"@ehfuse/overlay-scrollbar";import{jsx as Yr,jsxs as ia}from"react/jsx-runtime";function jV({open:e,template:h,todayStr:b,running:l=!1,onClose:o,onRun:s}){let[r,t]=M0(b),[n,c]=M0(h);E0(()=>{h&&c(h)},[h]),E0(()=>{e&&t(b)},[e]);let i=h??n,a=i?Mh(i,r):[];return Yr(zS,{open:e,onClose:o,maxWidth:"md",title:i?`${i.name} \uC2E4\uD589`:"\uD15C\uD50C\uB9BF \uC2E4\uD589",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-template-run",tabs:{visible:!1},sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:Yr(jS,{variant:"contained",disabled:l||a.length===0,onClick:()=>s(a,r),children:l?"\uB9CC\uB4DC\uB294 \uC911\u2026":`\uC5C5\uBB34 ${a.length}\uAC74 \uB9CC\uB4E4\uAE30`})},sections:[{id:"template-run",title:"",showTitle:!1,children:ia(Pr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Yr(Pr,{sx:{width:72,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uC900\uC77C"}),Yr(FS,{size:"medium",fullWidth:!0,value:r,onChange:d=>t(d.target.value)})]}),Yr(Pr,{sx:{fontSize:14.5,color:"#37352f"},children:"\uC544\uB798 \uC5C5\uBB34\uAC00 \uD55C\uAEBC\uBC88\uC5D0 \uB9CC\uB4E4\uC5B4\uC9D1\uB2C8\uB2E4. \uB0A0\uC9DC\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB41C \uAC12\uC785\uB2C8\uB2E4."}),ia(Pr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Yr(Pr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uC2DC\uC791"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uB9C8\uAC10"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"})]}),Yr(qS,{style:{maxHeight:520},thumb:{width:6},children:a.length===0?Yr(Pr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uB9CC\uB4E4 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map((d,f)=>ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.25,borderBottom:f===a.length-1?"none":"1px solid #f2f2f0",fontSize:16,fontWeight:500,color:"#111111"},children:[Yr(Pr,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.start_date?"#37352f":"#9a9a97"},children:Bc(d.start_date)||"-"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.due_date?"#37352f":"#9a9a97"},children:Bc(d.due_date)||"-"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.manager_name||"-"})]},f))})]})]})}]})}var $S={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function HS(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function xd(e){let h=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(h)?`${h.slice(2,4)}.${h.slice(5,7)}.${h.slice(8,10)}`:"-"}function ss(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function vd(e,h){let l=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=xd(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=xd(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(c=>String(c).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(c=>c.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:lr(e).name,projectLabel:e.tab_key?h.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:HS(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:o!=="-"&&l?`${o} ${l}`:o,priorityName:$S[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Pt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function WS(e,h){if(e===" ")return h*.3;let b=e.codePointAt(0)??0,l=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return h*(l?1:.55)}function Jl(e,h){let b=0;for(let l of String(e??""))b+=WS(l,h);return b}function as(e,h){let b=String(e??"").trim();if(!b)return["-"];let l=[],o="";for(let s of b){if(s===`
41
+ `)}function kp(e){navigator.clipboard.writeText(e).then(()=>V5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>U5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Ki(e,h){let b=K5(e);if(h&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&kp(b)});return}kp(b)}import{Fragment as t4,jsx as Bt,jsxs as Sp}from"react/jsx-runtime";function Tp({task:e,myAccountSeq:h=0,onToggleCompleted:b,onChangeTitle:l,onChangeIcon:o,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:c,onLoadActivity:i,onPrint:a,onDelete:d,canDelete:f}){let u=Lt(),[g,m]=Fs(!1),[x,_]=Fs(null),[B,A]=Fs(null),[j,D]=Fs(null),[P,N]=Fs(null),q=!!e.is_notice,z=!!e.is_event,T=q?wt(e.icon||or):z?wt(e.icon||ar):null,C=q&&h>0&&(e.author_account_seq??0)===h,R=!lo(e,h),p=!!d&&(f??(h>0&&(e.author_account_seq??0)===h)),y=!z&&(q?C:(e.author_account_seq??0)===h||(e.manager_account_seq??0)===h);return Sp(t4,{children:[Sp(Gi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Yi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(X5,{})}):null,y&&!t?Bt(Xi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${on(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Gi,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Ln,{onClick:v=>N({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!T?null:z&&!R?Bt(Xi,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(G5,{onClick:v=>A(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(T,{sx:{fontSize:20}})})}):Bt(Gi,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(T,{sx:{fontSize:20}})}),x!==null?Bt(Gi,{component:"input",autoFocus:!0,spellCheck:!1,value:x,onChange:v=>_(v.target.value),onBlur:()=>{x.trim()&&x.trim()!==e.title&&l(e.seq,x.trim()),_(null)},onKeyDown:v=>{v.key==="Enter"&&v.target.blur(),v.key==="Escape"&&_(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Bt(Gi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":z?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Gi,{onClick:R?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:R?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?Bt(Xi,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Yi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(Q5,{sx:{fontSize:20}})})}):null,Bt(Xi,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Yi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Ki(e,u),sx:{color:"#6b7280"},children:u?Bt(Z5,{sx:{fontSize:20}}):Bt(J5,{sx:{fontSize:20}})})}),a?Bt(Xi,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Yi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(e4,{sx:{fontSize:20}})})}):null,p?Bt(Xi,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Yi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(cr,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Yi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(Y5,{})}):null]}),Bt(Dt,{open:!!P,anchorEl:P?.anchorEl??null,title:P?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:P?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>N(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),N(null)}}),Bt(zo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{o(e.seq,v),A(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>A(null)}),Bt(Dt,{open:!!j,anchorEl:j,title:"\uC774 \uC5C5\uBB34\uB97C \uD734\uC9C0\uD1B5\uC73C\uB85C \uBCF4\uB0B4\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>D(null),onConfirm:()=>{D(null),d?.(e)}}),Bt(Ml,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:i,onClose:()=>m(!1)})]})}import{useRef as d4,useState as yn}from"react";import{Box as Xt,Button as Zi,ButtonBase as Rp,Checkbox as f4,Divider as yi,Menu as Nu,MenuItem as Lu}from"@mui/material";import h4 from"@mui/icons-material/ExpandLess";import p4 from"@mui/icons-material/ExpandMore";import m4 from"@mui/icons-material/ConfirmationNumberOutlined";import Op from"@mui/icons-material/Check";import g4 from"@mui/icons-material/DirectionsRunOutlined";import b4 from"@mui/icons-material/SpeedOutlined";import ju from"@mui/icons-material/CheckCircle";import y4 from"@mui/icons-material/CheckCircleOutlineOutlined";import zu from"@mui/icons-material/CheckCircleOutlined";import Ap from"@mui/icons-material/AccessTimeOutlined";import x4 from"@mui/icons-material/AutorenewOutlined";import v4 from"@mui/icons-material/LabelOutlined";import w4 from"@mui/icons-material/PersonOutlineOutlined";import _4 from"@mui/icons-material/SubjectOutlined";import k4 from"@mui/icons-material/StickyNote2Outlined";import S4 from"@mui/icons-material/PanToolAltOutlined";import Dp from"@mui/icons-material/LockOutlined";import Pp from"@mui/icons-material/PublicOutlined";import Np from"@mui/icons-material/Group";import T4 from"@mui/icons-material/Repeat";import C4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as Lp,InfoAlert as B4}from"@ehfuse/alerts";import{DatePicker as I4}from"@ehfuse/mui-datetime-picker";import{useState as r4}from"react";import{TextField as n4}from"@ehfuse/mui-form-controls";import{jsx as o4}from"react/jsx-runtime";function Cp({value:e,onCommit:h,onDraftChange:b,readOnly:l=!1}){let[o,s]=r4(null);return o4(n4,{value:o??e,placeholder:l?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:l}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&h(o),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Du,useState as Pu}from"react";import{Box as Or,Button as Ep,IconButton as i4}from"@mui/material";import s4 from"@mui/icons-material/AccountTreeOutlined";import a4 from"@mui/icons-material/LinkOutlined";import l4 from"@mui/icons-material/Close";import c4 from"@mui/icons-material/RedoOutlined";function bi(e){return e.relations??[]}function fz(e,h,b){return bi(e).some(l=>l.type===b&&l.task_seq===h.seq)||bi(h).some(l=>l.type===b&&l.task_seq===e.seq)}function Bp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Ou(e,h){let b=new Map(h.map(u=>[u.seq,u]));b.set(e.seq,e);let l=new Map,o=(u,g)=>{l.has(u)||l.set(u,new Set),l.has(g)||l.set(g,new Set),l.get(u).add(g),l.get(g).add(u)};for(let u of b.values())for(let g of bi(u))g.type==="follow_up"&&b.has(g.task_seq)&&o(u.seq,g.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let u=r.shift();for(let g of l.get(u)??[])s.has(g)||(s.add(g),r.push(g))}let t=[...s].map(u=>b.get(u)).filter(u=>!!u).sort((u,g)=>Bp(u).localeCompare(Bp(g))),n=new Set;for(let u of bi(e))u.type==="related"&&n.add(u.task_seq);for(let u of b.values())u.seq!==e.seq&&bi(u).some(g=>g.type==="related"&&g.task_seq===e.seq)&&n.add(u.seq);let c=[...n].map(u=>b.get(u)).filter(u=>u!==void 0&&u.seq!==e.seq),i=[...b.values()].filter(u=>u.seq!==e.seq&&bi(u).some(g=>g.type==="duplicate_of"&&g.task_seq===e.seq)),a=bi(e).find(u=>u.type==="duplicate_of")?.task_seq,d=a?b.get(a)??null:null,f=[...b.values()].filter(u=>u.seq!==e.seq&&(u.checklist??[]).some(g=>Number(g.task_seq??0)===e.seq));return{lineage:t,related:c,duplicates:i,duplicateOf:d,parents:f}}function Au(e,h){let b=Ou(e,h);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)+b.parents.length}function Ip(e,h){return Au(e,h)>0}import{Fragment as u4,jsx as Wt,jsxs as Rn}from"react/jsx-runtime";function Rl({item:e,caption:h,onOpen:b,onUnlink:l}){let o=e.is_notice||e.is_event?wt(e.icon||(e.is_notice?or:ar)):null;return Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[h?Wt(Or,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:h}):null,o?Wt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Rn(Or,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Wt(At,{option:lr(e),small:!0}),l?Wt(i4,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:l,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Wt(l4,{sx:{fontSize:15}})}):null]})}function Mp({task:e,tasks:h,readOnly:b=!1,onOpenTask:l,onLink:o,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Pu(!1),[c,i]=Pu(null),[a,d]=Pu(null),f=Du(()=>Ou(e,h),[e,h]),u=f.lineage.length>=2,g=Du(()=>Au(e,h),[e,h]),m=Du(()=>{let _=new Set;for(let B of f.lineage)_.add(B.seq);for(let B of f.related)_.add(B.seq);for(let B of f.duplicates)_.add(B.seq);for(let B of f.parents)_.add(B.seq);return f.duplicateOf&&_.add(f.duplicateOf.seq),[..._]},[f]),x=(_,B,A)=>{d({anchorEl:_,targetSeq:B,type:A})};return Rn(bn,{icon:Wt(s4,{sx:{fontSize:19,display:"block"}}),title:Rn(u4,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?Wt(Or,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:Rn(Or,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(c4,{sx:{fontSize:16}}),onClick:_=>i(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(a4,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?Wt(Or,{sx:{mb:f.related.length||f.duplicates.length||f.duplicateOf?1:0},children:f.lineage.map((_,B)=>{let A=_.seq===e.seq,j=B===f.lineage.length-1;return Rn(Or,{sx:{display:"flex",gap:1},children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Wt(Or,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":_.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),j?null:Wt(Or,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Rn(Or,{sx:{flex:1,minWidth:0,pb:j?0:.5},children:[Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Rn(Or,{component:"span",onClick:!A&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Wt(At,{option:lr(_),small:!0})]}),Wt(Or,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,f.parents.map(_=>Wt(Rl,{item:_,caption:"\uC0C1\uC704 \uC5C5\uBB34",onOpen:l?()=>l(_.seq):void 0},`parent-${_.seq}`)),f.duplicateOf?Wt(Rl,{item:f.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(f.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,f.duplicateOf.seq,"duplicate_of"):void 0}):null,f.duplicates.map(_=>Wt(Rl,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),f.related.map(_=>Wt(Rl,{item:_,onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"related"):void 0},`rel-${_.seq}`)),g===0?Wt(Or,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?Wt(bl,{open:t,task:e,tasks:h,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(_,B)=>o(e.seq,_,B)}):null,Wt(Dt,{open:!!c,anchorEl:c,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),Wt(Dt,{open:!!a,anchorEl:a?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>d(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),d(null)}})]})}import{Fragment as qr,jsx as we,jsxs as Ut}from"react/jsx-runtime";function Ko({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return we(Xt,{component:"span",sx:{color:"#9a9a97"},children:e})}function jp({task:e,customTabs:h,statusOptions:b,avatarSrcByName:l,onChangeStatus:o,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:c,onChangeReminder:i,onMemberEdit:a,onChangePriority:d,onChangeVisibility:f,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:N,contentLoading:q=!1,onChangeContentHeight:z,onAddChecklistItem:T,onToggleChecklistItem:C,onRemoveChecklistItem:R,onUpdateChecklistItem:p,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:S,relatedTasksPool:E,onOpenRelatedTask:L,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:O,onAddAttachments:W,onRemoveAttachment:M,onPreview:I,onDownload:F,onUpdateComment:V,onRemoveComment:Y,onToggleCommentReaction:K,currentUserName:H="",myAccountSeq:Z=0,noticeAdmin:J=!1,hideProject:G=!1,hideLabel:X=!1,showTitle:ee=!1,onChangeTitle:ne,onToggleCompleted:re,onChangeIcon:oe,onChangeIconColor:se,employees:ge=[],onAckConfirm:ve,onRequestConfirm:_e,onChangeBugField:De,sprints:pe=[],sprintProject:de=!1,hideSprint:Ve=!1,onChangeSprint:Pe,onChangeStoryPoints:ie,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ze,Te]=yn(null),ce=d4(!1),[Re,Se]=yn(null),[Ce,lt]=yn(null),[Le,qe]=yn(null),[kt,$e]=yn(!1),Ne={[Bn]:kt?{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"}},[vt,et]=yn(null),[Ke,bt]=yn(null),[tt,te]=yn(null),[ue,me]=yn(null),[ke,Je]=yn(null),[Me,Ae]=yn(null),[yt,We]=yn(null),Ie=!!e.is_notice,Ue=!!e.is_event,rt=!!e.is_bug,dt=!!ye&&Ra(e,Z),St=!!ye&&Oa(e,Z),Rt=!!xe&&rt&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(ae=>ae.account_seq===Z),xt=!lo(e,Z),Qt=!e.is_event&&(e.is_notice?Z>0&&(e.author_account_seq??0)===Z:(e.author_account_seq??0)===Z||(e.manager_account_seq??0)===Z),Nt=e.is_notice||e.is_event?wt(e.icon||(e.is_notice?or:ar)):null,Vt=Ie?!Ma(e,Z):xt,Q=dt||St?Ut(Ln,{onClick:ae=>We(ae.currentTarget),children:[we(S4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,le=Ie?Tl(e,ge):"",be=Ie?op(e,ge,Z):null,fe=Ie?null:Va(e,Z),Ee=!!(fe&&fe.total>0||Ie&&be),je=!Ie,ze=Ut(qr,{children:[we(pt,{icon:we(w4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Gn(9),Ne??null,...Ue?[]:[tr(1)]],children:e.created_by?Ut(qr,{children:[we(jr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Ko,{})}),we(pt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Gn(11),Ne??null,...Ue?[]:[tr(2)]],children:e.created_time?on(e.created_time):we(Ko,{})})]});return Ut(qr,{children:[ee?Ut(Xt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Qt?we(f4,{checked:e.completed,icon:we(y4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(ju,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(ae,Fe)=>{Ce||lt({anchorEl:ae.currentTarget,nextCompleted:Fe})},sx:{p:0,mt:.25}}):null,Nt?Ue&&!xt?we(Rp,{onClick:ae=>Se(ae.currentTarget),sx:{display:"flex",p:.25,mt:.1,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:we(Nt,{sx:{fontSize:20}})}):we(Xt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(Ie?"#e5484d":"#1e3a8a")},children:we(Nt,{sx:{fontSize:20}})}):null,we(Xt,{sx:{flex:1,minWidth:0},children:Ze!==null?we(Xt,{component:"div",contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,ref:ae=>{if(!ae||ae.dataset.focused)return;ae.dataset.focused="1",ae.focus();let Fe=document.createRange();Fe.selectNodeContents(ae),Fe.collapse(!1);let Ye=window.getSelection();Ye?.removeAllRanges(),Ye?.addRange(Fe)},onBlur:ae=>{let Fe=(ae.currentTarget.textContent??"").replace(/\n/g," ").trim();!ce.current&&Fe&&Fe!==e.title&&ne(e.seq,Fe),ce.current=!1,Te(null)},onKeyDown:ae=>{ae.key==="Enter"&&(ae.preventDefault(),ae.target.blur()),ae.key==="Escape"&&(ce.current=!0,ae.target.blur())},onPaste:ae=>{ae.preventDefault();let Fe=ae.clipboardData.getData("text/plain").replace(/\n/g," ");document.execCommand("insertText",!1,Fe)},sx:{outline:"none",fontSize:19,fontWeight:600,color:"#37352f",lineHeight:"26px",cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text",wordBreak:"break-word"},children:Ze}):we(Xt,{onClick:()=>Te(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:"26px",cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text",wordBreak:"break-word"},children:e.title})}),we(Dt,{open:!!Ce,anchorEl:Ce?.anchorEl??null,title:Ce?.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:Ce?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>lt(null),onConfirm:()=>{Ce&&re(e.seq,Ce.nextCompleted),lt(null)}})]}):null,Ut(Xt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[Bn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(dl,{hideProject:G,pinColumns:!0,projectColumn:!Ue&&!X?2:"full",values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminders:zn(e),priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:h,avatarSrcByName:l,hideDueDate:!Ue&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:Ie,event:Ue,readOnly:xt,targetSummary:le,onChangeProject:ae=>t(e.seq,ae),onAddProject:n,onChangeStartDate:ae=>c(e.seq,"start_date",ae),onChangeDueDate:ae=>c(e.seq,"due_date",ae),onChangeReminder:ae=>i(e.seq,ae),onChangePriority:ae=>d(e.seq,ae),onChangeEventTime:ae=>m?.(e.seq,ae),onChangeEventPlace:ae=>x?.(e.seq,ae),onChangeEventAddress:ae=>_?.(e.seq,ae),onMemberEdit:ae=>a(e,ae,null),narrowCollapsedSx:Ne,reminderLocked:e.completed,managerAction:Q,leading:Ut(qr,{children:[Rt||Q&&(Ie||Ue)?Ut(Xt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[Ie||Ue?Q:null,Rt?Ut(qr,{children:[we(Zi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Zi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,rt&&e.ticket_no?we(pt,{icon:we(m4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:tr(1),children:we(Xt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ue?null:we(Xt,{sx:rt&&e.ticket_no||je||Ee?tr(rt&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(pt,{icon:we(x4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:xt||e.completed?void 0:ae=>et(ae),children:we(At,{option:lr(e)})})}),Ie?null:(()=>{let ae=kn(e),Fe=ae==="all"?we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}):ae==="group"?we(Np,{sx:{fontSize:17,color:"#d9730d"}}):we(Dp,{sx:{fontSize:17}}),Ye=ae==="all"?"\uC804\uCCB4\uACF5\uAC1C":ae==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(Qe=>Qe.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return we(Xt,{sx:Ue?void 0:tr(rt?1:2),children:we(pt,{icon:Fe,label:"\uACF5\uAC1C",onClick:xt||!f?void 0:Qe=>bt(Qe),children:Ye})})})(),!Ie&&!rt?we(Xt,{sx:Ue?void 0:tr(1),children:we(pt,{icon:we(T4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:xt||!u?void 0:ae=>te(ae),children:e.repeat_rule?sl(e.repeat_rule):we(Ko,{label:"\uC5C6\uC74C"})})}):null,!Ie&&!rt&&e.repeat_rule?we(Xt,{sx:Ue?void 0:tr(2),children:we(pt,{icon:we(C4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:xt||!u?void 0:ae=>me(ae),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:we(Ko,{})})}):null,fe&&fe.total>0?we(Xt,{sx:Ue?void 0:tr(2),children:we(pt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:fe.canConfirm?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Ut(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:fe.myTime?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:ae=>qe({anchorEl:ae.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[fe.count," / ",fe.total]})})}):null,Ie&&be?we(Xt,{sx:tr(2),children:we(pt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Xt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:be.canAck?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):we(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:be.acked?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:ae=>qe({anchorEl:ae.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:be.total>0&&be.count>=be.total?"\uC644\uB8CC":Ut(qr,{children:[be.count,we(Xt,{component:"span",sx:{mx:.4},children:"/"}),be.total]})})})})}):null,de&&!Ve&&!Ue&&!Ie?Ut(qr,{children:[we(pt,{icon:we(g4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:xt?void 0:ae=>Je(ae),sx:tr(1),children:(e.sprint_seq??0)>0?pe.find(ae=>ae.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":we(Ko,{label:"\uBBF8\uBC30\uC815"})}),we(pt,{icon:we(b4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:tr(2),children:we(_o,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:xt,onCommit:ae=>ie?.(e.seq,Number(ae.replace(/[^0-9.]/g,""))||0)})})]}):null,Ue||X?null:we(Xt,{sx:[G?{gridColumn:"1 / -1"}:tr(1),Ne??null],children:we(pt,{icon:we(v4,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:xt?void 0:ae=>Ae(ae),children:(e.label_keys??[]).length>0?we(No,{labelKeys:e.label_keys??[],labelOptions:b}):we(Ko,{})})})]}),afterProject:Ue?null:ze,trailing:Ut(qr,{children:[rt?we(fl,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:xt,showResolution:!!e.completed,onChangeRepro:ae=>De?.(e.seq,"bug_repro",ae),onChangeDevice:ae=>De?.(e.seq,"bug_device",ae),onChangeWhere:ae=>De?.(e.seq,"bug_where",ae),onChangeVersion:ae=>De?.(e.seq,"bug_version",ae),onChangeResolution:ae=>Be?.(e.seq,ae)}):null,Ue?ze:null,e.completed?Ut(qr,{children:[we(pt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Gn(10),Ne??null,...Ue?[]:[tr(1)]],children:e.completed_by?Ut(qr,{children:[we(jr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Ko,{})}),we(pt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Gn(12),Ne??null,...Ue?[]:[tr(2)]],children:e.completed_time?on(e.completed_time):we(Ko,{})})]}):null]})}),Ut(Xt,{sx:{display:"none",[Bn]:{display:"block",mt:1.5,mb:0}},children:[we(yi,{sx:{borderColor:"#e6e6e3"}}),we(Rp,{onClick:()=>$e(ae=>!ae),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:kt?Ut(qr,{children:["\uC811\uAE30 ",we(h4,{sx:{fontSize:18}})]}):Ut(qr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we(p4,{sx:{fontSize:18}})]})})]}),Ut(Xt,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3",[Bn]:{mt:0,mb:1.25}}}),we(bn,{icon:we(_4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!xt?we(pl,{content:e.content??"",templates:D,onApply:ae=>j?.(e.seq,ae),onSave:P,onRemove:N}):void 0,children:we(Xt,{sx:{userSelect:"text"},children:q?we(Xt,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:we($a,{})}):we(ml,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:z?ae=>z(e.seq,ae):void 0,readOnly:xt,onChange:ae=>j(e.seq,ae)})})}),e.is_bug?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(bn,{icon:we(k4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Xt,{sx:{userSelect:"text"},children:we(Cp,{value:e.note,readOnly:Vt,onCommit:ae=>B(e.seq,ae),onDraftChange:A?ae=>A(e.seq,ae):void 0})})})]}),Ue?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(yl,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Vt,onAdd:T,onToggle:C,onRemove:R,onUpdate:p,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:S,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ue&&!Ie&&Ip(e,E)?Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(Mp,{task:e,tasks:E,readOnly:xt,onOpenTask:L,onLink:$,onUnlink:U,onCreateFollowUp:O})]}):null,we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(_l,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Vt,onAdd:W,onRemove:M,onPreview:I?ae=>I({...ae,taskSeq:e.seq}):void 0,onDownload:F?ae=>F({...ae,taskSeq:e.seq}):void 0})]}),we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(xp,{taskSeq:e.seq,comments:e.comments??[],currentUserName:H,myAccountSeq:Z,avatarSrcByName:l,onUpdate:V,onRemove:Y,onToggleReaction:K,onPreview:I?ae=>I({...ae,taskSeq:e.seq}):void 0,onDownload:F?ae=>F({...ae,taskSeq:e.seq}):void 0})]}),we(Ei,{anchorEl:vt,value:e.status,options:Ie?ys:rt?ni:xs,onSelect:ae=>o(e.seq,ae),onClose:()=>et(null)}),we(Nu,{transitionDuration:0,anchorEl:tt,open:!!tt,onClose:()=>te(null),children:[{value:"",label:"\uC5C6\uC74C"},...Os].map(ae=>we(Lu,{selected:(e.repeat_rule??"")===ae.value,onClick:()=>{te(null),(async()=>{let Fe=e.repeat_rule??"";if(ae.value===Fe)return;if(ae.value===""){await Lp({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let Ye=String(e.due_date??"").slice(0,10);if(!Ye){B4(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC608\uC815\uC744 \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}Fe&&!await Lp({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,ae.value,al(Ye,ae.value))})()},sx:{fontSize:14,minWidth:140},children:ae.label},ae.value||"none"))}),we(I4,{anchorEl:ue,open:!!ue,onClose:()=>me(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:ae=>{me(null);let Fe=qt=>String(qt).padStart(2,"0"),Ye=`${ae.getFullYear()}-${Fe(ae.getMonth()+1)}-${Fe(ae.getDate())}`,Qe=e.repeat_rule??"";Qe&&u?.(e.seq,Qe,Ye)}}),we(Nu,{transitionDuration:0,anchorEl:Ke,open:!!Ke,onClose:()=>bt(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(Dp,{sx:{fontSize:17,color:"#57564f"}}),selected:kn(e)==="involved",onPick:()=>f?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}),selected:kn(e)==="all",onPick:()=>f?.(e.seq,"all",0)},...g.map(ae=>({key:`group-${ae.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${ae.name}`,icon:we(Np,{sx:{fontSize:17,color:"#d9730d"}}),selected:kn(e)==="group"&&(e.visibility_group_seq??0)===ae.seq,onPick:()=>f?.(e.seq,"group",ae.seq)}))].map(ae=>Ut(Lu,{selected:ae.selected,onClick:()=>{ae.onPick(),bt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ae.icon,ae.label,ae.selected?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},ae.key))}),we(Nu,{transitionDuration:0,anchorEl:ke,open:!!ke,onClose:()=>Je(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...pe.filter(ae=>`custom-${ae.group_seq}`===String(e.tab_key??"")).map(ae=>({seq:ae.seq,label:mn(ae)}))].map(ae=>Ut(Lu,{onClick:()=>{Pe?.(e.seq,ae.seq),Je(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ae.label,(e.sprint_seq??0)===ae.seq?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},ae.seq))}),we(Ua,{anchorEl:Le?.anchorEl??null,open:!!Le?.open,acks:e.acks??[],total:be?.total??fe?.total??0,pendingNames:be?.pendingNames??fe?.pendingNames??[],avatarSrcByName:l,onRequestConfirm:_e&&(be?be.count<be.total:fe&&fe.count<fe.total)?()=>{_e(e.seq),qe(ae=>ae?{...ae,open:!1}:null)}:void 0,onClose:()=>qe(ae=>ae?{...ae,open:!1}:null)}),we(Sl,{anchorEl:Me,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:ae=>s(e.seq,Ia(e.label_keys??[],ae)),onAddLabel:r,onClose:()=>Ae(null)}),we(zo,{anchorEl:Re,value:e.icon??"",color:e.icon_color??"",onSelect:ae=>{oe(e.seq,ae),Se(null)},onSelectColor:se?ae=>se(e.seq,ae):void 0,onClose:()=>Se(null)}),we(Dt,{open:!!yt,anchorEl:yt,title:dt?"\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:()=>We(null),onConfirm:()=>{ye?.(e.seq),We(null)}})]})}import{Fragment as P4,jsx as $r,jsxs as Wp}from"react/jsx-runtime";function GF(){let e=new Date,h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function YF({open:e,task:h,onClose:b,onAddComment:l,onSaveFields:o,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Lt(),B=Fp(null);h&&(B.current=h);let A=h??B.current,[j,D]=qp(!1),[P,N]=qp({}),q=Object.keys(P).length>0;zp(()=>{N({})},[h?.seq,e]);let z=Fp(null);if(zp(()=>{z.current?.scrollTo({top:0})},[h?.seq]),!A)return null;let T=_&&q?{...A,...P}:A,C=T.checklist??[],R=(S,E)=>{_?N(L=>({...L,...S})):E()},p=()=>{let S=P;N({});let E=A.seq,L=S.title===void 0?void 0:String(S.title).trim();if(o){let $={...S};L!==void 0&&(L?$.title=L:delete $.title),Object.keys($).length>0&&o(E,$),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}L&&n(E,L),S.icon!==void 0&&c(E,String(S.icon)),S.icon_color!==void 0&&i?.(E,String(S.icon_color)),S.status!==void 0&&x.onChangeStatus(E,S.status),S.label_keys!==void 0&&x.onChangeLabels(E,S.label_keys??[]),S.tab_key!==void 0&&x.onChangeProject(E,String(S.tab_key??"")),S.start_date!==void 0&&x.onChangeDate(E,"start_date",String(S.start_date??"")),S.due_date!==void 0&&x.onChangeDate(E,"due_date",String(S.due_date??"")),S.reminders!==void 0&&x.onChangeReminder(E,S.reminders),S.priority!==void 0&&x.onChangePriority(E,S.priority),S.event_time!==void 0&&x.onChangeEventTime?.(E,String(S.event_time??"")),S.event_place!==void 0&&x.onChangeEventPlace?.(E,String(S.event_place??"")),S.event_address!==void 0&&x.onChangeEventAddress?.(E,String(S.event_address??"")),S.content!==void 0&&x.onChangeContent(E,String(S.content??"")),S.note!==void 0&&x.onChangeNote(E,String(S.note??"")),S.visibility!==void 0&&x.onChangeVisibility?.(E,S.visibility,Number(S.visibility_group_seq??0)),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(S,E)=>R({status:E},()=>x.onChangeStatus(S,E)),onChangeLabels:(S,E)=>R({label_keys:E},()=>x.onChangeLabels(S,E)),onChangeProject:(S,E)=>R({tab_key:E},()=>x.onChangeProject(S,E)),onChangeDate:(S,E,L)=>R({[E]:L},()=>x.onChangeDate(S,E,L)),onChangeReminder:(S,E)=>R({reminders:E},()=>x.onChangeReminder(S,E)),onChangePriority:(S,E)=>R({priority:E},()=>x.onChangePriority(S,E)),onChangeEventTime:(S,E)=>R({event_time:E},()=>x.onChangeEventTime?.(S,E)),onChangeEventPlace:(S,E)=>R({event_place:E},()=>x.onChangeEventPlace?.(S,E)),onChangeEventAddress:(S,E)=>R({event_address:E},()=>x.onChangeEventAddress?.(S,E)),onChangeContent:(S,E)=>R({content:E},()=>x.onChangeContent(S,E)),onChangeNote:(S,E)=>R({note:E},()=>x.onChangeNote(S,E)),onMemberEdit:(S,E)=>x.onMemberEdit(S,E,_?L=>N($=>({...$,...L})):null),onChangeNoteDraft:_?(S,E)=>R({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(S,E,L)=>R({visibility:E,visibility_group_seq:L},()=>x.onChangeVisibility?.(S,E,L)):void 0,onAddChecklistItem:(S,E)=>R({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(S,E)),onToggleChecklistItem:(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,checked:L}:$)},()=>x.onToggleChecklistItem(S,E,L)),onRemoveChecklistItem:(S,E)=>R({checklist:C.filter((L,$)=>$!==E)},()=>x.onRemoveChecklistItem(S,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,label:L}:$)},()=>x.onUpdateChecklistItem?.(S,E,L)):void 0,onReorderChecklist:x.onReorderChecklist?(S,E)=>R({checklist:E},()=>x.onReorderChecklist?.(S,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(S,E,L)=>R({checklist:[...C,{label:L,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(S,E,L)):void 0},v=$r(jp,{...y,task:T,myAccountSeq:r,onChangeTitle:(S,E)=>R({title:E},()=>n(S,E)),onToggleCompleted:t,onChangeIcon:(S,E)=>R({icon:E},()=>c(S,E)),onChangeIconColor:(S,E)=>R({icon_color:E},()=>i?.(S,E)),showTitle:_||s==="dialog"}),w=$r(vp,{onSubmit:(S,E)=>l(T.seq,S,E)},T.seq);return _||s==="dialog"?Wp(P4,{children:[$r(D4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:T.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":T.is_event?"\uC77C\uC815":T.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...f?[{icon:$r(O4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:$r(R4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Ki(T,!0)},..._?[{raw:!0,icon:$r(E4,{variant:"contained",size:"small",disableElevation:!0,disabled:!q,onClick:q?p:void 0,sx:{ml:1.5,height:32,minWidth:64,px:1.75,py:0,borderRadius:1,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#f2f2f0",color:"#c9c8c5"}},children:"\uC800\uC7A5\uD558\uAE30"})}]:[]]},fullScreen:_,maxWidth:_?void 0:"md",width:_?void 0:720,mobilePresentation:_?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:w},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:$r(Ol,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},A.seq),$r(Ml,{open:j,taskSeq:T.seq,items:a,loading:d,onLoad:f,onClose:()=>D(!1)})]}):$r(M4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Wp(Ol,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[$r(Tp,{task:T,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,onClose:b,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m}),$r($p,{sx:{borderColor:"#e6e6e3"}}),$r(Ol,{sx:{flex:1,minHeight:0},children:$r(A4,{ref:z,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),$r($p,{sx:{borderColor:"#37352f"}}),$r(Ol,{sx:{flexShrink:0},children:w})]})})}import{useEffect as W4,useState as Bo}from"react";import{Box as Hr,Button as Hu,IconButton as Kp}from"@mui/material";import{FormDialog as Gp}from"@ehfuse/mui-form-dialog";import U4 from"@mui/icons-material/Add";import V4 from"@mui/icons-material/DirectionsRunOutlined";import K4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Yp}from"@ehfuse/alerts";import{ClearTextField as Xp,DateTextField as Zp,LabelSelect as Jp}from"@ehfuse/mui-form-controls";import{useEffect as N4,useState as Up}from"react";import{Box as Co,Button as L4,FormControlLabel as Fu,Radio as qu,RadioGroup as j4}from"@mui/material";import{FormDialog as z4}from"@ehfuse/mui-form-dialog";import{LabelSelect as F4}from"@ehfuse/mui-form-controls";import q4 from"@ehfuse/overlay-scrollbar";import{Fragment as $4,jsx as Ar,jsxs as Ji}from"react/jsx-runtime";function Vp({open:e,sprint:h,remainingTasks:b,sprints:l,onClose:o,onConfirm:s}){let r=l.filter(d=>d.seq!==h?.seq&&d.group_seq===(h?.group_seq??0)&&d.status!=="closed"),[t,n]=Up("backlog"),[c,i]=Up(0);N4(()=>{e&&(n(r.length>0?"move":"backlog"),i(r[0]?.seq??0))},[e]);let a=b.length>0;return Ar(z4,{open:e,onClose:o,maxWidth:"sm",title:"\uBAA9\uD45C \uB9C8\uAC10",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-close",tabs:{visible:!1},actions:{showCancelButton:!0,right:Ar(L4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(d=>d.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:Ji(Co,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Ji(Co,{sx:{fontSize:18,color:"#37352f"},children:[Ar(Co,{component:"span",sx:{fontWeight:600},children:h?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?Ji($4,{children:[Ji(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:["\uB05D\uB098\uC9C0 \uC54A\uC740 \uC5C5\uBB34\uAC00"," ",b.length,"\uAC74 \uC788\uC2B5\uB2C8\uB2E4. \uC5B4\uB5BB\uAC8C \uD560\uAE4C\uC694?"]}),Ar(Co,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Ar(q4,{style:{maxHeight:220},thumb:{width:6},children:b.map(d=>Ji(Co,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Ar(Co,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Ar(At,{option:lr(d)})]},d.seq))})}),Ji(j4,{value:t,onChange:(d,f)=>n(f),children:[r.length>0?Ar(Fu,{value:"move",control:Ar(qu,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Ar(Co,{sx:{pl:4,pb:1},children:Ar(F4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(d=>({value:String(d.seq),label:d.name})),onChange:d=>i(Number(d.target.value)||0)})}):null,Ar(Fu,{value:"backlog",control:Ar(qu,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Ar(Fu,{value:"keep",control:Ar(qu,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Ar(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:"\uB0A8\uC740 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774\uB300\uB85C \uB9C8\uAC10\uD558\uBA74 \uBAA9\uD45C\uAC00 \uC885\uB8CC\uB429\uB2C8\uB2E4."})]})}]})}var $u="custom-";function H4(e){return e.startsWith($u)}function aq(e){return e>0?`${$u}${e}`:""}function Go(e){if(!H4(e))return 0;let h=Number(e.slice($u.length));return Number.isInteger(h)&&h>0?h:0}import{Fragment as em,jsx as Ft,jsxs as Yo}from"react/jsx-runtime";var G4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function Qp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function vq({open:e,customTabs:h,sprints:b,onClose:l,onCreate:o,onUpdate:s,onChangeStatus:r,tasks:t=[],onCloseSprint:n,onRemove:c}){let i=h.filter(E=>E.useSprints&&!E.archived),[a,d]=Bo(""),[f,u]=Bo(""),[g,m]=Bo(""),[x,_]=Bo(""),[B,A]=Bo(""),[j,D]=Bo(!1),[P,N]=Bo(!1),[q,z]=Bo(null),T=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,R]=Bo(0);W4(()=>{e&&(d(i.length===1?i[0].key:""),u(""),m(""),_(""),A(""),R(0))},[e]);let p=()=>{u(""),m(""),_(""),A(""),R(0),N(!1)},y=E=>{R(E.seq),d(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),A(E.end_date)},v=C>0||P,w=async()=>{let E=Go(a);if(!E){Yp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!f.trim()){Yp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:f.trim(),goal:g.trim(),start_date:x,end_date:B}),p();return}await o({group_seq:E,name:f.trim(),goal:g.trim(),start_date:x,end_date:B})&&p()}finally{D(!1)}},k=new Map(h.map(E=>[Go(E.key),E.label])),S=Ft(Hr,{children:i.length===0?Ft(Hr,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):Ft(em,{children:Ft(Hr,{children:b.length===0?Yo(Hr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ft(V4,{sx:{fontSize:48,color:"#d9d9d6"}}),Ft(Hr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Yo(Hr,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Yo(Hr,{sx:{minWidth:0},children:[Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Ft(Hr,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),Ft(Hr,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:k.get(E.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Yo(Hr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Qp(E.start_date)," ~"," ",Qp(E.end_date)]})]}),E.goal?Ft(Hr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Ft(Jp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:G4.map(L=>({value:L.value,label:L.label})),onChange:L=>{let $=String(L.target.value);if($==="closed"&&n){z(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),Ft(Kp,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Ft(K4,{sx:{fontSize:18}})}),Ft(Kp,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Ft(cr,{style:{width:16,height:16}})})]})]},E.seq))})})});return Yo(em,{children:[Ft(Gp,{open:e,onClose:l,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:i.length>0?Ft(Hu,{startIcon:Ft(U4,{}),onClick:()=>{p(),N(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:Ft(Hu,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),Ft(Vp,{open:q!==null,sprint:q,remainingTasks:T,sprints:b,onClose:()=>z(null),onConfirm:E=>{q&&n?.(q.seq,E),z(null)}}),Ft(Gp,{open:v,onClose:()=>{N(!1),p()},maxWidth:"sm",title:C>0?"\uBAA9\uD45C \uC218\uC815":"\uC0C8 \uBAA9\uD45C",locale:"ko",backdropClick:!1,tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-form",sections:[{id:"sprint-form",title:"",showTitle:!1,children:Ft(Hr,{sx:{pt:1},children:Yo(Hr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Ft(Jp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:i.map(E=>({value:E.key,label:E.label})),onChange:E=>d(String(E.target.value)),disabled:C>0}),Ft(Xp,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:f,onChange:E=>u(E.target.value)}),Ft(Zp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),Ft(Zp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>A(E.target.value)}),Ft(Xp,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:g,onChange:E=>m(E.target.value),sx:{gridColumn:"1 / -1"}})]})})}],actions:{showCancelButton:!0,right:Ft(Hu,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{Box as Jr,Button as om,Tooltip as Y4}from"@mui/material";import{FormDialog as X4}from"@ehfuse/mui-form-dialog";import Z4 from"@mui/icons-material/CalendarMonthOutlined";import J4 from"@mui/icons-material/FileUploadOutlined";import Q4 from"@mui/icons-material/FileDownloadOutlined";var Wu={google:{key:"google",name:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.google.com/calendar",defaultCalendarName:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > **URL\uB85C \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > **\uC124\uC815 \uBC0F \uACF5\uC720**\uB97C \uC5FD\uB2C8\uB2E4.","**\uCE98\uB9B0\uB354 \uD1B5\uD569** \uC139\uC158\uC758 **iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",buildSubscribeUrl:e=>`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(e.replace(/^https?:\/\//,"webcal://"))}`},apple:{key:"apple",name:"\uC560\uD50C \uCE98\uB9B0\uB354",homeUrl:"https://www.icloud.com/calendar",defaultCalendarName:"\uC560\uD50C \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uC544\uC774\uD3F0\xB7\uC544\uC774\uD328\uB4DC: **\uC124\uC815 > \uCE98\uB9B0\uB354 > \uACC4\uC815 > \uACC4\uC815 \uCD94\uAC00 > \uAE30\uD0C0 > \uAD6C\uB3C5 \uCE98\uB9B0\uB354 \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB9E5: \uCE98\uB9B0\uB354 \uC571 > **\uD30C\uC77C > \uC0C8\uB85C\uC6B4 \uCE98\uB9B0\uB354 \uAD6C\uB3C5**\uC5D0 \uBD99\uC5EC\uB123\uC2B5\uB2C8\uB2E4.","iCloud.com(\uC6F9)\uC5D0\uC11C\uB294 \uAD6C\uB3C5\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uAE30\uAE30\uC5D0\uC11C \uCD94\uAC00\uD558\uBA74 iCloud \uB85C \uB3D9\uAE30\uD654\uB429\uB2C8\uB2E4."],importSteps:["iCloud.com > \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354 \uC606 **\uACF5\uC720 \uC544\uC774\uCF58**\uC744 \uB204\uB985\uB2C8\uB2E4.","**\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB97C \uCF1C\uACE0 \uB098\uC624\uB294 **\uB9C1\uD06C\uB97C \uBCF5\uC0AC**\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694(webcal:// \uC8FC\uC18C\uB3C4 \uADF8\uB300\uB85C \uB429\uB2C8\uB2E4)."],importPlaceholder:"webcal://p00-calendars.icloud.com/published/\u2026",importWarning:"\uC560\uD50C\uC740 **\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB85C \uBC14\uAFD4\uC57C \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},naver:{key:"naver",name:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.naver.com",defaultCalendarName:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uB0B4 \uCE98\uB9B0\uB354** \uC606 **+** > **URL\uB85C \uAD6C\uB3C5\uD558\uAE30**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB124\uC774\uBC84\uAC00 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uB124\uC774\uBC84 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAD6C\uB3C5\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uCE98\uB9B0\uB354 \uC124\uC815**(\uD1B1\uB2C8)\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uB97C \uACE0\uB985\uB2C8\uB2E4.","**\uC678\uBD80 \uACF5\uAC1C** \uD56D\uBAA9\uC5D0\uC11C **\uCE98\uB9B0\uB354 \uACF5\uAC1C**\uB97C \uCCB4\uD06C\uD558\uBA74 \uB098\uC624\uB294 **iCal \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.naver.com/\u2026(iCal \uC8FC\uC18C)",importWarning:"\uB124\uC774\uBC84\uB294 **\uCE98\uB9B0\uB354\uB97C \uACF5\uAC1C**\uD574\uC57C iCal \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."}},tm=Object.values(Wu);function Al(e){return Wu[e??"google"]??Wu.google}import{jsx as dr,jsxs as Qi}from"react/jsx-runtime";function Mq({open:e,imports:h=[],onOpenExport:b,onOpenImport:l,onClose:o}){let s=Qi(Jr,{sx:{display:"flex",flexDirection:"column",gap:"24px"},children:[Qi(Jr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,color:"#37352f",display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uB0B4\uBCF4\uB0B4\uAE30"}),"\uB294 \uB0B4 \uC5C5\uBB34\uB97C \uB2E4\uB978 \uCE98\uB9B0\uB354\uC5D0\uC11C"," ",dr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uBCF4\uAC8C \uD569\uB2C8\uB2E4."]})}),dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uAC00\uC838\uC624\uAE30"}),"\uB294 \uADF8 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uACB9\uCCD0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."]})}),dr(Jr,{children:dr(Jr,{component:"span",children:"\uB450 \uBC29\uD5A5 \uBAA8\uB450 \uC6D0\uBCF8\uC744 \uACE0\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})})]}),dr(Jr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:tm.map((r,t)=>Qi(Jr,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.75,borderTop:t>0?"1px solid #f2f2f0":"none"},children:[dr(Z4,{sx:{fontSize:22,color:"#787774",flexShrink:0}}),Qi(Jr,{sx:{flex:1,minWidth:0},children:[dr(Jr,{sx:{fontSize:16,color:"#37352f"},children:r.name}),r.exportBlockedReason??r.importBlockedReason?dr(Jr,{sx:{fontSize:13.5,color:"#8a6d1d",mt:.25,lineHeight:1.6},children:r.exportBlockedReason??r.importBlockedReason}):null]}),dr(nm,{label:"\uB0B4\uBCF4\uB0B4\uAE30",icon:dr(J4,{sx:{fontSize:18}}),supported:r.exportSupported,reason:r.exportBlockedReason,onClick:()=>b(r.key)}),dr(nm,{label:rm(h,r.key)>0?`\uAC00\uC838\uC624\uAE30 (${rm(h,r.key)})`:"\uAC00\uC838\uC624\uAE30",icon:dr(Q4,{sx:{fontSize:18}}),supported:r.importSupported,reason:r.importBlockedReason,onClick:()=>l(r.key)})]},r.key))})]});return dr(X4,{open:e,onClose:o,width:680,title:"\uCE98\uB9B0\uB354 \uC5F0\uB3D9",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-link",sectionContentPaddingTop:0,sections:[{id:"calendar-link",showTitle:!1,children:s}],actions:{showCancelButton:!1,right:dr(om,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}function rm(e,h){return e.filter(b=>b.provider===h).length}function nm({label:e,icon:h,supported:b,reason:l,onClick:o}){let s=dr(Jr,{component:"span",sx:{flexShrink:0},children:dr(om,{size:"medium",variant:"outlined",startIcon:h,disabled:!b,onClick:o,sx:{minWidth:132,whiteSpace:"nowrap"},children:e})});return b?s:dr(Y4,{title:l??"\uC774 \uC11C\uBE44\uC2A4\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",arrow:!0,children:s})}import{useState as im}from"react";import{Box as xr,Button as Vu,Divider as r6,IconButton as n6,TextField as o6}from"@mui/material";import{FormDialog as i6}from"@ehfuse/mui-form-dialog";import s6 from"@mui/icons-material/OpenInNewOutlined";import a6 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as l6}from"@ehfuse/alerts";import{Fragment as e6}from"react";import{Fragment as t6,jsx as Uu}from"react/jsx-runtime";function qs({text:e}){let h=String(e??"").split("**");return Uu(t6,{children:h.map((b,l)=>l%2===1?Uu("b",{children:b},l):Uu(e6,{children:b},l))})}import{jsx as zt,jsxs as $s}from"react/jsx-runtime";function Uq({open:e,imports:h,provider:b,onRegister:l,onRemove:o,onClose:s}){let r=Al(b),[t,n]=im(""),[c,i]=im(!1),a=async()=>{let u=t.trim();if(u){i(!0);try{await l(u)&&n("")}finally{i(!1)}}},d=async u=>{await l6({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||r.defaultCalendarName}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&o(u.seq)},f=$s(xr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[$s(xr,{sx:{color:"#37352f",lineHeight:1.7},children:[r.name,"\uC758 \uC77C\uC815\uC744 ",zt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",zt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",zt("b",{children:"\uC678\uBD80 \uCE98\uB9B0\uB354 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),zt(xr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),h.length>0?zt(xr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:h.map((u,g)=>$s(xr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:g>0?"1px solid #efefed":"none"},children:[zt(a6,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),zt(xr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||r.defaultCalendarName}),zt(n6,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{d(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(cr,{sx:{fontSize:18}})})]},u.seq))}):zt(xr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),zt(r6,{sx:{my:1,borderColor:"#e6e6e3"}}),zt(xr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),$s(xr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[r.importSteps.map(u=>zt(xr,{children:zt(xr,{component:"span",children:zt(qs,{text:u})})},u)),zt(xr,{children:zt(xr,{component:"span",children:"\uB4F1\uB85D\uD55C \uC8FC\uC18C\uB294 \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),zt(xr,{children:zt(xr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})}),r.importWarning?zt(xr,{children:zt(xr,{component:"span",children:zt(qs,{text:r.importWarning})})}):null]}),$s(xr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[zt(o6,{value:t,onChange:u=>n(u.target.value),fullWidth:!0,label:"iCal \uC8FC\uC18C",placeholder:r.importPlaceholder,slotProps:{input:{spellCheck:!1}}}),zt(Vu,{variant:"contained",disabled:!t.trim()||c,onClick:()=>{a()},sx:{flexShrink:0},children:c?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return zt(i6,{open:e,onClose:s,width:680,title:`${r.name} \uAC00\uC838\uC624\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:f}],actions:{showCancelButton:!1,left:zt(Vu,{variant:"outlined",startIcon:zt(s6,{sx:{fontSize:16}}),onClick:()=>window.open(r.homeUrl,"_blank"),children:r.name}),right:zt(Vu,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{Box as xi,Button as Hs,TextField as c6}from"@mui/material";import{FormDialog as u6}from"@ehfuse/mui-form-dialog";import d6 from"@mui/icons-material/ContentCopyOutlined";import sm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as am}from"@ehfuse/alerts";import{Fragment as h6,jsx as Tr,jsxs as vi}from"react/jsx-runtime";function f6(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function t$({open:e,feed:h,feedTaskCount:b,provider:l,buildFeedUrl:o,onSubscribe:s,onClose:r}){let t=Al(l),n=o??f6,c=h.subscribed?n(h.token):"",i=()=>{navigator.clipboard.writeText(c).then(()=>am("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>am("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},a=()=>{let f=t.buildSubscribeUrl?.(c);f&&window.open(f,"_blank")},d=vi(xi,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[vi(xi,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Tr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C ",t.name,"\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?vi(xi,{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.",Tr("br",{}),Tr("b",{children:"\uB9C8\uAC10\uC608\uC815\uC774 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",h.subscribed?`${t.name}\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.`:"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):h.subscribed&&h.enabled?vi(h6,{children:[Tr(c6,{value:c,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),vi(xi,{sx:{display:"flex",gap:2},children:[Tr(Hs,{variant:"outlined",startIcon:Tr(d6,{}),onClick:i,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),t.buildSubscribeUrl?vi(Hs,{variant:"contained",startIcon:Tr(sm,{}),onClick:a,children:[t.name,"\uC5D0 \uCD94\uAC00"]}):null]}),vi(xi,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[t.subscribeSteps.map(f=>Tr(xi,{children:Tr("span",{children:Tr(qs,{text:f})})},f)),Tr(xi,{children:Tr("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."})})]})]}):Tr(Hs,{variant:"contained",onClick:s,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Tr(u6,{open:e,onClose:r,width:680,title:`${t.name}\uB85C \uB0B4\uBCF4\uB0B4\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:d}],actions:{showCancelButton:!1,left:Tr(Hs,{variant:"outlined",startIcon:Tr(sm,{sx:{fontSize:16}}),onClick:()=>window.open(t.homeUrl,"_blank"),children:t.name}),right:Tr(Hs,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{useEffect as p6,useMemo as Ku,useState as Gu}from"react";import{Box as Ws,Button as m6,Typography as g6}from"@mui/material";import{FormDialog as b6}from"@ehfuse/mui-form-dialog";import{SearchTextField as y6}from"@ehfuse/mui-form-controls";import{TreeView as x6}from"@ehfuse/tree-view";import{Fragment as T6,jsx as On,jsxs as C6}from"react/jsx-runtime";function lm(e){return`${e.name}#${e.seq}`}function v6(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function w6(e){let h=[],b=l=>{for(let o of l.employees??[])h.push(o);for(let o of l.groups??[])b(o)};for(let l of e)b(l);return h}function _6(e,h){return h?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(h)):!0}function k6(e){let h=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:lm(e),renderLabel:On(Ws,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:On(Ws,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:h})})}}function cm(e,h){let b=(e.groups??[]).map(o=>cm(o,h)).filter(o=>o!==null),l=(e.employees??[]).filter(o=>_6(o,h)).map(k6);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function S6({groups:e,allEmployees:h,initialSelectedSeqs:b,multiple:l,isMobile:o,onSelectionChange:s}){let[r,t]=Gu(""),n=Ku(()=>e.map(i=>cm(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),c=Ku(()=>h.filter(i=>b.includes(i.seq)).map(lm),[]);return C6(T6,{children:[On(Ws,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:On(y6,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),On(Ws,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:On(x6,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:i=>s(i.map(v6).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function u$({open:e,title:h="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:l,multiple:o=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let c=Lt(),[i,a]=Gu([]),[d,f]=Gu(0),u=Ku(()=>w6(l),[l]),g=s??[];p6(()=>{e&&(a(g),f(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>i.includes(_.seq));t(o?x:x.slice(0,1)),n()};return On(b6,{open:e,onClose:n,title:`${h}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:c,mobilePresentation:c?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:On(Ws,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:On(S6,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:c,onSelectionChange:a},d)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?On(g6,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:On(m6,{variant:"contained",onClick:m,children:r})}})}import{useEffect as Xk,useMemo as Wm,useState as Zs}from"react";import{Box as Mo,Button as Um}from"@mui/material";import{FormDialog as Zk}from"@ehfuse/mui-form-dialog";import{LabelSelect as od}from"@ehfuse/mui-form-controls";import Jk from"@mui/icons-material/SpeedOutlined";import{useEffect as B6,useState as I6}from"react";import{Box as Qr,Button as E6}from"@mui/material";import{FormDialog as M6}from"@ehfuse/mui-form-dialog";import{LabelSelect as R6,NumberField as um}from"@ehfuse/mui-form-controls";import O6 from"@ehfuse/overlay-scrollbar";import{jsx as Wr,jsxs as Us}from"react/jsx-runtime";var A6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function dm({open:e,capacity:h,employees:b,onClose:l,onSave:o}){let[s,r]=I6(h??io);B6(()=>{e&&r(h??io)},[e,h]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,i)=>{let a=Math.max(0,Math.floor(Number(i)||0));r(d=>{let f={...d.by_account};return a>0?f[c]=a:delete f[c],{...d,by_account:f}})};return Wr(M6,{open:e,onClose:l,maxWidth:"sm",title:"\uC778\uC6D0 \uC6A9\uB7C9",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-capacity",tabs:{visible:!1},actions:{showCancelButton:!0,right:Wr(E6,{variant:"contained",onClick:()=>{o(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:Us(Qr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Wr(Qr,{sx:{fontSize:15,color:"#37352f"},children:"\uD55C \uC0AC\uB78C\uC774 \uB3D9\uC2DC\uC5D0 \uC548\uC744 \uC218 \uC788\uB294 \uC591\uC744 \uC815\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC744 \uB118\uAE30\uBA74 \uC6CC\uD06C\uB85C\uB4DC \uCC28\uD2B8\uC5D0\uC11C \uBD89\uAC8C \uD45C\uC2DC\uB429\uB2C8\uB2E4. 0 \uC73C\uB85C \uB450\uBA74 \uC6A9\uB7C9\uC744 \uC4F0\uC9C0 \uC54A\uACE0 \uD300 \uD3C9\uADE0\uC744 \uAE30\uC900\uC73C\uB85C \uBD05\uB2C8\uB2E4."}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Wr(R6,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:A6,onChange:c=>r(i=>({...i,basis:c.target.value}))})]}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Wr(um,{size:"medium",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,value:s.default_capacity,onValueChange:c=>r(i=>({...i,default_capacity:Math.max(0,Math.floor(Number(c)||0))}))})]}),Wr(Qr,{sx:{pl:"119px",mt:-1.25,fontSize:13.5,color:"#37352f"},children:`\uC804\uC6D0 \uACF5\uD1B5 \uAE30\uC900(${t}) \xB7 0 = \uC6A9\uB7C9 \uC548 \uC500`}),Wr(Qr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Wr(Qr,{sx:{fontSize:15,color:"#787774"},children:"\uC9C1\uC6D0 \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uAE30\uBCF8 \uC6A9\uB7C9\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."}):Wr(Qr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Wr(O6,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Us(Qr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Wr(Qr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Wr(Qr,{sx:{width:132,flexShrink:0},children:Wr(um,{size:"small",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,clearWhenZero:!0,value:s.by_account[Number(c.account_seq)]??0,onValueChange:i=>n(Number(c.account_seq),String(i??""))})})]},c.account_seq))})})]})}]})}import{Box as Pl}from"@mui/material";import{Bar as L6,BarChart as j6,CartesianGrid as z6,Cell as F6,ReferenceLine as q6,ResponsiveContainer as $6,Tooltip as H6,XAxis as W6,YAxis as U6}from"recharts";import{Box as D6}from"@mui/material";import{jsx as P6}from"react/jsx-runtime";function Ur({text:e,height:h}){return P6(D6,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof h=="number"?{height:h,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}import{createElement as N6}from"react";var Dl="#2f80ed",fm="#a9c9f5",wi="#9a9a97",Yu="#2e9e6b",Jn="#3d7eff",Xu="#c3c8ce",Vs="#f2a30f",Ks={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},es={...Ks,cursor:!1},ts={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>N6("span",{style:{paddingRight:14,color:"#37352f"}},e)};function fr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var Dr={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function Qn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as An,jsxs as Gs}from"react/jsx-runtime";function V6(e,h){let b=h.filter(l=>l.sprint_seq===e.seq&&!l.archived&&l.completed);return{points:b.reduce((l,o)=>l+(o.story_points??0),0),count:b.length}}function hm({sprints:e,tasks:h,height:b=200}){let o=[...e].sort((i,a)=>`${i.start_date}|${i.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(i=>({sprint:i,...V6(i,h)})),s=o.some(i=>i.points>0),r=s?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>s?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,a)=>i+a,0)/t.length*10)/10:null,c=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?An(Ur,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Gs(Pl,{sx:fr(b),children:[Gs(Pl,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Gs("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Gs("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",An(Pl,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),An(Pl,{sx:Qn(b),children:An($6,{width:"100%",height:"100%",children:Gs(j6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[An(z6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),An(W6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),An(U6,{tick:{fontSize:13},width:40,allowDecimals:!1}),An(H6,{...es,formatter:i=>`${Number(i??0)}${r}`}),n!==null?An(q6,{y:n,stroke:wi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,An(L6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(i=>An(F6,{fill:i.closed?Dl:fm},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as K6}from"react";import{Box as eo}from"@mui/material";import{CartesianGrid as G6,Line as pm,LineChart as Y6,ResponsiveContainer as X6,Tooltip as Z6,XAxis as J6,YAxis as Q6}from"recharts";import{jsx as en,jsxs as Xo}from"react/jsx-runtime";function mm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function ek(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function tk(e){return e.slice(5).replace("-",".")}function gm({sprint:e,tasks:h,todayStr:b,height:l=200,headerLeft:o}){let s=K6(()=>{let a=mm(e.start_date),d=mm(e.end_date);if(!a||!d||d<a||Math.round((d.getTime()-a.getTime())/864e5)+1>366)return null;let u=h.filter(P=>P.sprint_seq===e.seq&&!P.archived);if(u.length===0)return{empty:!0};let g=u.some(P=>(P.story_points??0)>0),m=P=>g?P.story_points??0:1,x=u.reduce((P,N)=>P+m(N),0),_=new Map;for(let P of u){if(!P.completed)continue;let N=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(N)?N:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=d;P.setDate(P.getDate()+1))B.push(ek(P));let A=x,j=x;return{empty:!1,data:B.map((P,N)=>{let q=B.length===1?0:x*(1-N/(B.length-1));return P<=b&&(A-=_.get(P)??0,j=Math.max(0,A)),{\uB0A0\uC9DC:tk(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,A):null}}),total:x,usePoints:g,last:j}},[e,h,b]);if(!s)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:l})]});if(s.empty)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]});let{data:r,total:t,usePoints:n,last:c}=s,i=n?"SP":"\uAC74";return Xo(eo,{sx:fr(l),children:[Xo(eo,{sx:Dr,children:[o?en(eo,{sx:{flexShrink:0},children:o}):null,Xo(eo,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Xo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Xo("span",{children:["\uD604\uC7AC"," ",en(eo,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),i," \uB0A8\uC74C"]})]})]}),en(eo,{sx:Qn(l),children:en(X6,{width:"100%",height:"100%",children:Xo(Y6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[en(G6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),en(J6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),en(Q6,{tick:{fontSize:13},width:40,allowDecimals:!1}),en(Z6,{...Ks,formatter:a=>`${Number(a??0)}${i}`}),en(pm,{type:"linear",dataKey:"\uC774\uC0C1",stroke:wi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),en(pm,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Dl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as km}from"react";import{Box as to}from"@mui/material";import{Area as Qu,AreaChart as ik,CartesianGrid as sk,Legend as ak,ResponsiveContainer as lk,Tooltip as ck,XAxis as uk,YAxis as dk}from"recharts";function Io(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function Nl(e,h=new Date){let b=new Date(h);return b.setMonth(b.getMonth()-e),b}function z$(e=new Date){return{fromDate:Io(Nl(1,e)),toDate:Io(e)}}var Ju=864e5,Ys=[0,1,2,3,5,8,13,21];function xm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Zu(e){let h=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(h);if(!b)return null;let l=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(l)?null:l}function rs(e){let h=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(h)?h.slice(0,10):""}function rk(e){let h=rs(e.created_time)||rs(e.start_date)||rs(e.completed_time);if(!h)return null;let b=rs(e.start_date),l=b&&b>h?b:h,o=e.completed?rs(e.completed_time)||h:"";return{created:h,started:l,done:o}}function vm(e,h){let b=/^\d{4}-\d{2}-\d{2}$/.test(h)?new Date(`${h}T00:00:00`):new Date,l=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let s=l-1;s>=0;s-=1)o.push(Io(new Date(b.getTime()-s*Ju)));return o}function wm(e,h,b){let l=vm(h,b),o=e.filter(xm).map(rk).filter(n=>n!==null),s=l.map(n=>{let c=0,i=0,a=0;for(let d of o)d.created>n||(d.done&&d.done<=n?c+=1:d.started<=n?i+=1:a+=1);return{day:n,done:c,inProgress:i,waiting:a}}),r=s[s.length-1],t=s.reduce((n,c)=>Math.max(n,c.done+c.inProgress+c.waiting),0);return{points:s,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function nk(e,h){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*h)-1));return e[b]}function bm(e){if(e.length===0)return null;let h=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,l=Math.floor(h.length/2),o=h.length%2===1?h[l]:(h[l-1]+h[l])/2;return{count:h.length,median:b(o),average:b(h.reduce((s,r)=>s+r,0)/h.length),p85:b(nk(h,.85))}}function ym(e){for(let h=Ys.length-1;h>=0;h-=1)if(e>=Ys[h])return h;return 0}function ok(){return Ys.map((e,h)=>h===Ys.length-1?`${e}\uC77C+`:`${e}~${Ys[h+1]}\uC77C`)}function _m(e,h,b){let l=vm(h,b),o=l[0],s=l[l.length-1],r=ok(),t=r.map(()=>0),n=r.map(()=>0),c=[],i=[];for(let a of e){if(!xm(a)||!a.completed)continue;let d=rs(a.completed_time);if(!d||d<o||d>s)continue;let f=Zu(a.completed_time),u=Zu(a.created_time);if(f===null||u===null)continue;let g=Math.max(0,(f-u)/Ju);c.push(g),t[ym(g)]+=1;let m=Zu(a.start_date);if(m===null||m>f)continue;let x=Math.max(0,(f-Math.max(m,u))/Ju);i.push(x),n[ym(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:bm(c),cycle:bm(i)}}import{jsx as Vr,jsxs as Zo}from"react/jsx-runtime";function fk(e){return e.slice(5).replace("-",".")}function Sm({tasks:e,todayStr:h,days:b=30,height:l=220,headerLeft:o}){let s=km(()=>wm(e,b,h),[e,b,h]),r=km(()=>s.points.map(n=>({\uB0A0\uC9DC:fk(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Zo(to,{sx:Dr,children:[o?Vr(to,{sx:{flexShrink:0},children:o}):null,Zo(to,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Zo(to,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Zo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Zo("span",{children:["\uC9C4\uD589 \uC911"," ",Vr(to,{component:"span",sx:{color:Jn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Vr(to,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||s.max===0?Zo(to,{sx:fr(l),children:[o?Vr(to,{sx:Dr,children:o}):null,Vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Zo(to,{sx:fr(l),children:[t,Vr(to,{sx:Qn(l),children:Vr(lk,{width:"100%",height:"100%",children:Zo(ik,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Vr(sk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Vr(uk,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Vr(dk,{tick:{fontSize:13},width:40,allowDecimals:!1}),Vr(ck,{...Ks,formatter:n=>`${Number(n??0)}\uAC74`}),Vr(ak,{...ts}),Vr(Qu,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Yu,fill:Yu,fillOpacity:.9}),Vr(Qu,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Jn,fill:Jn,fillOpacity:.85}),Vr(Qu,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Xu,fill:Xu,fillOpacity:.9})]})})})]})}import{useMemo as Tm}from"react";import{Box as tn}from"@mui/material";import{Bar as Cm,BarChart as hk,CartesianGrid as pk,Legend as mk,ResponsiveContainer as gk,Tooltip as bk,XAxis as yk,YAxis as xk}from"recharts";import{jsx as vr,jsxs as xn}from"react/jsx-runtime";function Bm({label:e,color:h,summary:b}){let l=xn(tn,{sx:{display:"flex",alignItems:"center",gap:.75},children:[vr(tn,{sx:{width:10,height:10,borderRadius:.5,bgcolor:h,flexShrink:0}}),vr(tn,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?xn(tn,{sx:{display:"contents"},children:[l,xn("span",{children:[b.count,"\uAC74"]}),xn("span",{children:["\uC911\uC559\uAC12"," ",vr(tn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),xn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),xn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):xn(tn,{sx:{display:"contents"},children:[l,vr(tn,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Im({tasks:e,todayStr:h,days:b=30,height:l=200,headerLeft:o}){let s=Tm(()=>_m(e,b,h),[e,b,h]),r=Tm(()=>s.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:s.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:s.cycleCounts[n]})),[s]);return s.lead?xn(tn,{sx:fr(l),children:[xn(tn,{sx:Dr,children:[o?vr(tn,{sx:{flexShrink:0},children:o}):null,xn(tn,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:3,rowGap:.5,fontSize:14,color:"#000"},children:[vr(Bm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Jn,summary:s.lead}),vr(Bm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Vs,summary:s.cycle})]})]}),vr(tn,{sx:Qn(l),children:vr(gk,{width:"100%",height:"100%",children:xn(hk,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[vr(pk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),vr(yk,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),vr(xk,{tick:{fontSize:13},width:40,allowDecimals:!1}),vr(bk,{...es,formatter:t=>`${Number(t??0)}\uAC74`}),vr(mk,{...ts}),vr(Cm,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Jn,radius:[3,3,0,0]}),vr(Cm,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Vs,radius:[3,3,0,0]})]})})})]}):xn(tn,{sx:fr(l),children:[o?vr(tn,{sx:Dr,children:o}):null,vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as Om}from"react";import{Box as _i}from"@mui/material";import{Bar as td,BarChart as Sk,CartesianGrid as Tk,Cell as Ck,Legend as Bk,ReferenceLine as Am,ResponsiveContainer as Ik,Tooltip as Ek,XAxis as Mk,YAxis as Rk}from"recharts";function vk(e,h){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return null;let b=new Date(`${e}T00:00:00`).getTime(),l=new Date(`${h}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(l)?null:Math.round((l-b)/864e5)}function wk(e,h,b){let l=String(e.due_date??"").slice(0,10),o=vk(h,l);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function Ll(e,h){let{todayStr:b,soonDays:l=7,includeUnassigned:o=!0,limit:s,capacity:r}=h,t=r??io,n=new Map;for(let i of e){if(i.completed||i.archived||i.is_notice||i.is_event||i.linked_only)continue;let a=Number(i.manager_account_seq??0);if(!a&&!o)continue;let d=a?String(i.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",f=n.get(a)??{accountSeq:a,name:d,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};f[wk(i,b,l)]+=1,f.total+=1,f.points+=Number(i.story_points??0)||0,n.set(a,f)}for(let i of n.values())i.capacity=_k(i.accountSeq,t),i.load=t.basis==="points"?i.points:i.total,i.ratio=i.capacity>0?i.load/i.capacity:0;let c=[...n.values()].sort((i,a)=>i.accountSeq===0!=(a.accountSeq===0)?i.accountSeq===0?1:-1:i.overdue!==a.overdue?a.overdue-i.overdue:i.total!==a.total?a.total-i.total:i.name.localeCompare(a.name));return typeof s=="number"&&s>0?c.slice(0,s):c}function jl(e,h){return e.filter(b=>b.completed||b.archived||b.is_notice||b.is_event||b.linked_only?!1:Number(b.manager_account_seq??0)===h).sort((b,l)=>{let o=String(b.due_date??"").slice(0,10),s=String(l.due_date??"").slice(0,10);return!o!=!s?o?-1:1:o!==s?o.localeCompare(s):String(b.title??"").localeCompare(String(l.title??""))})}function _k(e,h){if(!(e>0))return 0;let b=Math.max(0,Math.floor(Number(h.by_account?.[e])||0));return b>0?b:Math.max(0,Math.floor(Number(h.default_capacity)||0))}function zl(e){return e.capacity>0&&e.load>e.capacity}function Em(e,h){return h>0&&e.total>=h}function Mm(e){let h=e.filter(b=>b.accountSeq>0);return h.length===0?0:h.reduce((b,l)=>b+l.total,0)/h.length}function ed(e,h){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+h);let l=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${l(b.getMonth()+1)}-${l(b.getDate())}`}function kk(e){let h=new Date(`${e}T00:00:00`);if(Number.isNaN(h.getTime()))return e;let b=(h.getDay()+6)%7;return ed(e,-b)}function Rm(e,h){let{todayStr:b,includeUnassigned:l=!0,weeks:o=6,limit:s}=h,r=kk(b),t=Array.from({length:Math.max(1,o)},(f,u)=>{let g=ed(r,u*7),m=ed(g,6),[,x,_]=g.split("-");return{start:g,end:m,label:`${Number(x)}/${Number(_)}`,isCurrent:u===0}}),n=t[t.length-1].end,c=new Map;for(let f of e){if(f.completed||f.archived||f.is_notice||f.is_event||f.linked_only)continue;let u=Number(f.manager_account_seq??0);if(!u&&!l)continue;let g=u?String(f.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=c.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},x=String(f.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(x))m.noDue+=1;else if(x<b)m.overdue+=1;else if(x>n)m.beyond+=1;else{let _=t.findIndex(B=>x>=B.start&&x<=B.end);_>=0?m.byWeek[_]+=1:m.beyond+=1}c.set(u,m)}let i=[...c.values()].sort((f,u)=>f.accountSeq===0!=(u.accountSeq===0)?f.accountSeq===0?1:-1:f.overdue!==u.overdue?u.overdue-f.overdue:f.total!==u.total?u.total-f.total:f.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?i.slice(0,s):i,d=a.reduce((f,u)=>Math.max(f,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:d}}import{Fragment as Dm,jsx as wr,jsxs as Jo}from"react/jsx-runtime";var Xs="#e5484d";function Pm({tasks:e,todayStr:h,soonDays:b=7,overloadThreshold:l=0,capacity:o=io,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=Om(()=>Ll(e,{todayStr:h,soonDays:b,capacity:o}),[e,h,b,o]),i=Om(()=>Mm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(i*1.5)),d=o.default_capacity>0||Object.keys(o.by_account).length>0,f=o.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(d?zl(g):Em(g,a))).length;return c.length===0?Jo(_i,{sx:fr(s),children:[r?wr(_i,{sx:Dr,children:r}):null,wr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Jo(_i,{sx:fr(s),children:[Jo(_i,{sx:Dr,children:[r,Jo(_i,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",wr("b",{children:i.toFixed(1)}),"\uAC74 \xB7"," ",d?Jo(Dm,{children:["\uC6A9\uB7C9 ",wr("b",{children:o.default_capacity||"\uAC1C\uC778\uBCC4"}),o.default_capacity?f:""]}):Jo(Dm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",wr("b",{children:a}),"\uAC74"]}),u>0?Jo(_i,{component:"span",sx:{ml:1,color:Xs,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),wr(_i,{sx:Qn(s),children:wr(Ik,{width:"100%",height:"100%",children:Jo(Sk,{data:c,layout:"vertical",onClick:n?g=>{let m=c.find(x=>x.name===String(g?.activeLabel??""));m&&n(m.accountSeq===t?0:m.accountSeq)}:void 0,style:n?{cursor:"pointer"}:void 0,margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:c.length>8?4:10,children:[wr(Tk,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),wr(Mk,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),wr(Rk,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),wr(Ek,{...es,formatter:(g,m)=>[`${Number(g)||0}\uAC74`,String(m)],labelFormatter:g=>{let m=c.find(x=>x.name===g);return!m||!(m.capacity>0)?String(g):`${g} \u2014 \uC6A9\uB7C9 ${m.capacity}${f} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),wr(Bk,{...ts}),i>0?wr(Am,{x:i,stroke:wi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:wi}}):null,o.default_capacity>0?wr(Am,{x:o.default_capacity,stroke:Xs,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Xs}}):null,wr(td,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Xs}),wr(td,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Vs}),wr(td,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Jn,radius:[0,3,3,0],children:c.map(g=>wr(Ck,{fill:d&&zl(g)?Xs:Jn,fillOpacity:d&&zl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as zk,useState as Fk}from"react";import{Box as qk,Button as $k}from"@mui/material";import{FormDialog as Hk}from"@ehfuse/mui-form-dialog";import{useState as Ok}from"react";import{Box as hr,Button as Ak,Menu as Dk,MenuItem as Pk}from"@mui/material";import Nk from"@mui/icons-material/PersonOutlineOutlined";import Lk from"@ehfuse/overlay-scrollbar";import{jsx as Cr,jsxs as Eo}from"react/jsx-runtime";var Nm=56,Lm=68,jm=96;function jk(e){let h=String(e.due_date??"").slice(0,10);return h?h.slice(5).replace("-","/"):"-"}function zm(e,h){let b=String(e.due_date??"").slice(0,10);return!!b&&b<h}function Fm({tasks:e,row:h,todayStr:b,employees:l,rows:o,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,i]=Ok(null),a=jl(e,h.accountSeq),d=f=>o.find(u=>u.accountSeq===f)?.total??0;return Eo(hr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Cr(hr,{component:"span",sx:{fontWeight:700},children:h.name}),Eo(hr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),h.capacity>0?Eo(hr,{component:"span",sx:{color:h.load>h.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",h.capacity," \uC911 ",h.load]}):null]}),Eo(hr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,flexShrink:0,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0},children:"\uB9C8\uAC10"}),Cr(hr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Cr(hr,{sx:{width:Lm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Cr(hr,{sx:{width:jm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Cr(hr,{sx:{flex:1,minHeight:0},children:Cr(Lk,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Cr(hr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(f=>Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0,fontSize:13.5,color:zm(f,b)?"#e5484d":"#787774",fontWeight:zm(f,b)?700:400},children:jk(f)}),Cr(hr,{onClick:n?()=>n(f.seq):void 0,sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{cursor:"pointer","&:hover":{textDecoration:"underline"}}:{}},children:f.title}),Cr(hr,{sx:{width:Lm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Lr,{priority:f.priority})}),t?Cr(hr,{sx:{width:jm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Ak,{size:"small",variant:"outlined",startIcon:Cr(Nk,{sx:{fontSize:17}}),onClick:u=>i({el:u.currentTarget,taskSeq:f.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},f.seq))})})]}),Cr(Dk,{anchorEl:c?.el??null,open:!!c,onClose:()=>i(null),transitionDuration:0,children:l.filter(f=>Number(f.account_seq)>0&&Number(f.account_seq)!==h.accountSeq).map(f=>Eo(Pk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(f.account_seq),f.name),i(null)},sx:{fontSize:14,minWidth:200},children:[Cr(hr,{sx:{flex:1},children:f.name}),Eo(hr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[d(Number(f.account_seq)),"\uAC74"]})]},f.account_seq))})]})}import{jsx as Fl}from"react/jsx-runtime";function qm({open:e,row:h,rows:b,tasks:l,todayStr:o,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,i]=Fk(h);zk(()=>{h&&i(h)},[h]);let a=h??c,d=a?jl(l,a.accountSeq).length:0;return Fl(Hk,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${d})`:"\uC5C5\uBB34",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-person",tabs:{visible:!1},actions:{showCancelButton:!1,right:Fl($k,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Fl(qk,{sx:{minHeight:0},children:a?Fl(Fm,{tasks:l,row:a,rows:b,todayStr:o,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as Wk}from"react";import{Box as ln,Tooltip as Uk}from"@mui/material";import{OverlayScrollbar as Vk}from"@ehfuse/overlay-scrollbar";import{jsx as Kr,jsxs as $l}from"react/jsx-runtime";var $m="#e5484d",Kk="#2f80ed",Gk="#9a9a97",rd=30,Yk=96,ql=56;function nd({count:e,max:h,color:b,title:l}){let o=e>0&&h>0?.18+e/h*.72:0;return Kr(Uk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Kr(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function Hm({tasks:e,todayStr:h,weeks:b=6,height:l=200}){let o=Wk(()=>Rm(e,{todayStr:h,weeks:b}),[e,h,b]);if(o.rows.length===0)return Kr(ln,{sx:fr(l),children:Kr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${Yk}px ${ql}px repeat(${o.weeks.length}, minmax(${ql}px, 1fr)) ${ql}px ${ql}px`,r={height:rd,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Kr(ln,{sx:fr(l),children:Kr(Vk,{style:{height:"100%"},thumb:{width:8},children:$l(ln,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${rd}px repeat(${o.rows.length}, minmax(${rd}px, 1fr))`},children:[Kr(ln,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Kr(ln,{sx:{...r,color:$m},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Kr(ln,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Kr(ln,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Kr(ln,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>$l(ln,{sx:{display:"contents"},children:[Kr(ln,{sx:{display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Kr(nd,{count:t.overdue,max:o.maxCell,color:$m,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Kr(nd,{count:n,max:o.maxCell,color:Kk,title:`${t.name} \xB7 ${o.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[c].start)),Kr(nd,{count:t.noDue,max:o.maxCell,color:Gk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),$l(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?$l(ln,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Vm,jsx as Zt,jsxs as Hl}from"react/jsx-runtime";var Km="min(560px, 62vh)",Qk=`calc(${Km} - 4px)`,e8=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function nW({open:e,sprints:h,tasks:b,todayStr:l,showSprintCharts:o,capacity:s=io,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:i=0,onClose:a}){let[d,f]=Zs(0),[u,g]=Zs(30);Xk(()=>{if(!e)return;let y=h.find(w=>w.status==="active")??h[0],v=h.find(w=>w.seq===i)??y;f(v?.seq??0)},[e]);let m=Wm(()=>h.find(y=>y.seq===d)??null,[h,d]),x={height:Qk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Zt(od,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:d?String(d):"",options:h.map(y=>({value:String(y.seq),label:mn(y)})),onChange:y=>f(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,A]=Zs("distribution"),j=Zt(od,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:B,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:y=>A(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Zs(!1),[N,q]=Zs(0),z=Wm(()=>Ll(b,{todayStr:l,capacity:s}),[b,l,s]),T=z.find(y=>y.accountSeq===N)??null,C=Hl(Vm,{children:[j,t?Zt(Um,{size:"small",variant:"outlined",startIcon:Zt(Jk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),R=o??h.length>0,p=Zt(od,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:e8,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Hl(Vm,{children:[Zt(Zk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Km,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...R?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Zt(Mo,{sx:x,children:Zt(hm,{sprints:h,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Zt(Mo,{sx:x,children:m?Zt(gm,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Hl(Mo,{sx:fr("100%"),children:[Zt(Mo,{sx:Dr,children:_}),Zt(Ur,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:Zt(Mo,{sx:x,children:Zt(Sm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:Zt(Mo,{sx:x,children:B==="timeline"?Hl(Mo,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Zt(Mo,{sx:Dr,children:C}),Zt(Hm,{tasks:b,todayStr:l,height:"100%"})]}):Zt(Pm,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:N,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Zt(Mo,{sx:x,children:Zt(Im,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}],actions:{showCancelButton:!1,right:Zt(Um,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Zt(qm,{open:N>0,row:T,rows:z,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Zt(dm,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as t8,Divider as r8,Menu as n8,MenuItem as id}from"@mui/material";import{jsx as Js,jsxs as Gm}from"react/jsx-runtime";function lW({anchorEl:e,candidates:h,selectedNames:b,avatarSrcByName:l,onToggle:o,onClear:s,onClose:r}){return Gm(n8,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[h.length===0?Js(id,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):h.map(t=>{let n=b.includes(t.name);return Gm(id,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Js(t8,{size:"small",checked:n,sx:{p:0}}),Js(jr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Js(r8,{}),Js(id,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as o8}from"react";import{ButtonBase as i8,Menu as s8,MenuItem as a8}from"@mui/material";import l8 from"@mui/icons-material/KeyboardArrowDown";import c8 from"@mui/icons-material/Check";import{Fragment as u8,jsx as sd,jsxs as ad}from"react/jsx-runtime";function gW({value:e,onChange:h,options:b}){let[l,o]=o8(null),s=b??vc,r=vc.find(t=>t.value===e)?.label??"";return ad(u8,{children:[ad(i8,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,sd(l8,{sx:{fontSize:17,color:"#9a9a97"}})]}),sd(s8,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>o(null),children:s.map(t=>ad(a8,{selected:t.value===e,onClick:()=>{h(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?sd(c8,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Wl,ButtonBase as d8}from"@mui/material";import{DateTextField as Ym}from"@ehfuse/mui-form-controls";import{jsx as Qs,jsxs as Xm}from"react/jsx-runtime";var f8=[{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 Zm({fromDate:e,toDate:h,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Io(Nl(s)),Io(new Date))},o=s=>s<=0?!e&&!h:!e||!h?!1:e===Io(Nl(s))&&h===Io(new Date);return Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Qs(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5},children:f8.map(s=>{let r=o(s.months);return Qs(d8,{onClick:()=>l(s.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:s.label},s.label)})}),Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Qs(Ym,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,h),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Qs(Wl,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Qs(Ym,{value:h,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:s=>b(e,s.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as h8}from"@mui/material";import{jsx as Jm}from"react/jsx-runtime";function CW({anchorEl:e,fromDate:h,toDate:b,onChange:l,onClose:o}){return Jm(h8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Jm(Zm,{fromDate:h,toDate:b,onChange:l})})}import{Box as p8,ButtonBase as m8,Tab as g8,Tabs as b8}from"@mui/material";import y8 from"@mui/icons-material/Checklist";import x8 from"@mui/icons-material/Face";import v8 from"@mui/icons-material/Publish";import w8 from"@mui/icons-material/NotificationsOutlined";import _8 from"@mui/icons-material/BugReportOutlined";import k8 from"@mui/icons-material/DescriptionOutlined";import S8 from"@mui/icons-material/Inventory2Outlined";import{jsx as Dn}from"react/jsx-runtime";function Qm(e,h){return h>0?`${e} (${h})`:e}var zW=[{id:"my",label:"\uC804\uCCB4",icon:Dn(y8,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Dn(x8,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Dn(v8,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Dn(_8,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Dn(w8,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Dn(S8,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Dn(k8,{sx:{fontSize:18}}),hideCount:!0}];function T8(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 FW({items:e,activeTab:h,counts:b,onChange:l,compact:o=!1}){let s=ct(),r=T8(s.tabs),t=e;return o?Dn(p8,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=h===n.id;return Dn(m8,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:kr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:c?s.tabs.selectedBg:s.tabs.bg,color:c?s.tabs.selectedColor:s.tabs.color,borderColor:c?s.tabs.selectedBg:s.tabs.borderColor},children:Qm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):Dn(b8,{value:h,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>Dn(g8,{value:n.id,label:Qm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as C8,useMemo as B8,useState as ld}from"react";import{Divider as Ul,ListItemIcon as Gr,Menu as cd,MenuItem as _r}from"@mui/material";import I8 from"@mui/icons-material/OpenInNewOutlined";import E8 from"@mui/icons-material/RestoreFromTrashOutlined";import M8 from"@mui/icons-material/Check";import R8 from"@mui/icons-material/CheckCircleOutlined";import O8 from"@mui/icons-material/RadioButtonUnchecked";import A8 from"@mui/icons-material/SendOutlined";import D8 from"@mui/icons-material/EventOutlined";import P8 from"@mui/icons-material/PersonOutlineOutlined";import N8 from"@mui/icons-material/ViewKanbanOutlined";import L8 from"@mui/icons-material/ContentCopyOutlined";import j8 from"@mui/icons-material/NextPlanOutlined";import z8 from"@mui/icons-material/ContentPasteOutlined";import F8 from"@mui/icons-material/ShareOutlined";import q8 from"@mui/icons-material/DirectionsRunOutlined";import e0 from"@mui/icons-material/ChevronRight";import $8 from"@mui/icons-material/ArchiveOutlined";import H8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as t0}from"@ehfuse/alerts";import{Fragment as r0,jsx as ut,jsxs as pr}from"react/jsx-runtime";function yU({target:e,onClose:h,customTabs:b,sprints:l=[],myAccountSeq:o=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:c,onMemberEdit:i,onMoveProject:a,onDuplicate:d,onCreateFollowUp:f,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let A=Lt(),j=Nn(),[D,P]=ld(null),[N,q]=ld(null),[z,T]=ld(null);C8(()=>{e||(P(null),q(null),T(null))},[e]);let C=e?.task??null,R=!!C?.is_notice,p=!!C?.is_event,y=C?!lo(C,o):!1,v=!!C?.deleted,w=B8(()=>new Set(b.filter(L=>L.useSprints).map(L=>L.key)),[b]),k=async(L="one")=>{let $=C;if(h(),!$)return;await t0({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:L==="series"?`"${$.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${$.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&x($.seq,L)},S=async()=>{let L=C;if(h(),!L)return;await t0({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${L.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(L.seq)},E=()=>{C&&m(C.seq,!C.archived),h()};return pr(r0,{children:[pr(cd,{open:!!e,onClose:h,transitionDuration:0,anchorReference:A?"none":"anchorPosition",anchorPosition:!A&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...A?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:A?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[pr(_r,{onClick:()=>{C&&s(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(I8,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut(Ul,{}):null,v&&_?pr(_r,{onClick:()=>{C&&_(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(E8,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?pr(_r,{onClick:()=>{S()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:pr(r0,{children:[pr(_r,{disabled:R?(C?.author_account_seq??0)!==o:(C?.author_account_seq??0)!==o&&(C?.manager_account_seq??0)!==o,onClick:()=>{C&&r(C.seq,!C.completed),h()},sx:{fontSize:14},children:[ut(Gr,{children:C?.completed?ut(O8,{sx:{fontSize:19}}):ut(R8,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!R&&t?pr(_r,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(A8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,p?null:ut(Ul,{}),p?null:pr(_r,{disabled:y,onClick:L=>{C&&P({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(D8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC608\uC815 \uBCC0\uACBD"]}),!R&&!p&&i?pr(_r,{onClick:()=>{C&&i(C,"manager"),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(P8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,p?null:pr(_r,{disabled:y,onClick:L=>{C&&q({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(N8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut(Ul,{}),d?pr(_r,{disabled:y,onClick:()=>{C&&d(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(L8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,f&&C&&!C.is_event&&!C.is_notice?pr(_r,{onClick:()=>{C&&f(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(j8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,pr(_r,{onClick:()=>{C&&(u?u(C):Ki(C,A)),h()},sx:{fontSize:14},children:[ut(Gr,{children:A?ut(F8,{sx:{fontSize:19}}):ut(z8,{sx:{fontSize:19}})}),A?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?pr(_r,{onClick:L=>T(L.currentTarget),sx:{fontSize:14},children:[ut(Gr,{children:ut(q8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,pr(_r,{onClick:E,disabled:y||!C?.archived&&!(C&&Ta(C)),sx:{fontSize:14},children:[ut(Gr,{children:C?.archived?ut(H8,{sx:{fontSize:19}}):ut($8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut(Ul,{}),pr(_r,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),(C?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(C?.repeat_group_key??0)>0?pr(_r,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(pn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminders:zn(D?.task),hideReminder:!!D?.task.completed,centered:A,onClose:()=>{P(null),h()},onDateChange:L=>{D&&n(D.task.seq,L)},onReminderChange:L=>{D&&c?.(D.task.seq,L)}}),pr(cd,{transitionDuration:0,anchorEl:N?.anchorEl??null,open:!!N,onClose:()=>{q(null),h()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(_r,{selected:!N?.task.tab_key,onClick:()=>{N&&a(N.task.seq,""),q(null),h()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(L=>!L.archived).map(L=>ut(_r,{selected:N?.task.tab_key===L.key,onClick:()=>{N&&a(N.task.seq,L.key),q(null),h()},sx:{fontSize:14,minWidth:170},children:L.label},L.key))]}),ut(cd,{transitionDuration:0,anchorEl:z,open:!!z,onClose:()=>T(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(L=>`custom-${L.group_seq}`===String(C?.tab_key??"")).map(L=>({seq:L.seq,label:mn(L)}))].map(L=>pr(_r,{onClick:()=>{C&&g?.(C.seq,L.seq),T(null),h()},sx:{fontSize:14,minWidth:160,gap:1},children:[L.label,(C?.sprint_seq??0)===L.seq?ut(M8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},L.seq))})]})}import{Checkbox as W8,Divider as U8,Menu as V8,MenuItem as n0}from"@mui/material";import{jsx as Vl,jsxs as o0}from"react/jsx-runtime";function kU({anchorEl:e,labelOptions:h,selectedKeys:b,onToggle:l,onClear:o,onClose:s}){return o0(V8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[h.map(r=>{let t=b.includes(r.key);return o0(n0,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Vl(W8,{size:"small",checked:t,sx:{p:0}}),Vl(At,{option:r})]},r.key)}),Vl(U8,{}),Vl(n0,{disabled:b.length===0,onClick:()=>{o(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as K8,Menu as G8,MenuItem as i0}from"@mui/material";import Y8 from"@mui/icons-material/Check";import X8 from"@mui/icons-material/SettingsOutlined";import{jsx as ud,jsxs as dd}from"react/jsx-runtime";function MU(e){let{anchorEl:h,sprints:b,value:l,onSelect:o,onManage:s,onClose:r}=e;return dd(G8,{transitionDuration:0,anchorEl:h,open:!!h,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:mn(t)}))].map(t=>dd(i0,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?ud(Y8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ud(K8,{}),dd(i0,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[ud(X8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var Z8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function J8(e){return Z8[e]??"tasks"}var a0={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"},s0=["list","calendar","month","card","kanban","sprint","timeline"],Q8=["list","card"];function AU(e){let h=J8(e);switch(h){case"notice":return{kind:h,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:h,viewOptions:s0,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:h,viewOptions:Q8,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:h,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:h,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:h,viewOptions:s0,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as eS}from"react";import{useKeyboardState as tS}from"@ehfuse/keyboard-state";var l0=[{key:"g l",view:"list"},{key:"g b",view:"card"},{key:"g k",view:"kanban"},{key:"g s",view:"sprint"},{key:"g c",view:"calendar"},{key:"g m",view:"month"},{key:"g t",view:"timeline"}];function jU(e,h={}){let{enabled:b=!0,views:l}=h,{onCreateTask:o,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:c}=e,i=l?l.join(","):"",a=eS(()=>{let d=[];if(o&&d.push({key:"n",callback:o,options:{preventDefault:!0}}),s&&d.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&d.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&d.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),c&&d.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let f of c0(i?i.split(","):void 0))d.push({key:f.key,callback:()=>t(f.view),options:{preventDefault:!0}});return d},[o,s,r,t,n,c,i]);tS(b?a:[])}function c0(e){if(!e)return l0;let h=new Set(e);return l0.filter(b=>h.has(b.view))}function fd(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...c0(e).map(h=>({keys:h.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${a0[h.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var zU=fd();import{Box as ea,Button as rS}from"@mui/material";import nS from"@mui/icons-material/ArrowRightAlt";import{FormDialog as oS}from"@ehfuse/mui-form-dialog";import{jsx as Qo,jsxs as u0}from"react/jsx-runtime";function iS({keys:e}){return Qo(ea,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((h,b)=>u0(ea,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Qo(nS,{sx:{fontSize:18,color:"#9a9a97"}}):null,Qo(ea,{component:"span",sx:{minWidth:32,height:32,px:.75,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:13.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:h})]},`${h}-${b}`))})}function UU({open:e,onClose:h,views:b}){let l=fd(b);return Qo(oS,{open:e,onClose:h,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"shortcuts",showTitle:!1,children:Qo(ea,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(o=>u0(ea,{sx:{display:"contents"},children:[Qo(iS,{keys:o.keys}),Qo("span",{children:o.description})]},o.keys))})}],actions:{showCancelButton:!1,right:Qo(rS,{variant:"contained",onClick:h,children:"\uB2EB\uAE30"})}})}import{useEffect as d0,useRef as sS,useState as ns}from"react";import{Box as nr,Button as Pn,IconButton as hd,Menu as f0,MenuItem as h0,Switch as aS,Tooltip as p0}from"@mui/material";import{FormDialog as m0}from"@ehfuse/mui-form-dialog";import pd from"@mui/icons-material/Add";import lS from"@mui/icons-material/ArrowRightAlt";import cS from"@mui/icons-material/BoltOutlined";import uS from"@mui/icons-material/Close";import dS from"@mui/icons-material/EditOutlined";import{ErrorAlert as g0}from"@ehfuse/alerts";import{ClearTextField as ta,LabelSelect as cn}from"@ehfuse/mui-form-controls";import{Fragment as y0,jsx as Xe,jsxs as vn}from"react/jsx-runtime";var md=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"commented",label:"\uB313\uAE00\uC774 \uB2EC\uB838\uC744 \uB54C",hint:"\uB313\uAE00\uC774 \uC0C8\uB85C \uB2EC\uB9AC\uAC70\uB098 \uC218\uC815\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD68C\uC2E0\uC744 \uBC1B\uC740 \uC790\uB9AC)."},{value:"manager_assigned",label:"\uCC45\uC784\uC790\uAC00 \uC9C0\uC815\uB410\uC744 \uB54C",hint:"\uCC45\uC784\uC790\uAC00 \uC0C8\uB85C \uC9C0\uC815\uB418\uAC70\uB098 \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"attachment_added",label:"\uCCA8\uBD80\uAC00 \uC62C\uB77C\uC654\uC744 \uB54C",hint:"\uC5C5\uBB34\uC5D0 \uD30C\uC77C\uC774 \uCCA8\uBD80\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uC99D\uBE59 \uC811\uC218 \uC790\uB9AC)."},{value:"field_changed",label:"\uD544\uB4DC\uAC00 \uBC14\uB00C\uC5C8\uC744 \uB54C",hint:"\uC9C0\uC815\uD55C \uD544\uB4DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD544\uB4DC\uB97C \uC548 \uACE0\uB974\uBA74 \uC544\uBB34 \uC218\uC815\uC5D0\uB098 \uC2E4\uD589)."},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uB9E4\uC77C \uC810\uAC80\uD574 \uC2E4\uD589\uD569\uB2C8\uB2E4."}],ra=[{value:"due_date",label:"\uB9C8\uAC10\uC608\uC815"},{value:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC"},{value:"priority",label:"\uC911\uC694\uB3C4"},{value:"manager_account_seq",label:"\uCC45\uC784\uC790"},{value:"receiver_account_seqs",label:"\uCC38\uC870\uC790"},{value:"label_keys",label:"\uB77C\uBCA8"},{value:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8"},{value:"sprint_seq",label:"\uBAA9\uD45C"},{value:"content",label:"\uB0B4\uC6A9"},{value:"note",label:"\uBE44\uACE0"}],Yl=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Kl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Gl(e){return nn.find(h=>h.key===e)?.name??e}function fS(e,h,b){let{condition:l,action:o}=e,s=[];if(l.group_seq){let n=h.find(c=>Go(c.key)===l.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${n?.label??`#${l.group_seq}`}`)}l.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),l.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),l.priority&&s.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===l.priority)?.label}`),l.label_key&&s.push(`\uB77C\uBCA8=${b.find(n=>n.key===l.label_key)?.name??l.label_key}`),l.title_contains&&s.push(`\uC81C\uBAA9\uC5D0 "${l.title_contains}" \uD3EC\uD568`),l.status&&s.push(`\uC0C1\uD0DC=${Gl(l.status)}`),l.from_status&&s.push(`${Gl(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Gl(l.to_status)}\uB85C`),l.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),l.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),l.manager_account_seq&&s.push(`\uCC45\uC784\uC790=${l.manager_name||`\uACC4\uC815 #${l.manager_account_seq}`}`),l.receiver_account_seq&&s.push(`\uCC38\uC870\uC790\uC5D0 ${l.receiver_name||`\uACC4\uC815 #${l.receiver_account_seq}`}`),l.changed_field&&s.push(`${ra.find(n=>n.value===l.changed_field)?.label??l.changed_field} \uBCC0\uACBD`),l.comment_contains&&s.push(`\uB313\uAE00\uC5D0 "${l.comment_contains}" \uD3EC\uD568`),l.comment_by_others===!0&&s.push("\uB0A8\uC774 \uC4F4 \uB313\uAE00"),typeof l.overdue_days=="number"&&s.push(`${l.overdue_days}\uC77C \uACBD\uACFC`);let r=[];o.set_status&&r.push(`\uC0C1\uD0DC=${Gl(o.set_status)}`),o.set_priority&&r.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===o.set_priority)?.label}`),o.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790=${o.assign_manager_name||"\uC9C0\uC815"}`),o.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${o.add_receiver_name||"\uC9C0\uC815"}`),o.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(n=>n.key===o.add_label_key)?.name??o.add_label_key}`),o.apply_content_template_seq&&r.push(`\uBCF8\uBB38 \uC591\uC2DD=${o.apply_content_template_name||"\uC9C0\uC815"}`),o.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=md.find(n=>n.value===e.trigger)?.label??e.trigger;return{left:s.length>0?`${t} \xB7 ${s.join(", ")}`:t,right:r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}}var b0={fontSize:16,fontWeight:700,color:"#37352f"},hS={display:"flex",alignItems:"center",gap:1},pS={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function aV({open:e,rules:h,customTabs:b,statusOptions:l,contentTemplates:o=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:i}){let[a,d]=ns(!1),[f,u]=ns(0),[g,m]=ns(Kl()),[x,_]=ns(!1),B=sS(null),[A,j]=ns(null),[D,P]=ns(null);d0(()=>{if(e)return;let H=window.setTimeout(()=>{d(!1),u(0),m(Kl())},500);return()=>window.clearTimeout(H)},[e]),d0(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let N=f>0,q=g.trigger,z=()=>{d(!1),u(0),m(Kl())},T=(H,Z)=>{m(J=>{let G={...J.condition};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,condition:G}})},C=(H,Z)=>{m(J=>{let G={...J.action};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,action:G}})},R=H=>{m(Z=>{let J={...Z.condition};return H!=="status_changed"&&(delete J.from_status,delete J.to_status),H!=="overdue"&&delete J.overdue_days,H!=="field_changed"&&delete J.changed_field,H!=="commented"&&(delete J.comment_contains,delete J.comment_by_others),H==="field_changed"&&J.changed_field===void 0&&(J.changed_field=ra[0]?.value??""),{...Z,trigger:H,condition:J}})},p=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=nn.map(H=>({value:H.key,label:H.name})),w=p.map(H=>({value:String(Go(H.key)),label:H.label})),{condition:k,action:S}=g,E=k.is_bug!==void 0||k.is_event!==void 0,L=[...k.group_seq===void 0&&w.length>0?[{key:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...E?[]:[{key:"kind",label:"\uC885\uB958\uAC00 \uC624\uB958/\uC77C\uC815\uC778 \uACBD\uC6B0"}],...k.priority===void 0?[{key:"priority",label:"\uC911\uC694\uB3C4\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...k.label_key===void 0&&y.length>0?[{key:"label_key",label:"\uB77C\uBCA8\uC774 \uBD99\uC5B4 \uC788\uB294 \uACBD\uC6B0"}]:[],...k.title_contains===void 0?[{key:"title_contains",label:"\uC81C\uBAA9\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...k.manager_empty===void 0?[{key:"manager_empty",label:"\uCC45\uC784\uC790\uAC00 \uC5C6\uB294/\uC788\uB294 \uACBD\uC6B0"}]:[],...s&&k.manager_account_seq===void 0?[{key:"manager_account",label:"\uCC45\uC784\uC790\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...s&&k.receiver_account_seq===void 0?[{key:"receiver_account",label:"\uCC38\uC870\uC790\uC5D0 ~\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.from_status===void 0?[{key:"from_status",label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.to_status===void 0?[{key:"to_status",label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="field_changed"&&k.changed_field===void 0?[{key:"changed_field",label:"~ \uD544\uB4DC\uAC00 \uBCC0\uACBD\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_contains===void 0?[{key:"comment_contains",label:"\uB313\uAE00\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_by_others===void 0?[{key:"comment_by_others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C\uC774 \uC4F4 \uACBD\uC6B0"}]:[],...q==="overdue"&&k.overdue_days===void 0?[{key:"overdue_days",label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB09C \uACBD\uC6B0"}]:[]],$=async H=>{if(!s)return;let Z=H==="manager_account"?k.manager_account_seq??0:k.receiver_account_seq??0,J=await s(Z,H==="manager_account"?"\uCC45\uC784\uC790":"\uCC38\uC870\uC790");J&&m(G=>{let X={...G.condition};return H==="manager_account"?(X.manager_account_seq=J.accountSeq,X.manager_name=J.name):(X.receiver_account_seq=J.accountSeq,X.receiver_name=J.name),{...G,condition:X}})},U=H=>{j(null),H==="group_seq"?T("group_seq",Number(w[0]?.value)||0):H==="kind"?T("is_bug",!0):H==="priority"?T("priority","high"):H==="label_key"?T("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?T("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?T("from_status",nn[0]?.key??""):H==="to_status"?T("to_status",nn[0]?.key??""):H==="changed_field"?T("changed_field",ra[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?T("comment_by_others",!0):H==="overdue_days"&&T("overdue_days",1)},O=H=>{if(H==="kind"){T("is_bug",""),T("is_event","");return}if(H==="manager_account"){T("manager_account_seq",""),T("manager_name","");return}if(H==="receiver_account"){T("receiver_account_seq",""),T("receiver_name","");return}T(H==="group_seq"?"group_seq":H,"")},W=[...S.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...S.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...S.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&S.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&S.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...o.length>0&&S.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&S.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],M=async H=>{if(!s)return;let Z=H==="assign_manager"?S.assign_manager_account_seq??0:H==="add_receiver"?S.add_receiver_account_seq??0:S.notify_account_seq??0,J=await s(Z,H==="assign_manager"?"\uCC45\uC784\uC790":H==="add_receiver"?"\uCC38\uC870\uC790":"\uC54C\uB9BC \uBC1B\uC744 \uC0AC\uB78C");J&&m(G=>{let X={...G.action};return H==="assign_manager"?(X.assign_manager_account_seq=J.accountSeq,X.assign_manager_name=J.name):H==="add_receiver"?(X.add_receiver_account_seq=J.accountSeq,X.add_receiver_name=J.name):(X.notify_account_seq=J.accountSeq,X.notify_name=J.name),{...G,action:X}})},I=H=>{if(P(null),H==="set_status")C("set_status",nn[0]?.key??"");else if(H==="set_priority")C("set_priority","high");else if(H==="add_label_key")C("add_label_key",y[0]?.value??"");else if(H==="apply_content_template"){let Z=o[0];m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}else M(H)},F=H=>{H==="assign_manager"?(C("assign_manager_account_seq",""),C("assign_manager_name","")):H==="add_receiver"?(C("add_receiver_account_seq",""),C("add_receiver_name","")):H==="apply_content_template"?(C("apply_content_template_seq",""),C("apply_content_template_name","")):H==="notify"?(C("notify_account_seq",""),C("notify_name",""),C("notify_message","")):C(H,"")},V=async()=>{if(!g.name.trim()){g0({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){g0({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=N?g.sort_no:h.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=N?await n(f,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&z()},Y=(H,Z,J,G)=>vn(nr,{sx:hS,children:[Xe(nr,{sx:pS,children:H}),vn(nr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Xe(nr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Xe(p0,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Xe(hd,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Xe(uS,{sx:{fontSize:16}})})})]}),K=()=>vn(nr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Xe(ta,{size:"medium",label:"\uADDC\uCE59 \uC774\uB984",inputRef:B,placeholder:"\uC608: \uC811\uC218 \uC624\uB958 \uC790\uB3D9 \uBC30\uC815",value:g.name,onChange:H=>m(Z=>({...Z,name:H.target.value}))}),Xe(nr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:md.map(H=>{let Z=q===H.value;return Xe(Pn,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>R(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Xe(nr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:md.find(H=>H.value===q)?.hint}),vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Xe(nr,{sx:b0,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),L.length>0?Xe(Pn,{size:"small",startIcon:Xe(pd,{sx:{fontSize:16}}),onClick:H=>j(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uC870\uAC74 \uCD94\uAC00"}):null]}),k.group_seq!==void 0?Y("\uD504\uB85C\uC81D\uD2B8",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>T("group_seq",Number(H.target.value)||"")}),()=>O("group_seq")):null,E?Y("\uC885\uB958",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.is_bug?"bug":"event",options:[{value:"bug",label:"\uC624\uB958\uB9CC"},{value:"event",label:"\uC77C\uC815\uB9CC"}],onChange:H=>{let Z=H.target.value==="bug";T("is_bug",Z?!0:""),T("is_event",Z?"":!0)}}),()=>O("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:Yl,onChange:H=>T("priority",H.target.value)}),()=>O("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>T("label_key",H.target.value)}),()=>O("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Xe(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uAE34\uAE09)",value:k.title_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,title_contains:H.target.value}}))}),()=>O("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>T("manager_empty",H.target.value==="empty")}),()=>O("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>O("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>O("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>T("from_status",H.target.value)}),()=>O("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>T("to_status",H.target.value)}),()=>O("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:ra,onChange:H=>T("changed_field",H.target.value)}),()=>O("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Xe(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uD68C\uC2E0)",value:k.comment_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,comment_contains:H.target.value}}))}),()=>O("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:k.comment_by_others?"others":"any",options:[{value:"others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C"},{value:"any",label:"\uB204\uAD6C\uB4E0"}],onChange:H=>T("comment_by_others",H.target.value==="others")}),()=>O("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Xe(ta,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>T("overdue_days",Math.max(0,Number(H.target.value)||0)),helperText:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130 \uC2E4\uD589\uD560\uC9C0"}),()=>O("overdue_days")):null,Object.keys(k).length===0?Xe(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Xe(nr,{sx:b0,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Xe(Pn,{size:"small",startIcon:Xe(pd,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),S.set_status!==void 0?Y("\uC0C1\uD0DC",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>F("set_status")):null,S.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_priority,options:Yl,onChange:H=>C("set_priority",H.target.value)}),()=>F("set_priority")):null,S.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:String(S.apply_content_template_seq),options:o.map(H=>({value:String(H.seq),label:H.name})),onChange:H=>{let Z=o.find(J=>String(J.seq)===String(H.target.value));m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}}),()=>F("apply_content_template"),"\uBCF8\uBB38\uC774 \uBE44\uC5B4 \uC788\uC744 \uB54C\uB9CC \uCC44\uC6C1\uB2C8\uB2E4(\uC4F4 \uB0B4\uC6A9\uC744 \uB36E\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)"):null,S.add_label_key!==void 0?Y("\uB77C\uBCA8",Xe(cn,{size:"medium",fullWidth:!0,label:"",value:S.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>F("add_label_key")):null,S.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("assign_manager")},children:S.assign_manager_name||`\uACC4\uC815 #${S.assign_manager_account_seq}`}),()=>F("assign_manager")):null,S.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("add_receiver")},children:S.add_receiver_name||`\uACC4\uC815 #${S.add_receiver_account_seq}`}),()=>F("add_receiver")):null,S.notify_account_seq!==void 0?Y("\uC54C\uB9BC",vn(y0,{children:[Xe(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("notify")},sx:{flexShrink:0},children:S.notify_name||`\uACC4\uC815 #${S.notify_account_seq}`}),Xe(ta,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:S.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>F("notify")):null,Object.keys(S).length===0?Xe(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:'"+ \uB3D9\uC791 \uCD94\uAC00" \uB85C \uD560 \uC77C\uC744 \uD558\uB098 \uC774\uC0C1 \uACE8\uB77C \uC8FC\uC138\uC694.'}):null,Xe(f0,{transitionDuration:0,anchorEl:A,open:!!A,onClose:()=>j(null),children:L.map(H=>Xe(h0,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Xe(f0,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Xe(h0,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return vn(y0,{children:[Xe(m0,{open:e,onClose:r,maxWidth:"sm",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-manage",tabs:{visible:!1},contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionContentPaddingTop:0,sections:[{id:"rules",title:"",showTitle:!1,children:vn(nr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[h.length===0?vn(nr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Xe(cS,{sx:{fontSize:48,color:"#d9d9d6"}}),Xe(nr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,h.map(H=>vn(nr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Xe(p0,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Xe(aS,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),vn(nr,{sx:{flex:1,minWidth:0},children:[Xe(nr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=fS(H,b,l);return vn(nr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Xe(nr,{component:"span",children:Z.left}),Xe(lS,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Xe(nr,{component:"span",children:Z.right})]})})()]}),Xe(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC218\uC815`,onClick:()=>{u(H.seq),m({name:H.name,trigger:H.trigger,enabled:H.enabled,sort_no:H.sort_no,condition:{...H.condition,...H.trigger==="field_changed"&&H.condition.changed_field===void 0?{changed_field:ra[0]?.value??""}:{}},action:{...H.action}}),d(!0)},children:Xe(dS,{sx:{fontSize:18}})}),Xe(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>i(H.seq),children:Xe(cr,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Xe(Pn,{startIcon:Xe(pd,{}),onClick:()=>{u(0),m(Kl()),d(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Xe(Pn,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Xe(m0,{open:a,onClose:z,maxWidth:"sm",title:N?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-form",tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"rule-form",title:"",showTitle:!1,children:K()}],actions:{showCancelButton:!0,right:Xe(Pn,{variant:"contained",onClick:()=>{V()},disabled:x,children:N?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as x0,useRef as gd,useState as os}from"react";import{Box as Jt,Button as is,IconButton as na,Tooltip as oa}from"@mui/material";import v0 from"@mui/icons-material/Add";import mS from"@mui/icons-material/EditOutlined";import gS from"@mui/icons-material/ContentCopyOutlined";import bS from"@mui/icons-material/DragIndicator";import yS from"@mui/icons-material/Close";import xS from"@mui/icons-material/PlaylistAddCheckOutlined";import{DndContext as vS,PointerSensor as wS,closestCenter as _S,useSensor as kS,useSensors as SS}from"@dnd-kit/core";import{restrictToParentElement as TS,restrictToVerticalAxis as CS}from"@dnd-kit/modifiers";import{SortableContext as BS,arrayMove as w0,useSortable as IS,verticalListSortingStrategy as ES}from"@dnd-kit/sortable";import{CSS as MS}from"@dnd-kit/utilities";import{FormDialog as _0}from"@ehfuse/mui-form-dialog";import{ClearTextField as bd,LabelSelect as k0,NumberField as S0}from"@ehfuse/mui-form-controls";import RS from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as OS,ErrorAlert as T0}from"@ehfuse/alerts";import{Fragment as LS,jsx as st,jsxs as wn}from"react/jsx-runtime";var AS=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}],C0="\uC5C5\uBB34 \uC81C\uBAA9",yd=2,Xl={flex:1,minWidth:0},B0=56,I0=20,DS=`${I0+yd*8}px`;function Zl(){return{name:"",description:"",group_seq:0,items:[]}}function PS(){return{title:"",start_offset_days:0,due_offset_days:0,priority:"medium"}}function NS({id:e,children:h}){let{attributes:b,listeners:l,setNodeRef:o,transform:s,transition:r,isDragging:t}=IS({id:e});return st(Jt,{ref:o,sx:{transform:MS.Transform.toString(s),transition:r,...t?{opacity:.6,position:"relative",zIndex:1}:{}},children:h({handleProps:{...b,...l},dragging:t})})}function IV({open:e,templates:h,customTabs:b,onPickAccount:l,onClose:o,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,i]=os(!1),[a,d]=os(0),[f,u]=os(Zl()),[g,m]=os(!1),[x,_]=os([]),B=gd(0),[A,j]=os(0),D=gd(null),P=gd(null);x0(()=>{if(e)return;let L=window.setTimeout(()=>{i(!1),d(0),u(Zl()),_([])},500);return()=>window.clearTimeout(L)},[e]);let N=()=>(B.current+=1,`template-item-${B.current}`),q=(L,$)=>{d(L),u($),_($.items.map(()=>N())),i(!0)},z=f.items.map((L,$)=>x[$]??`template-item-fallback-${$}`),T=()=>{let L=P.current?.getScrollContainer()??null;if(L){L.scrollTop=L.scrollHeight;return}let $=D.current?.querySelectorAll("*")??[];for(let U of Array.from($))if(U.scrollHeight>U.clientHeight+1){U.scrollTop=U.scrollHeight;return}},C=()=>{let L=D.current;if(!L)return null;let $=L.querySelectorAll("input[data-template-title]"),U=$.length?$:L.querySelectorAll(`input[placeholder="${C0}"]`);return U.length?U[U.length-1]:null};x0(()=>{if(A===0)return;let L=0,$=0,U=()=>{T();let W=C();W&&document.activeElement!==W&&W.focus(),L+=1,!(W&&document.activeElement===W)&&L<8&&($=window.setTimeout(U,50))},O=window.requestAnimationFrame(U);return()=>{window.cancelAnimationFrame(O),window.clearTimeout($)}},[A]);let R=b.filter(L=>!L.archived).map(L=>({value:String(Go(L.key)),label:L.label})),p=(L,$)=>{u(U=>({...U,items:U.items.map((O,W)=>W===L?{...O,...$}:O)}))},y=SS(kS(wS,{activationConstraint:{distance:5}})),v=L=>{let $=String(L.active?.id??""),U=String(L.over?.id??"");if(!$||!U||$===U)return;let O=z.indexOf($),W=z.indexOf(U);O<0||W<0||(u(M=>({...M,items:w0(M.items,O,W)})),_(M=>w0(M,O,W)))},w=async L=>{if(!l)return;let $=await l(f.items[L]?.manager_account_seq??0,"\uCC45\uC784\uC790");$&&p(L,{manager_account_seq:$.accountSeq,manager_name:$.name})},k=async()=>{let L=f.name.trim();if(!L){T0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let $=f.items.filter(W=>W.title.trim().length>0);if($.length===0){T0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}m(!0);let U={...f,name:L,items:$},O=a>0?await r(a,U):await s(U);m(!1),O&&(i(!1),d(0),u(Zl()))},S=st(Jt,{children:h.length===0?wn(Jt,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[st(xS,{sx:{fontSize:48,color:"#d9d9d6"}}),st(Jt,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):h.map(L=>wn(Jt,{sx:{display:"flex",alignItems:"center",gap:2.5,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[wn(Jt,{sx:{flex:1,minWidth:0},children:[st(Jt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:L.name}),wn(Jt,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",L.items.length,"\uAC74",L.description?` \xB7 ${L.description}`:""]})]}),n?st(is,{size:"medium",variant:"outlined",onClick:()=>n(L),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,st(oa,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>q(L.seq,{name:L.name,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:st(mS,{sx:{fontSize:19}})})}),st(oa,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>q(0,{name:`${L.name} \uC0AC\uBCF8`,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:st(gS,{sx:{fontSize:18}})})}),st(oa,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await OS({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${L.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(L.seq))()},children:st(cr,{sx:{fontSize:18}})})})]},L.seq))}),E=wn(Jt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[st(bd,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:f.name,onChange:L=>u($=>({...$,name:L.target.value}))}),wn(Jt,{sx:{display:"grid",gridTemplateColumns:R.length>0?"1fr 1fr":"1fr",gap:2},children:[st(bd,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:f.description??"",onChange:L=>u($=>({...$,description:L.target.value}))}),R.length>0?st(k0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(f.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...R],onChange:L=>u($=>({...$,group_seq:Number(L.target.value)||0}))}):null]}),wn(Jt,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[st(Jt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),st(Jt,{sx:{fontSize:14,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."})]}),f.items.length===0?st(Jt,{sx:{fontSize:14,color:"#9a9a97",py:2},children:'\uC544\uC9C1 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. "\uD56D\uBAA9 \uCD94\uAC00" \uB85C \uC808\uCC28\uB97C \uC21C\uC11C\uB300\uB85C \uC801\uC73C\uC138\uC694.'}):st(Jt,{ref:D,sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:st(RS,{ref:P,style:{maxHeight:"min(560px, 52vh)"},thumb:{width:6},children:st(vS,{sensors:y,collisionDetection:_S,modifiers:[CS,TS],onDragEnd:v,children:st(BS,{items:z,strategy:ES,children:f.items.map((L,$)=>st(NS,{id:z[$],children:({handleProps:U})=>wn(Jt,{sx:{borderBottom:$===f.items.length-1?"none":"1px solid #f2f2f0",px:yd,py:2,gap:2,display:"flex",flexDirection:"column"},children:[wn(Jt,{sx:{display:"flex",alignItems:"center",gap:yd},children:[st(Jt,{...U,"aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC21C\uC11C \uC774\uB3D9`,sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:"#c9c8c5",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:st(bS,{sx:{fontSize:I0}})}),st(bd,{size:"medium",fullWidth:!0,placeholder:C0,slotProps:{htmlInput:{"data-template-title":$}},value:L.title,onChange:O=>p($,{title:O.target.value})})]}),wn(Jt,{sx:{display:"flex",alignItems:"center",gap:2,pl:DS},children:[st(Jt,{sx:Xl,children:st(S0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.start_offset_days??null,onValueChange:O=>p($,{start_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),st(Jt,{sx:Xl,children:st(S0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.due_offset_days??null,onValueChange:O=>p($,{due_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),st(Jt,{sx:Xl,children:st(k0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:L.priority??"medium",options:AS,onChange:O=>p($,{priority:O.target.value})})}),l?wn(Jt,{sx:{...Xl,position:"relative"},children:[st(is,{variant:"outlined",fullWidth:!0,onClick:()=>{w($)},sx:{height:B0,display:"block",textAlign:"left",textTransform:"none",fontSize:16,fontWeight:400,lineHeight:`${B0-2}px`,py:0,px:1.75,pr:L.manager_account_seq?4.5:1.75,borderColor:"#c4c4c4",color:L.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{borderColor:"#37352f",bgcolor:"transparent"}},children:L.manager_name||"\uCC45\uC784\uC790"}),L.manager_account_seq?st(oa,{title:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30",arrow:!0,disableInteractive:!0,children:st(na,{size:"small","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uCC45\uC784\uC790 \uBE44\uC6B0\uAE30`,onClick:O=>{O.stopPropagation(),p($,{manager_account_seq:0,manager_name:""})},sx:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)"},children:st(yS,{sx:{fontSize:18}})})}):null]}):null,st(oa,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:st(na,{size:"medium","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(O=>({...O,items:O.items.filter((W,M)=>M!==$)})),_(O=>O.filter((W,M)=>M!==$))},children:st(cr,{sx:{fontSize:18}})})})]})]})},z[$]))})})})})]});return wn(LS,{children:[st(_0,{open:e,onClose:o,maxWidth:"md",title:"\uC5C5\uBB34 \uD15C\uD50C\uB9BF",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template",tabs:{visible:!1},actions:{showCancelButton:!1,left:st(is,{startIcon:st(v0,{sx:{fontSize:18}}),onClick:()=>q(0,Zl()),children:"\uC0C8 \uD15C\uD50C\uB9BF"}),right:st(is,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})},sectionContentPaddingTop:0,sections:[{id:"templates",title:"",showTitle:!1,children:S}]}),st(_0,{open:c,onClose:()=>i(!1),maxWidth:"md",title:a>0?"\uD15C\uD50C\uB9BF \uC218\uC815":"\uC0C8 \uD15C\uD50C\uB9BF",locale:"ko",backdropClick:!1,fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template-form",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,left:st(is,{startIcon:st(v0,{sx:{fontSize:18}}),onClick:()=>{u(L=>({...L,items:[...L.items,PS()]})),_(L=>[...L,N()]),j(L=>L+1)},children:"\uD56D\uBAA9 \uCD94\uAC00"}),right:st(is,{variant:"contained",disabled:g,onClick:()=>{k()},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"template-form",title:"",showTitle:!1,children:E}]})]})}import{useEffect as E0,useState as M0}from"react";import{Box as Pr,Button as jS}from"@mui/material";import{FormDialog as zS}from"@ehfuse/mui-form-dialog";import{DateTextField as FS}from"@ehfuse/mui-form-controls";import qS from"@ehfuse/overlay-scrollbar";import{jsx as Yr,jsxs as ia}from"react/jsx-runtime";function jV({open:e,template:h,todayStr:b,running:l=!1,onClose:o,onRun:s}){let[r,t]=M0(b),[n,c]=M0(h);E0(()=>{h&&c(h)},[h]),E0(()=>{e&&t(b)},[e]);let i=h??n,a=i?Mh(i,r):[];return Yr(zS,{open:e,onClose:o,maxWidth:"md",title:i?`${i.name} \uC2E4\uD589`:"\uD15C\uD50C\uB9BF \uC2E4\uD589",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-template-run",tabs:{visible:!1},sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:Yr(jS,{variant:"contained",disabled:l||a.length===0,onClick:()=>s(a,r),children:l?"\uB9CC\uB4DC\uB294 \uC911\u2026":`\uC5C5\uBB34 ${a.length}\uAC74 \uB9CC\uB4E4\uAE30`})},sections:[{id:"template-run",title:"",showTitle:!1,children:ia(Pr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Yr(Pr,{sx:{width:72,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uC900\uC77C"}),Yr(FS,{size:"medium",fullWidth:!0,value:r,onChange:d=>t(d.target.value)})]}),Yr(Pr,{sx:{fontSize:14.5,color:"#37352f"},children:"\uC544\uB798 \uC5C5\uBB34\uAC00 \uD55C\uAEBC\uBC88\uC5D0 \uB9CC\uB4E4\uC5B4\uC9D1\uB2C8\uB2E4. \uB0A0\uC9DC\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB41C \uAC12\uC785\uB2C8\uB2E4."}),ia(Pr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Yr(Pr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uC2DC\uC791"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uB9C8\uAC10"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"})]}),Yr(qS,{style:{maxHeight:520},thumb:{width:6},children:a.length===0?Yr(Pr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uB9CC\uB4E4 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map((d,f)=>ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.25,borderBottom:f===a.length-1?"none":"1px solid #f2f2f0",fontSize:16,fontWeight:500,color:"#111111"},children:[Yr(Pr,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.start_date?"#37352f":"#9a9a97"},children:Bc(d.start_date)||"-"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.due_date?"#37352f":"#9a9a97"},children:Bc(d.due_date)||"-"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.manager_name||"-"})]},f))})]})]})}]})}var $S={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function HS(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function xd(e){let h=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(h)?`${h.slice(2,4)}.${h.slice(5,7)}.${h.slice(8,10)}`:"-"}function ss(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function vd(e,h){let l=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=xd(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=xd(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(c=>String(c).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(c=>c.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:lr(e).name,projectLabel:e.tab_key?h.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:HS(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:o!=="-"&&l?`${o} ${l}`:o,priorityName:$S[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Pt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function WS(e,h){if(e===" ")return h*.3;let b=e.codePointAt(0)??0,l=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return h*(l?1:.55)}function Jl(e,h){let b=0;for(let l of String(e??""))b+=WS(l,h);return b}function as(e,h){let b=String(e??"").trim();if(!b)return["-"];let l=[],o="";for(let s of b){if(s===`
42
42
  `){o&&l.push(o),o="";continue}let r=`${o}${s}`;if(r.length>h&&o){l.push(o),o=s;continue}o=r}return o&&l.push(o),l.length>0?l:["-"]}function ki(e,h,b){let l=String(e??"").replace(/\s+/g," ").trim();if(!l)return"";if(Jl(l,b)<=h)return l;let o=Jl("\u2026",b),s="",r=0;for(let t of l){let n=Jl(t,b);if(r+n+o>h)break;s+=t,r+=n}return`${s}\u2026`}var aa=595.28,la=841.89,ca=841.89,ua=595.28,Nr=28,_n=96,un=44,US="'Malgun Gothic','\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo','Noto Sans KR',sans-serif",VS="'Batang','\uBC14\uD0D5','AppleMyungjo','Noto Serif KR',serif",sa="#cbd5e1",KS=[`text { font-family: ${US}; fill: #000000; }`,`.doc-title { font-family: ${VS}; font-size: 20px; font-weight: 700; }`,".doc-sub { font-size: 10.5px; fill: #333333; }",".doc-meta { font-size: 9.5px; fill: #333333; }",".th { font-size: 9.5px; font-weight: 700; fill: #000000; }",".td { font-size: 9px; }",".td.done { fill: #555555; }",".gt { font-size: 10px; font-weight: 700; fill: #000000; }",".label { font-size: 9px; fill: #333333; }",".value { font-size: 10px; }",".section { font-size: 11.5px; font-weight: 700; fill: #000000; }",".pageno { font-size: 9px; fill: #333333; }",`.head { fill: #eef2f7; stroke: ${sa}; stroke-width: 0.5; }`,`.group { fill: #f8fafc; stroke: ${sa}; stroke-width: 0.5; }`,`.frame { fill: none; stroke: ${sa}; stroke-width: 0.5; }`,`.hline { stroke: ${sa}; stroke-width: 0.5; }`,`.vline { stroke: ${sa}; stroke-width: 0.5; }`,".bar { fill: #bfdbfe; stroke: #60a5fa; stroke-width: 0.6; }",".bar.done { fill: #e5e7eb; stroke: #cbd5e1; }",".bar.overdue { fill: #fecaca; stroke: #f87171; }"].join("");function Ro(e,h,b){let l=b-Nr;return[`<text x="${Nr}" y="46" class="doc-title">${Pt(e.documentTitle)}</text>`,`<text x="${Nr}" y="66" class="doc-sub">${Pt(e.subtitle)}</text>`,`<text x="${l}" y="42" class="doc-meta" text-anchor="end">${Pt(e.facilityName)}</text>`,`<text x="${l}" y="58" class="doc-meta" text-anchor="end">\uCD9C\uB825 ${Pt(ss(e.printedAt))}${e.printedBy?` \xB7 ${Pt(e.printedBy)}`:""}</text>`,h?`<text x="${l}" y="74" class="doc-meta" text-anchor="end">${Pt(h)}</text>`:""].join("")}function Oo(e){let{width:h,height:b,body:l,pageIndex:o,pageCount:s}=e;return[`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${b}" viewBox="0 0 ${h} ${b}">`,`<style>${KS}</style>`,`<rect x="0" y="0" width="${h}" height="${b}" fill="#ffffff" />`,l,`<text x="${h/2}" y="${b-22}" class="pageno" text-anchor="middle">${o+1} / ${s}</text>`,"</svg>"].join("")}var _d=ca,O0=ua,Ao=Nr,da=_d-Nr,ha=22,Si=20,Ti=22,fa=5,A0=_n,D0=un,R0=O0-46,pa=[{key:"title",label:"\uC81C\uBAA9",width:250,align:"start"},{key:"status",label:"\uC0C1\uD0DC",width:56,align:"middle"},{key:"start",label:"\uC2DC\uC791",width:86,align:"middle"},{key:"due",label:"\uB9C8\uAC10",width:86,align:"middle"},{key:"manager",label:"\uCC45\uC784\uC790",width:62,align:"middle"},{key:"receivers",label:"\uCC38\uC870\uC790",width:122,align:"start"},{key:"priority",label:"\uC911\uC694\uB3C4",width:52,align:"middle"},{key:"project",label:"\uD504\uB85C\uC81D\uD2B8",width:72,align:"middle"}],wd=pa.reduce((e,h,b)=>(e.push(b===0?Ao:e[b-1]+pa[b-1].width),e),[]);function GS(e){let h=[],b=[],l=A0+ha,o=(s,r)=>{h.push(b),b=[],l=D0+ha,s&&(b.push({kind:"group",label:s,count:r,continued:!0}),l+=Ti)};for(let s of e){s.label&&(l+Ti+Si>R0&&o("",0),b.push({kind:"group",label:s.label,count:s.rows.length,continued:!1}),l+=Ti);for(let r of s.rows)l+Si>R0&&o(s.label,s.rows.length),b.push({kind:"row",completed:r.completed,values:pa.map(t=>{switch(t.key){case"title":return r.title;case"status":return r.statusName;case"project":return r.projectLabel||"\uAE30\uBCF8";case"manager":return r.managerName||"-";case"receivers":return r.receiverNames||"-";case"start":return r.startDate;case"due":return r.dueDate;default:return r.priorityName||"-"}})}),l+=Si}return h.push(b),h.filter((s,r)=>r===0||s.length>0)}function YS(e,h){let b=[];b.push(`<rect x="${Ao}" y="${h}" width="${da-Ao}" height="${ha}" class="head" />`),pa.forEach((o,s)=>{let r=wd[s],t=o.align==="middle"?r+o.width/2:r+fa;b.push(`<text x="${t}" y="${h+ha-7}" class="th" text-anchor="${o.align}">${Pt(o.label)}</text>`)});let l=h+ha;for(let o of e){if(o.kind==="group"){b.push(`<rect x="${Ao}" y="${l}" width="${da-Ao}" height="${Ti}" class="group" />`,`<text x="${Ao+fa}" y="${l+Ti-7}" class="gt">${Pt(o.continued?`${o.label} (\uC774\uC5B4\uC11C)`:o.label)}</text>`,`<text x="${da-fa}" y="${l+Ti-7}" class="gt" text-anchor="end">${o.count}\uAC74</text>`),l+=Ti;continue}pa.forEach((s,r)=>{let t=wd[r],n=s.align==="middle"?t+s.width/2:t+fa;b.push(`<text x="${n}" y="${l+Si-6}" class="${o.completed?"td done":"td"}" text-anchor="${s.align}">${Pt(ki(o.values[r]??"",s.width-fa*2,9))}</text>`)}),b.push(`<line x1="${Ao}" y1="${l+Si}" x2="${da}" y2="${l+Si}" class="hline" />`),l+=Si}return wd.slice(1).forEach(o=>{b.push(`<line x1="${o}" y1="${h}" x2="${o}" y2="${l}" class="vline" />`)}),b.push(`<rect x="${Ao}" y="${h}" width="${da-Ao}" height="${l-h}" class="frame" />`),b.join("")}async function XS(e,h){let b=GS(h),l=h.reduce((o,s)=>o+s.rows.length,0);return b.map((o,s)=>{let r=s===0?A0:D0,t=[s===0?Ro(e,`\uC804\uCCB4 ${l}\uAC74`,_d):"",YS(o,r)].join("");return Oo({width:_d,height:O0,body:t,pageIndex:s,pageCount:b.length})})}var Sd=aa,P0=la,ro=Nr,Ql=Sd-Nr,ZS=P0-46,N0=22,JS=68,QS=(Ql-ro)/2,eT=14,kd=58;function ls(e){switch(e.kind){case"title":return 34;case"props":return Math.ceil(e.pairs.length/2)*N0+10;case"section":return 26;default:return eT}}function tT(e){let h=[{kind:"title",text:e.title,ticket:e.ticketNo}];return h.push({kind:"props",pairs:e.properties}),h.push({kind:"section",text:"\uB0B4\uC6A9"}),(e.content.trim()?e.content.split(`
43
43
  `).flatMap(l=>l.trim()?as(l,kd):[""]):["(\uB0B4\uC6A9 \uC5C6\uC74C)"]).forEach(l=>h.push({kind:"line",text:l,muted:!e.content.trim()})),e.checklist.length>0&&(h.push({kind:"section",text:`\uD560\uC77C (${e.checklist.filter(l=>l.checked).length}/${e.checklist.length})`}),e.checklist.forEach(l=>{as(l.label,kd-3).forEach((o,s)=>h.push({kind:s===0?"check":"line",text:o,checked:l.checked}))})),e.includeComments&&e.comments.length>0&&(h.push({kind:"section",text:`\uB313\uAE00 (${e.comments.length})`}),e.comments.forEach(l=>{h.push({kind:"line",text:`${l.author} \xB7 ${l.time}`,muted:!0}),as(l.text,kd).forEach(o=>h.push({kind:"line",text:o}))})),h}function rT(e){let h=[],b=[],l=_n;for(let o of e){let s=ls(o);l+s>ZS&&(h.push(b),b=[],l=un),b.push(o),l+=s}return h.push(b),h}function nT(e,h){switch(e.kind){case"title":{let b=e.ticket?`<text x="${Ql}" y="${h+16}" class="doc-meta" text-anchor="end">${Pt(e.ticket)}</text>`:"";return{markup:`<text x="${ro}" y="${h+16}" class="section" style="font-size:14px">${Pt(e.text)}</text>${b}<line x1="${ro}" y1="${h+24}" x2="${Ql}" y2="${h+24}" class="hline" />`,nextY:h+ls(e)}}case"props":{let b=[];return e.pairs.forEach((l,o)=>{let s=o%2,r=Math.floor(o/2),t=ro+s*QS,n=h+r*N0;b.push(`<text x="${t}" y="${n+14}" class="label">${Pt(l.label)}</text>`,`<text x="${t+JS}" y="${n+14}" class="value">${Pt(as(l.value||"-",26)[0]??"-")}</text>`)}),{markup:b.join(""),nextY:h+ls(e)}}case"section":return{markup:`<text x="${ro}" y="${h+16}" class="section">${Pt(e.text)}</text><line x1="${ro}" y1="${h+21}" x2="${Ql}" y2="${h+21}" class="hline" />`,nextY:h+ls(e)};case"check":return{markup:`<text x="${ro}" y="${h+10}" class="td">${e.checked?"\u2611":"\u2610"}</text><text x="${ro+14}" y="${h+10}" class="${e.checked?"td done":"td"}">${Pt(e.text)}</text>`,nextY:h+ls(e)};default:return{markup:`<text x="${ro}" y="${h+10}" class="${e.muted?"td done":"td"}">${Pt(e.text)}</text>`,nextY:h+ls(e)}}}async function oT(e,h){let b=rT(tT(h));return b.map((l,o)=>{let s=o===0?_n:un,r=[o===0?Ro(e,"",Sd):`<text x="${ro}" y="${un-12}" class="doc-meta">${Pt(`${h.title} (\uC774\uC5B4\uC11C)`)}</text>`];for(let t of l){let n=nT(t,s);r.push(n.markup),s=n.nextY}return Oo({width:Sd,height:P0,body:r.join(""),pageIndex:o,pageCount:b.length})})}var Cd=ca,z0=ua,ec=Nr,ma=Cd-Nr,L0=z0-46,j0=210,ei=20,Td=24;function ti(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let h=new Date(`${e}T00:00:00`);return Number.isNaN(h.getTime())?null:h}function F0(e,h){return Math.round((h.getTime()-e.getTime())/864e5)}function iT(e,h){let b=[];e.forEach(r=>{let t=ti(r.startDate),n=ti(r.dueDate);t&&b.push(t),n&&b.push(n)});let l=ti(h)??new Date;if(b.length===0)return{start:l,days:30};let o=new Date(Math.min(...b.map(r=>r.getTime()))),s=new Date(Math.max(...b.map(r=>r.getTime())));return o.setDate(o.getDate()-1),s.setDate(s.getDate()+1),{start:o,days:Math.max(7,F0(o,s)+1)}}async function sT(e,h,b){let l=iT(h,b),o=ec+j0,r=(ma-o)/l.days,t=ti(b),n=f=>o+F0(l.start,f)*r,c=Math.max(1,Math.floor((L0-_n-Td)/ei)),i=Math.max(1,Math.floor((L0-un-Td)/ei)),a=[],d=0;for(;d<h.length||a.length===0;){let f=a.length===0?c:i;if(a.push(h.slice(d,d+f)),d+=f,d>=h.length)break}return a.map((f,u)=>{let g=u===0?_n:un,m=[u===0?Ro(e,`\uC804\uCCB4 ${h.length}\uAC74`,Cd):""],x=g+Td;m.push(`<line x1="${ec}" y1="${x}" x2="${ma}" y2="${x}" class="vline" />`);for(let _=0;_<l.days;_+=1){let B=new Date(l.start);if(B.setDate(B.getDate()+_),B.getDay()!==0&&_!==0)continue;let A=o+_*r;m.push(`<line x1="${A}" y1="${x}" x2="${A}" y2="${x+f.length*ei}" class="hline" />`,`<text x="${A+2}" y="${x-6}" class="label">${B.getMonth()+1}.${B.getDate()}</text>`)}if(t&&t>=l.start){let _=n(t);_>=o&&_<=ma&&m.push(`<line x1="${_}" y1="${x}" x2="${_}" y2="${x+f.length*ei}" stroke="#f87171" stroke-width="0.8" />`)}return f.forEach((_,B)=>{let A=x+B*ei,j=ki(_.title,j0-64,9);m.push(`<text x="${ec}" y="${A+14}" class="${_.completed?"td done":"td"}">${Pt(j)}</text>`,`<text x="${o-6}" y="${A+14}" class="label" text-anchor="end">${Pt(_.managerName)}</text>`,`<line x1="${ec}" y1="${A+ei}" x2="${ma}" y2="${A+ei}" class="hline" />`);let D=ti(_.startDate)??ti(_.dueDate),P=ti(_.dueDate)??ti(_.startDate);if(!D||!P)return;let N=n(D),q=Math.max(N+r*.8,n(P)+r*.8),z=_.completed?"bar done":_.overdue?"bar overdue":"bar";m.push(`<rect x="${N}" y="${A+5}" width="${Math.max(3,Math.min(q,ma)-N)}" height="${ei-10}" rx="2" class="${z}" />`)}),Oo({width:Cd,height:z0,body:m.join(""),pageIndex:u,pageCount:a.length})})}function aT(e,h,b,l){return{title:e.title,managerName:e.managerName,startDate:String(h??"").slice(0,10),dueDate:String(b??"").slice(0,10),completed:e.completed,overdue:!e.completed&&!!b&&String(b).slice(0,10)<l}}var Bd=aa,$0=la,cs=Nr,tc=Bd-Nr,q0=$0-46,us=30,ds=18,H0=12;function lT(e){let h=[],b=[],l=_n,o=(s,r)=>{h.push(b),b=[],l=un,s&&(b.push({kind:"column",label:s,summary:r,continued:!0,gapBefore:!1}),l+=us)};for(let s of e){let r=b.length>0,t=r?H0:0;if(l+t+us+ds>q0?(o("",""),b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:!1}),l+=us):(b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:r}),l+=t+us),s.items.length===0){b.push({kind:"empty"}),l+=ds;continue}for(let n of s.items)l+ds>q0&&o(s.label,s.summary),b.push({kind:"item",title:n.title,meta:n.meta,completed:n.completed}),l+=ds}return h.push(b),h}async function cT(e,h,b){let l=lT(h);return l.map((o,s)=>{let r=s===0?_n:un,t=[s===0?Ro(e,b,Bd):""];for(let n of o){if(n.kind==="column"){n.gapBefore&&(r+=H0),t.push(`<rect x="${cs}" y="${r}" width="${tc-cs}" height="${us-6}" class="group" />`,`<text x="${cs+6}" y="${r+16}" class="gt">${Pt(n.continued?`${n.label} (\uC774\uC5B4\uC11C)`:n.label)}</text>`,`<text x="${tc-6}" y="${r+16}" class="label" text-anchor="end">${Pt(n.summary)}</text>`),r+=us;continue}if(n.kind==="empty"){t.push(`<text x="${cs+12}" y="${r+12}" class="td done">(\uC5C5\uBB34 \uC5C6\uC74C)</text>`),r+=ds;continue}t.push(`<text x="${cs+12}" y="${r+12}" class="${n.completed?"td done":"td"}">${Pt(ki(n.title,tc-cs-12-120,9))}</text>`,`<text x="${tc-6}" y="${r+12}" class="label" text-anchor="end">${Pt(n.meta)}</text>`),r+=ds}return Oo({width:Bd,height:$0,body:t.join(""),pageIndex:s,pageCount:l.length})})}var uT=[{header:"\uADF8\uB8F9",width:16},{header:"\uC81C\uBAA9",width:44},{header:"\uC0C1\uD0DC",width:10},{header:"\uD504\uB85C\uC81D\uD2B8",width:14},{header:"\uCC45\uC784\uC790",width:10},{header:"\uCC38\uC870\uC790",width:22},{header:"\uC2DC\uC791",width:12},{header:"\uB9C8\uAC10",width:14},{header:"\uC911\uC694\uB3C4",width:8},{header:"\uD560\uC77C",width:8},{header:"\uBE44\uACE0",width:30}],dT="FFEEF2F7",rc="FFCBD5E1";function fT(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()||"\uC5C5\uBB34\uBAA9\uB85D"}async function hT(e,h){let b=await Promise.resolve().then(()=>Q0(U0(),1)),l=new b.Workbook,o=l.addWorksheet("\uC5C5\uBB34\uBAA9\uB85D",{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0,fitToWidth:1,fitToHeight:0}});o.columns=uT.map(i=>({header:i.header,width:i.width})),o.spliceRows(1,0,[`${e.documentTitle}`],[`${e.subtitle} \xB7 ${e.facilityName} \xB7 \uCD9C\uB825 ${ss(e.printedAt)}${e.printedBy?` \xB7 ${e.printedBy}`:""}`]),o.getRow(1).font={bold:!0,size:14},o.getRow(2).font={size:10,color:{argb:"FF6B7280"}};let s=o.getRow(3);s.font={bold:!0,size:10},s.eachCell(i=>{i.fill={type:"pattern",pattern:"solid",fgColor:{argb:dT}},i.alignment={vertical:"middle",horizontal:"center"}}),h.forEach(i=>{i.rows.forEach(a=>{let d=o.addRow([i.label,a.title,a.statusName,a.projectLabel||"\uAE30\uBCF8",a.managerName,a.receiverNamesFull,a.startDate==="-"?"":a.startDate,a.dueDate==="-"?"":a.dueDate,a.priorityName,a.checklist,a.note]);d.font={size:10,color:{argb:a.completed?"FF9CA3AF":"FF111827"}},d.alignment={vertical:"middle",wrapText:!1}})});let r=o.rowCount;for(let i=3;i<=r;i+=1)o.getRow(i).eachCell({includeEmpty:!0},a=>{a.border={top:{style:"thin",color:{argb:rc}},left:{style:"thin",color:{argb:rc}},bottom:{style:"thin",color:{argb:rc}},right:{style:"thin",color:{argb:rc}}}});o.views=[{state:"frozen",ySplit:3}];let t=await l.xlsx.writeBuffer(),n=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),c=ss(e.printedAt).replace(/[: ]/g,"").slice(0,13);return{blob:n,fileName:`${fT(e.documentTitle)}_${c}.xlsx`}}function pT(e){return String(e??"").replace(/<br\s*\/?>(?=.)/gi,`
44
44
  `).replace(/<\/(p|div|li|h[1-6])>/gi,`
45
- `).replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function mT(e,h){let b=vd(e,h);return{title:b.title,ticketNo:String(e.ticket_no??"").trim(),properties:[{label:"\uC0C1\uD0DC",value:b.statusName},{label:"\uD504\uB85C\uC81D\uD2B8",value:b.projectLabel||"\uAE30\uBCF8"},{label:"\uCC45\uC784\uC790",value:b.managerName},{label:"\uCC38\uC870\uC790",value:b.receiverNamesFull},{label:"\uC2DC\uC791\uC77C\uC2DC",value:b.startDate},{label:"\uB9C8\uAC10\uC77C\uC2DC",value:b.dueDate},{label:"\uC911\uC694\uB3C4",value:b.priorityName},{label:"\uC791\uC131\uC790",value:String(e.created_by??"")}],content:pT(e.content),checklist:(e.checklist??[]).map(l=>({label:String(l.label??""),checked:!!l.checked})),comments:(e.comments??[]).map(l=>({author:String(l.author??""),time:String(l.time??""),text:String(l.text??"")})),includeComments:!0}}export{OB as ALL_TASK_VIEWER_ACCOUNT_SEQS,ep as AddLabelDialog,qa as AddTabDialog,Xh as AttachmentUploadGauge,ku as AttachmentUploadPercent,hc as BUG_DEVICE_OPTIONS,bs as BUG_ICON_COLOR,H9 as BUG_KANBAN_COLUMNS,fc as BUG_REPRO_OPTIONS,pc as BUG_RESOLUTION_OPTIONS,ni as BUG_STATUS_OPTIONS,gs as BUG_TASK_ICON,fl as BugPropertiesGrid,Wu as CALENDAR_PROVIDERS,tm as CALENDAR_PROVIDER_LIST,by as COLUMN_WIDTHS,gc as COMPLETED_STATUS_OPTION,un as CONT_BODY_TOP,$u as CUSTOM_TAB_KEY_PREFIX,Uq as CalendarImportDialog,Mq as CalendarLinkDialog,t$ as CalendarSubscribeDialog,Ur as ChartEmptyMessage,jo as CommentBubbleIcon,Oi as ConfirmCountButton,Sm as CumulativeFlowChart,Cf as DATE_REMINDER_OPTIONS,Ww as DEFAULT_COMPACT_COLUMNS,sc as DEFAULT_PROJECT_ICON,zW as DEFAULT_TASKBOX_TAB_ITEMS,so as DEFAULT_TASK_ICON,io as DEFAULT_WORKLOAD_CAPACITY,pu as DRAWER_SECTION_TITLE_FONT_SIZE,CW as DateRangeFilterPopover,bn as DrawerSection,pn as DueDatePickerPopover,Z1 as ENDED_EVENT_STATUS_OPTION,up as EVENT_ICON_COLOR,ar as EVENT_TASK_ICON,u$ as EmployeeSelectDialog,_n as FIRST_BODY_TOP,vc as GROUP_BY_OPTIONS,Ni as GoogleEventChip,gW as GroupByMenuButton,Fa as IconPickerGrid,Dh as InlineAddressInput,_o as InlineTextValue,bc as KANBAN_CLOSED_COLUMN_KEY,ua as LANDSCAPE_HEIGHT,ca as LANDSCAPE_WIDTH,kU as LabelFilterMenu,Sl as LabelSelectMenu,Im as LeadTimeDistributionChart,xs as MANUAL_TASK_STATUS_OPTIONS,Nr as MARGIN_X,lW as MemberFilterMenu,ys as NOTICE_STATUS_OPTIONS,or as NOTICE_TASK_ICON,$d as NO_TASK_ICON,la as PORTRAIT_HEIGHT,aa as PORTRAIT_WIDTH,ac as PROJECT_ICON_OPTIONS,pt as PropertyRow,Ri as RECEIVER_AVATAR_COLORS,Bf as REMINDER_OPTIONS,jr as ReceiverAvatarStack,Mp as RelatedTasksSection,bT as STATUS_KEY_REPLIED,Od as STATUS_KEY_WAITING,UU as ShortcutHelpDialog,Pf as SortableTaskCard,gm as SprintBurndownChart,nW as SprintChartsDialog,Vp as SprintCloseDialog,MU as SprintFilterMenu,vq as SprintManageDialog,hm as SprintVelocityChart,Ei as StatusSelectMenu,kc as TASKBOX_COLUMNS,Bn as TASKBOX_DRAWER_NARROW_MQ,zU as TASKBOX_SHORTCUT_HELP,Hd as TASKBOX_UI_STATE_ID,a0 as TASKBOX_VIEW_LABELS,VO as TASKBOX_VIEW_MODES,Os as TASK_REPEAT_RULE_OPTIONS,nn as TASK_STATUS_OPTIONS,xx as TIME_REMINDER_OPTIONS,Ua as TaskAckListPopover,Ln as TaskActionButton,Ml as TaskActivityDialog,_l as TaskAttachmentsSection,xh as TaskBoxColumnSummary,sD as TaskBoxCompactTable,Uc as TaskBoxGroupBoard,AA as TaskBoxMobileList,dh as TaskBoxMonthAgenda,sh as TaskBoxMonthCalendar,sA as TaskBoxSprintColumnSummary,Of as TaskBoxTable,FW as TaskBoxTabs,bh as TaskBoxTimeline,UO as TaskBoxView,th as TaskBoxWeekCalendar,Ts as TaskCardContent,yl as TaskChecklistSection,vp as TaskCommentInput,xp as TaskCommentsSection,ml as TaskContentEditor,pl as TaskContentTemplateMenu,yU as TaskContextMenu,dl as TaskCorePropertiesGrid,Iu as TaskCreateBody,ej as TaskCreateDrawer,Zm as TaskDateRangeFilter,jp as TaskDetailBody,YF as TaskDetailDrawer,Tp as TaskDetailHeader,zo as TaskIconPickerPopover,No as TaskLabelChips,bl as TaskLinkDialog,Cp as TaskNoteField,Lr as TaskPriorityChip,aV as TaskRuleManageDialog,At as TaskStatusChip,Z9 as TaskStatusChips,IV as TaskTemplateManageDialog,jV as TaskTemplateRunDialog,ng as TaskboxProvider,dm as WorkloadCapacityDialog,Pm as WorkloadChart,Fm as WorkloadPersonTasks,qm as WorkloadPersonTasksDialog,Hm as WorkloadTimelineGrid,Eh as addDaysToDate,Mm as averageWorkload,f6 as buildCalendarFeedUrl,Ka as buildCardBaseSx,wm as buildCumulativeFlow,_m as buildLeadCycleDistribution,Yw as buildPlannedTask,Xd as buildStatusOptionColors,cT as buildTaskColumnsPrintSvgPages,mT as buildTaskDetailPrintData,oT as buildTaskDetailPrintSvgPages,wc as buildTaskGroupSections,XS as buildTaskListPrintSvgPages,hT as buildTaskListXlsx,Ou as buildTaskRelationsModel,K5 as buildTaskShareText,sT as buildTaskTimelinePrintSvgPages,fd as buildTaskboxShortcutHelp,ka as buildTaskboxTheme,Mh as buildTemplateTasks,Ll as buildWorkloadRows,Rm as buildWorkloadTimeline,af as canAssignBugManager,Ra as canClaimTaskItem,lf as canCompleteTaskItem,lo as canEditTaskItem,Ma as canViewTaskItem,Oa as canVolunteerTaskItem,ki as clampPrintText,Au as countTaskRelations,vh as countWorkdays,K1 as createTaskboxTheme,yh as daysLeftUntil,al as defaultRepeatUntil,lc as defaultTaskBoxFormValues,cc as defaultTaskboxUiStateValues,Pt as escapePrintXml,Jl as estimatePrintTextWidth,ip as filterFilesWithinLimit,eM as formatConfirmTime,QO as formatHours,hn as formatKoreanDate,on as formatKoreanDateTime,Bc as formatMonthDay,uD as formatOffsetLabel,xd as formatPrintDate,ss as formatPrintStamp,mn as formatSprintOptionLabel,Gd as getBugDeviceName,Kd as getBugReproName,Sa as getBugResolutionName,J1 as getBugStatusOption,z$ as getDefaultDateRange,vs as getEventDisplayStatusOption,U9 as getNoDueStatusRank,op as getNoticeAckInfo,Yd as getNoticeStatusOption,oL as getNoticeTargetDisplay,m9 as getProjectIconAnchorComponent,wt as getProjectIconComponent,vx as getReminderLabel,Oc as getReminderOptions,Ac as getRemindersLabel,sl as getRepeatRuleLabel,Ba as getStatusOptionsForTask,AU as getTabHeaderConfig,Tc as getTaskBoxColumnDefs,tf as getTaskBoxGridTemplate,J8 as getTaskBoxTabKind,Va as getTaskConfirmInfo,lr as getTaskDisplayStatusOption,Ca as getTaskStatusOption,Ai as groupGoogleEventsByDate,Go as groupSeqFromTabKey,fz as hasRelation,Ip as hasTaskRelations,r_ as htmlToPlainText,H4 as isCustomTabKey,xm as isFlowTask,sf as isOpenPoolTaskItem,zl as isOverCapacity,Em as isOverloaded,mc as isPastEvent,Ta as isTaskDone,W9 as isWaitingTask,Nl as monthsAgoDate,Gn as narrowOrderSx,GF as nowDateTimeString,gw as parseEstimatedHours,Zu as parseTaskTimeMs,jl as pickPersonWorkloadTasks,bi as relationsOf,Ro as renderPrintHeader,Al as resolveCalendarProvider,zn as resolveReminders,_k as resolveRowCapacity,Ii as resolveTaskStatusOptions,dc as resolveTaskboxTheme,xT as resolveWorkloadCapacity,iD as selectDepartmentSharedTasks,Ki as shareTaskText,eA as sumRemainingHours,Tl as summarizeNoticeTargets,aq as tabKeyFromGroupSeq,kn as taskVisibilityOf,vd as toTaskPrintRow,aT as toTimelinePrintRow,Io as toYmd,Ia as toggleLabelKey,za as toggleReminder,ps as useBuildFileUrl,Yh as useTaskAttachmentUploadMeta,Sr as useTaskboxConfig,$1 as useTaskboxForm,jU as useTaskboxShortcuts,ct as useTaskboxTheme,ao as useTaskboxUiState,ms as useUploadMaxMb,tr as wideColumnSx,Oo as wrapPrintPage,as as wrapPrintText};
45
+ `).replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function mT(e,h){let b=vd(e,h);return{title:b.title,ticketNo:String(e.ticket_no??"").trim(),properties:[{label:"\uC0C1\uD0DC",value:b.statusName},{label:"\uD504\uB85C\uC81D\uD2B8",value:b.projectLabel||"\uAE30\uBCF8"},{label:"\uCC45\uC784\uC790",value:b.managerName},{label:"\uCC38\uC870\uC790",value:b.receiverNamesFull},{label:"\uC2DC\uC791\uC77C\uC2DC",value:b.startDate},{label:"\uB9C8\uAC10\uC608\uC815",value:b.dueDate},{label:"\uC911\uC694\uB3C4",value:b.priorityName},{label:"\uC791\uC131\uC790",value:String(e.created_by??"")}],content:pT(e.content),checklist:(e.checklist??[]).map(l=>({label:String(l.label??""),checked:!!l.checked})),comments:(e.comments??[]).map(l=>({author:String(l.author??""),time:String(l.time??""),text:String(l.text??"")})),includeComments:!0}}export{OB as ALL_TASK_VIEWER_ACCOUNT_SEQS,ep as AddLabelDialog,qa as AddTabDialog,Xh as AttachmentUploadGauge,ku as AttachmentUploadPercent,hc as BUG_DEVICE_OPTIONS,bs as BUG_ICON_COLOR,H9 as BUG_KANBAN_COLUMNS,fc as BUG_REPRO_OPTIONS,pc as BUG_RESOLUTION_OPTIONS,ni as BUG_STATUS_OPTIONS,gs as BUG_TASK_ICON,fl as BugPropertiesGrid,Wu as CALENDAR_PROVIDERS,tm as CALENDAR_PROVIDER_LIST,by as COLUMN_WIDTHS,gc as COMPLETED_STATUS_OPTION,un as CONT_BODY_TOP,$u as CUSTOM_TAB_KEY_PREFIX,Uq as CalendarImportDialog,Mq as CalendarLinkDialog,t$ as CalendarSubscribeDialog,Ur as ChartEmptyMessage,jo as CommentBubbleIcon,Oi as ConfirmCountButton,Sm as CumulativeFlowChart,Cf as DATE_REMINDER_OPTIONS,Ww as DEFAULT_COMPACT_COLUMNS,sc as DEFAULT_PROJECT_ICON,zW as DEFAULT_TASKBOX_TAB_ITEMS,so as DEFAULT_TASK_ICON,io as DEFAULT_WORKLOAD_CAPACITY,pu as DRAWER_SECTION_TITLE_FONT_SIZE,CW as DateRangeFilterPopover,bn as DrawerSection,pn as DueDatePickerPopover,Z1 as ENDED_EVENT_STATUS_OPTION,up as EVENT_ICON_COLOR,ar as EVENT_TASK_ICON,u$ as EmployeeSelectDialog,_n as FIRST_BODY_TOP,vc as GROUP_BY_OPTIONS,Ni as GoogleEventChip,gW as GroupByMenuButton,Fa as IconPickerGrid,Dh as InlineAddressInput,_o as InlineTextValue,bc as KANBAN_CLOSED_COLUMN_KEY,ua as LANDSCAPE_HEIGHT,ca as LANDSCAPE_WIDTH,kU as LabelFilterMenu,Sl as LabelSelectMenu,Im as LeadTimeDistributionChart,xs as MANUAL_TASK_STATUS_OPTIONS,Nr as MARGIN_X,lW as MemberFilterMenu,ys as NOTICE_STATUS_OPTIONS,or as NOTICE_TASK_ICON,$d as NO_TASK_ICON,la as PORTRAIT_HEIGHT,aa as PORTRAIT_WIDTH,ac as PROJECT_ICON_OPTIONS,pt as PropertyRow,Ri as RECEIVER_AVATAR_COLORS,Bf as REMINDER_OPTIONS,jr as ReceiverAvatarStack,Mp as RelatedTasksSection,bT as STATUS_KEY_REPLIED,Od as STATUS_KEY_WAITING,UU as ShortcutHelpDialog,Pf as SortableTaskCard,gm as SprintBurndownChart,nW as SprintChartsDialog,Vp as SprintCloseDialog,MU as SprintFilterMenu,vq as SprintManageDialog,hm as SprintVelocityChart,Ei as StatusSelectMenu,kc as TASKBOX_COLUMNS,Bn as TASKBOX_DRAWER_NARROW_MQ,zU as TASKBOX_SHORTCUT_HELP,Hd as TASKBOX_UI_STATE_ID,a0 as TASKBOX_VIEW_LABELS,VO as TASKBOX_VIEW_MODES,Os as TASK_REPEAT_RULE_OPTIONS,nn as TASK_STATUS_OPTIONS,xx as TIME_REMINDER_OPTIONS,Ua as TaskAckListPopover,Ln as TaskActionButton,Ml as TaskActivityDialog,_l as TaskAttachmentsSection,xh as TaskBoxColumnSummary,sD as TaskBoxCompactTable,Uc as TaskBoxGroupBoard,AA as TaskBoxMobileList,dh as TaskBoxMonthAgenda,sh as TaskBoxMonthCalendar,sA as TaskBoxSprintColumnSummary,Of as TaskBoxTable,FW as TaskBoxTabs,bh as TaskBoxTimeline,UO as TaskBoxView,th as TaskBoxWeekCalendar,Ts as TaskCardContent,yl as TaskChecklistSection,vp as TaskCommentInput,xp as TaskCommentsSection,ml as TaskContentEditor,pl as TaskContentTemplateMenu,yU as TaskContextMenu,dl as TaskCorePropertiesGrid,Iu as TaskCreateBody,ej as TaskCreateDrawer,Zm as TaskDateRangeFilter,jp as TaskDetailBody,YF as TaskDetailDrawer,Tp as TaskDetailHeader,zo as TaskIconPickerPopover,No as TaskLabelChips,bl as TaskLinkDialog,Cp as TaskNoteField,Lr as TaskPriorityChip,aV as TaskRuleManageDialog,At as TaskStatusChip,Z9 as TaskStatusChips,IV as TaskTemplateManageDialog,jV as TaskTemplateRunDialog,ng as TaskboxProvider,dm as WorkloadCapacityDialog,Pm as WorkloadChart,Fm as WorkloadPersonTasks,qm as WorkloadPersonTasksDialog,Hm as WorkloadTimelineGrid,Eh as addDaysToDate,Mm as averageWorkload,f6 as buildCalendarFeedUrl,Ka as buildCardBaseSx,wm as buildCumulativeFlow,_m as buildLeadCycleDistribution,Yw as buildPlannedTask,Xd as buildStatusOptionColors,cT as buildTaskColumnsPrintSvgPages,mT as buildTaskDetailPrintData,oT as buildTaskDetailPrintSvgPages,wc as buildTaskGroupSections,XS as buildTaskListPrintSvgPages,hT as buildTaskListXlsx,Ou as buildTaskRelationsModel,K5 as buildTaskShareText,sT as buildTaskTimelinePrintSvgPages,fd as buildTaskboxShortcutHelp,ka as buildTaskboxTheme,Mh as buildTemplateTasks,Ll as buildWorkloadRows,Rm as buildWorkloadTimeline,af as canAssignBugManager,Ra as canClaimTaskItem,lf as canCompleteTaskItem,lo as canEditTaskItem,Ma as canViewTaskItem,Oa as canVolunteerTaskItem,ki as clampPrintText,Au as countTaskRelations,vh as countWorkdays,K1 as createTaskboxTheme,yh as daysLeftUntil,al as defaultRepeatUntil,lc as defaultTaskBoxFormValues,cc as defaultTaskboxUiStateValues,Pt as escapePrintXml,Jl as estimatePrintTextWidth,ip as filterFilesWithinLimit,eM as formatConfirmTime,QO as formatHours,hn as formatKoreanDate,on as formatKoreanDateTime,Bc as formatMonthDay,uD as formatOffsetLabel,xd as formatPrintDate,ss as formatPrintStamp,mn as formatSprintOptionLabel,Gd as getBugDeviceName,Kd as getBugReproName,Sa as getBugResolutionName,J1 as getBugStatusOption,z$ as getDefaultDateRange,vs as getEventDisplayStatusOption,U9 as getNoDueStatusRank,op as getNoticeAckInfo,Yd as getNoticeStatusOption,oL as getNoticeTargetDisplay,m9 as getProjectIconAnchorComponent,wt as getProjectIconComponent,vx as getReminderLabel,Oc as getReminderOptions,Ac as getRemindersLabel,sl as getRepeatRuleLabel,Ba as getStatusOptionsForTask,AU as getTabHeaderConfig,Tc as getTaskBoxColumnDefs,tf as getTaskBoxGridTemplate,J8 as getTaskBoxTabKind,Va as getTaskConfirmInfo,lr as getTaskDisplayStatusOption,Ca as getTaskStatusOption,Ai as groupGoogleEventsByDate,Go as groupSeqFromTabKey,fz as hasRelation,Ip as hasTaskRelations,r_ as htmlToPlainText,H4 as isCustomTabKey,xm as isFlowTask,sf as isOpenPoolTaskItem,zl as isOverCapacity,Em as isOverloaded,mc as isPastEvent,Ta as isTaskDone,W9 as isWaitingTask,Nl as monthsAgoDate,Gn as narrowOrderSx,GF as nowDateTimeString,gw as parseEstimatedHours,Zu as parseTaskTimeMs,jl as pickPersonWorkloadTasks,bi as relationsOf,Ro as renderPrintHeader,Al as resolveCalendarProvider,zn as resolveReminders,_k as resolveRowCapacity,Ii as resolveTaskStatusOptions,dc as resolveTaskboxTheme,xT as resolveWorkloadCapacity,iD as selectDepartmentSharedTasks,Ki as shareTaskText,eA as sumRemainingHours,Tl as summarizeNoticeTargets,aq as tabKeyFromGroupSeq,kn as taskVisibilityOf,vd as toTaskPrintRow,aT as toTimelinePrintRow,Io as toYmd,Ia as toggleLabelKey,za as toggleReminder,ps as useBuildFileUrl,Yh as useTaskAttachmentUploadMeta,Sr as useTaskboxConfig,$1 as useTaskboxForm,jU as useTaskboxShortcuts,ct as useTaskboxTheme,ao as useTaskboxUiState,ms as useUploadMaxMb,tr as wideColumnSx,Oo as wrapPrintPage,as as wrapPrintText};
46
46
  /*! Bundled license information:
47
47
 
48
48
  exceljs/dist/exceljs.min.js: