@26lights/orcha 0.42.106 → 0.42.107

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/orcha.cjs.js CHANGED
@@ -55,4 +55,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55
55
  * vue-color-kit v1.0.6
56
56
  * (c) 2023
57
57
  * @license MIT
58
- */function Ao(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=yfe(t):/rgb/.test(t)?e=dp(t):typeof t=="string"?e=dp(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:s}=e,{h:a,s:l,v:c}=_fe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function td(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function Zc(t,e,n,o,r,s){const a=t==="l",l=e.createLinearGradient(0,0,a?n:0,a?0:o);l.addColorStop(.01,r),l.addColorStop(.99,s),e.fillStyle=l,e.fillRect(0,0,n,o)}function vfe({r:t,g:e,b:n},o){const r=a=>("0"+Number(a).toString(16)).slice(-2),s=`#${r(t)}${r(e)}${r(n)}`;return o?s.toUpperCase():s}function yfe(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function dp(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function _fe({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),s=o-r;let a=0;o===r?a=0:o===t?e>=n?a=60*(e-n)/s:a=60*(e-n)/s+360:o===e?a=60*(n-t)/s+120:o===n&&(a=60*(t-e)/s+240),a=Math.floor(a);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:a,s:l,v:c}}var nd=i.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),Zc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Zc("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=a=>{let l=a.clientX-n,c=a.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const u=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,f,p]=u.data;this.$emit("selectSaturation",{r:d,g:f,b:p})};r(t);const s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}});const Cfe={ref:"canvasSaturation"};function bfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectSaturation&&t.selectSaturation(...a),["prevent","stop"]))},[i.createVNode("canvas",Cfe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}nd.render=bfe;nd.__file="src/color/Saturation.vue";var od=i.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=s=>{let a=s.clientY-e;a<0&&(a=0),a>this.height&&(a=this.height),this.slideHueStyle={top:a-2+"px"};const l=n.getImageData(0,Math.min(a,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const kfe={ref:"canvasHue"};function wfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectHue&&t.selectHue(...a),["prevent","stop"]))},[i.createVNode("canvas",kfe,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}od.render=wfe;od.__file="src/color/Hue.vue";var rd=i.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=td(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),Zc("p",s,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let s=r.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height);let a=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",a)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const Efe={ref:"canvasAlpha"};function xfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectAlpha&&t.selectAlpha(...a),["prevent","stop"]))},[i.createVNode("canvas",Efe,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}rd.render=xfe;rd.__file="src/color/Alpha.vue";var id=i.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=td(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),s.fillStyle=this.color,s.fillRect(0,0,e,n)}}});function Sfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}id.render=Sfe;id.__file="src/color/Preview.vue";var sd=i.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:s,height:a}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,a-1),1,1);let[f,p,m,h]=d.data;h=parseFloat((h/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${f}, ${p}, ${m}, ${h})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:s,width:a,height:l}=t.getBoundingClientRect(),c=n-s,u=o-r,f=t.getContext("2d").getImageData(Math.min(c,a-1),Math.min(u,l-1),1,1);let[p,m,h,g]=f.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:p,g:m,b:h,a:g})}))}}});const Tfe=i.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),Afe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},Nfe=i.createVNode("g",{fill:"none","fill-rule":"evenodd"},[i.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[i.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),i.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[i.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function Dfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[t.isSucking?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...a)=>t.openSucker&&t.openSucker(...a))},[Tfe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",Afe,[Nfe])):i.createCommentVNode("v-if",!0)])}sd.render=Dfe;sd.__file="src/color/Sucker.vue";var ad=i.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:i.computed({get(){return t.color||""},set(s){e("inputColor",s)}}),handleFocus:s=>{e("inputFocus",s)},handleBlur:s=>{e("inputBlur",s)}}}});const Mfe={class:"color-type"},Bfe={class:"name"};function $fe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",Mfe,[i.createVNode("span",Bfe,i.toDisplayString(t.name),1),i.withDirectives(i.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.modelColor=a),class:"value",onFocus:e[2]||(e[2]=(...a)=>t.handleFocus&&t.handleFocus(...a)),onBlur:e[3]||(e[3]=(...a)=>t.handleBlur&&t.handleBlur(...a))},null,544),[[i.vModelText,t.modelColor]])])}ad.render=$fe;ad.__file="src/color/Box.vue";var ld=i.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=i.ref(),o=i.ref([]),r=i.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=td(4).toDataURL(),i.onUnmounted(()=>{s(n.value)});function s(l){if(!l)return;const c=o.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function a(l){e("selectColor",l)}return{setColorsHistory:s,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:a}}});const Ofe={class:"colors"},Lfe={key:0,class:"colors history"};function Ife(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[i.createVNode("ul",Ofe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsDefault,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(i.openBlock(),i.createBlock("ul",Lfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsHistory,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))])):i.createCommentVNode("v-if",!0)])}ld.render=Ife;ld.__file="src/color/Colors.vue";var Ar=i.defineComponent({components:{Saturation:nd,Hue:od,Alpha:rd,Preview:id,Sucker:sd,Box:ad,Colors:ld},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return vfe(this.rgba,!0)}},created(){Object.assign(this,Ao(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Pfe={class:"color-set"};function Ffe(t,e,n,o,r,s){const a=i.resolveComponent("Saturation"),l=i.resolveComponent("Hue"),c=i.resolveComponent("Alpha"),u=i.resolveComponent("Preview"),d=i.resolveComponent("Sucker"),f=i.resolveComponent("Box"),p=i.resolveComponent("Colors");return i.openBlock(),i.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[i.createVNode("div",Pfe,[i.createVNode(a,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),i.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),i.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),i.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[i.createVNode(u,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock(d,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),i.createVNode(f,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(f,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(p,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),i.createCommentVNode(" custom options "),i.renderSlot(t.$slots,"default")],6)}Ar.render=Ffe;Ar.__file="src/color/ColorPicker.vue";Ar.install=t=>{t.component(Ar.name,Ar)};const Vfe={class:"color-picker-wrapper"},pl=i.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null),a=i.ref(null),l=i.ref(0),c=i.ref(0),u=async h=>{a.value=h,r.value=!0,await i.nextTick();const g=h.getBoundingClientRect(),y=s.value,C=(y==null?void 0:y.offsetHeight)||300,v=window.innerHeight-g.bottom,_=g.top,k=v<C&&_>C;console.log("pickerHeight = "+C),l.value=k?g.top-C-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",f)},0)},d=i.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),f=h=>{const g=h.target;s.value&&!s.value.contains(g)&&(r.value=!1,o("update:color",p.value),window.removeEventListener("click",f))};i.onBeforeUnmount(()=>{window.removeEventListener("click",f)}),i.watch(()=>n.color,h=>{r.value||(p.value=h)});const p=i.ref(n.color),m=h=>{const{r:g,g:y,b:C,a:v}=h.rgba;p.value=`rgba(${g}, ${y}, ${C}, ${v})`};return(h,g)=>(i.openBlock(),i.createElementBlock("div",Vfe,[i.renderSlot(h.$slots,"clickable",{openPicker:u,bgColor:t.color}),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:i.normalizeStyle(d.value)},[i.createVNode(i.unref(Ar),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const Rfe={class:"ao-card-project-phase__header"},zfe={class:"ao-card-project-item__title-line"},Ufe={key:0,class:"ao-card-project-item-phase__estimation"},qfe={class:"ao-card-project-phase__footer"},Hfe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},jfe={class:"ao-card-project-phase__subitem"},Wfe={class:"ao-card-project-phase__subitem"},Zfe={key:0,class:"ao-card-project-phase__secondary"},Kfe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},Gfe=i.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Da(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===Li.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y(C)};return(g,y)=>(i.openBlock(),i.createBlock(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",zfe,[i.createVNode(ft,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",Ufe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",qfe,[u.value?(i.openBlock(),i.createElementBlock("div",Hfe,[i.createElementVNode("div",jfe,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Wfe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Zfe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-card-project-phase__footer-row",p.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Kfe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Rfe,[i.createVNode(ge,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Yfe=i.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{class:"aoBadge",style:i.normalizeStyle({backgroundColor:t.color})},null,4))}});const Jfe={class:"ao-card-project-milestone__default"},Xfe={class:"ao-title-with-badge-wrapper"},Qfe={class:"ao-card-project-item__title-line"},epe={key:0,class:"ao-card-project-item-milestone__estimation"},tpe={key:0,class:"ao-card-project-milestone__archive"},npe={class:"ao-card-project-milestone__activities"},ope={class:"ao-card-project-milestone__activities-row"},rpe={class:"ao-card-project-milestone__subitem"},ipe={class:"ao-card-project-milestone__subitem"},spe={key:1,class:"ao-card-project-milestone__secondary"},ape={class:"ao-card-project-milestone__footer"},lpe={key:1,class:"ao-field ao-card-project-milestone__deadline"},cpe={class:"ao-field__label"},upe={key:2,class:"ao-card-project-milestone__assignee"},dpe=i.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var p;return((p=n.activities)==null?void 0:p.reduce((m,h)=>m+(h.estimation||0),0))||0}),s=i.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((p,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return p+((h==null?void 0:h.timeSpent)||0)},0)),a=i.computed(()=>n.estimationUnit==="days"?"d":"h"),l=i.computed(()=>Da(s.value,n.estimationUnit));i.computed(()=>{const p=s.value/60;return p%1===0?p.toString():p.toFixed(2)});const c=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.length}),u=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.filter(m=>Jc(m,n.closedStatus)).length}),d=i.computed(()=>(u.value||0)/(c.value||1)),f=p=>{o("updateMilestone",{id:n.id,name:p})};return(p,m)=>(i.openBlock(),i.createBlock(dl,{class:i.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:i.withCtx(()=>[i.createElementVNode("div",Jfe,[i.createElementVNode("div",Xfe,[i.createVNode(Yfe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",Qfe,[i.createVNode(ft,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":f},null,8,["id","title","is-editable"]),r.value||s.value?(i.openBlock(),i.createElementBlock("span",epe," ("+i.toDisplayString(l.value)+"/"+i.toDisplayString(r.value)+i.toDisplayString(a.value)+")",1)):i.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(i.openBlock(),i.createElementBlock("div",tpe,[i.createVNode(ge,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=i.withModifiers(()=>t.active?p.$emit("archiveMilestone",{id:t.id}):p.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",npe,[i.createElementVNode("div",ope,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",rpe,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",ipe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(fl,{percentages:d.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):i.createCommentVNode("",!0),p.$slots.secondary?(i.openBlock(),i.createElementBlock("div",spe,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",ape,[t.important?(i.openBlock(),i.createBlock(be,{key:0,name:"FlagRounded",class:i.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):i.createCommentVNode("",!0),t.deadline?(i.openBlock(),i.createElementBlock("label",lpe,[i.createElementVNode("span",cpe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",upe,[i.createVNode(jn,{"user-name":i.unref(Op)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):i.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const fpe={class:"ao-mapping-card-project-phase__header"},ppe={class:"ao-card-project-item__title-line"},mpe={key:0,class:"ao-card-project-item-phase__estimation"},hpe={class:"ao-mapping-card-project-phase__footer"},gpe={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},vpe={class:"ao-mapping-card-project-phase__subitem"},ype={class:"ao-mapping-card-project-phase__subitem"},_pe={key:0,class:"ao-mapping-card-project-phase__secondary"},Cpe={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},bpe=i.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Da(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===Li.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y()};return(g,y)=>(i.openBlock(),i.createBlock(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",ppe,[i.createVNode(ft,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",mpe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",hpe,[u.value?(i.openBlock(),i.createElementBlock("div",gpe,[i.createElementVNode("div",vpe,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",ype,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{percentages:f.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",_pe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-mapping-card-project-phase__footer-row",p.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Cpe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",fpe,[i.createVNode(ge,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const kpe={class:"ao-project-phase"},wpe={key:0,class:"ao-project-phase__drag ao-card__drag"},Epe={key:1,class:"ao-project-phase__col-phase"},xpe={key:2,class:"ao-mapping-project-phase__col-phase"},Spe={key:0,class:"ao-project-phase__col-milestones"},Tpe=["title"],Ape={class:"ao-project-phase__milestones-list-footer"},Npe=i.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e;i.watch(()=>o.phase.milestones,(w,b)=>{Vn(w,b)});const s=w=>{r("updatePhase",{id:o.phase.id,name:w})},a=w=>{r("updatePhase",{id:o.phase.id,deadline:w})},l=w=>{r("updatePhase",w)},c=i.computed(()=>o.phase.milestones.map(w=>v_(w,o.closedStatus))),u=w=>{const{name:b,rank:E}=qo(c.value??[],"milestone",n);r("addMilestone",{name:b,rank:E,phaseId:w})},d=w=>{const b=n("template.defaultName.milestone",{idx:1}),E=es(c.value??[]);r("addMilestone",{name:b,rank:E,phaseId:w})},f=w=>{r("updateMilestone",w)},p=w=>{r("archiveMilestone",w)},m=w=>{r("unarchiveMilestone",w)},h=w=>{r("archivePhase",w)},g=w=>{r("unarchivePhase",w)},y=w=>{"added"in w?r("updateMilestone",{id:w.added.element.id,phaseId:o.phase.id,rank:Dr(c.value,w.added.newIndex)}):"removed"in w||"moved"in w&&r("updateMilestone",{id:w.moved.element.id,rank:Dr(c.value,w.moved.newIndex)})},C=Nr.useRoute(),v=i.computed(()=>C.path.includes("/mapping")),_=i.computed(()=>{var w;return o.phase.id===((w=C.params)==null?void 0:w.phaseId)});i.ref(!1);const k=i.computed(()=>{var w;return o.phase.id!==((w=C.params)==null?void 0:w.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:__(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(w,b)=>(i.openBlock(),i.createElementBlock("li",kpe,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",wpe,[i.createVNode(be,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("div",xpe,[i.createVNode(bpe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(i.openBlock(),i.createElementBlock("div",Epe,[i.createVNode(Gfe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),v.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Spe,[i.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":_.value}]),title:w.$t("project.milestone.add"),onClick:b[0]||(b[0]=()=>d(t.phase.id))},[i.createVNode(be,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,Tpe)):i.createCommentVNode("",!0),i.createVNode(i.unref(go),i.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},w.$attrs,{onChange:y}),{item:i.withCtx(({element:E})=>{var T;return[i.createVNode(dpe,{id:E.id,name:E.name,color:E.color,"phase-color":t.phase.color,activities:E.activities,deadline:E.deadline,active:E.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":E.id===((T=w.$route.params)==null?void 0:T.milestoneId),assignee:E.assignee,important:E.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:i.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&w.$router.push({name:i.unref(Oe).milestone,params:{phaseId:t.phase.id,milestoneId:E.id}}),onUpdateMilestone:f,onArchiveMilestone:p,onUnarchiveMilestone:m},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),i.createElementVNode("div",Ape,[t.isEditable?(i.openBlock(),i.createBlock(vo,{key:0,label:w.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:b[1]||(b[1]=()=>u(t.phase.id))},null,8,["label"])):i.createCommentVNode("",!0)])],4)]))]))}});const Dpe={class:"ao-project__phases"},Mpe={key:0,class:"ao-project-phase__phases-list-footer"},Bpe={class:"ao-project-phase__col-phase"},cd=i.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;i.watch(()=>n.phases,(m,h)=>{Vn(m,h)});const r=m=>{o("addMilestone",m)},s=m=>{o("updateMilestone",m)},a=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},u=m=>{o("unarchivePhase",m)},d=m=>{if(m.moved){const h=Qi(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},f=m=>{o("updatePhase",m)},p=m=>{o("addPhase",m)};return(m,h)=>(i.openBlock(),i.createElementBlock("div",Dpe,[i.createVNode(i.unref(go),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:d},{item:i.withCtx(({element:g})=>[i.createVNode(Npe,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:s,onArchiveMilestone:a,onUnarchiveMilestone:l,onUpdatePhase:f,onArchivePhase:c,onUnarchivePhase:u},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Mpe,[h[0]||(h[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",Bpe,[i.createVNode(vo,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),h[1]||(h[1]=i.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):i.createCommentVNode("",!0)]))}});const $pe={class:"ao-add-template-modal__form-body"},Ope={class:"field__row"},Lpe={class:"ao-add-template-modal__form-footer"},Vg=i.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),s=i.ref(null),a=c=>{s.value=c},l=()=>{s.value&&o("apply",s.value,n.projectId)};return(c,u)=>(i.openBlock(),i.createBlock(Ba,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ft,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("p",null,i.toDisplayString(c.$t("project.template.apply.notice")),1),i.createElementVNode("div",$pe,[i.createElementVNode("div",Ope,[i.createVNode(Ct,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",Lpe,[i.createVNode(ge,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const Ipe={class:"ao-save-template-modal__form-body"},Ppe={class:"field__row"},Fpe={class:"ao-field ao-field--inline"},Vpe={class:"ao-field__label"},Rpe={class:"ao-save-template-modal__phases"},zpe={class:"ao-field__label"},Upe={class:"ao-save-template-modal__phases-list"},qpe=["value"],Hpe={class:"ao-save-template-modal__form-footer"},Rg=i.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(""),s=i.ref([]);i.onMounted(()=>{s.value=n.phases.map(l=>l.id)});const a=()=>{r.value&&o("save",r.value,s.value)};return(l,c)=>(i.openBlock(),i.createBlock(Ba,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ft,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:i.withModifiers(a,["prevent"])},[i.createElementVNode("div",Ipe,[i.createElementVNode("div",Ppe,[i.createElementVNode("label",Fpe,[i.createElementVNode("span",Vpe,i.toDisplayString(l.$t("project.template.name.label"))+": ",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),type:"text"},null,512),[[i.vModelText,r.value]])])]),i.createElementVNode("div",Rpe,[i.createElementVNode("div",zpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",Upe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.phases,u=>(i.openBlock(),i.createElementBlock("label",{key:u.id,class:"ao-field ao-field--checkbox"},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=d=>s.value=d),type:"checkbox",value:u.id},null,8,qpe),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",Hpe,[i.createVNode(ge,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const jpe={class:"ao-project"},Wpe={class:"ao-project__body"},Zpe=i.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(F=>F.milestones)),a=()=>{const{name:F,rank:Q}=qo(o.phases,"phase",n);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},l=()=>{const F=n("template.defaultName.phase",{idx:1}),Q=es(o.phases);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},c=F=>{r("updatePhase",F)},u=F=>{r("archivePhase",F)},d=F=>{r("unarchivePhase",F)},f=F=>{r("copyPhaseToTemplate",F)},p=F=>{r("addMilestone",F)},m=F=>{r("updateMilestone",F)},h=F=>{r("archiveMilestone",F)},g=F=>{r("unarchiveMilestone",F)},y=F=>{r("addActivity",F)},C=F=>{r("update:activity",F)},v=F=>{r("archiveActivity",F)},_=F=>{r("unarchiveActivity",F)},k=F=>{r("addSubtask",F)},w=F=>{r("updateSubtask",F)},b=F=>{r("deleteSubtask",F)},E=i.computed(()=>s.value.flatMap(F=>F.activities)),T=F=>{r("addFiles",F)},S=F=>{r("removeFile",F)},N=F=>{r("addComment",F)},L=F=>{r("updateComment",F)},A=F=>{r("removeComment",F)},D=i.ref(!1),M=i.ref(!1),I=(F,Q)=>{r("applyTemplate",{templateId:F,projectId:Q}),D.value=!1},P=(F,Q)=>{var se;const ee=(se=o.templates)==null?void 0:se.at(-1),me=ee?tt.LexoRank.parse(ee.rank).genNext():tt.LexoRank.middle();r("saveTemplate",{templateName:F,rank:me.format(),phaseIds:Q}),M.value=!1},j=Nr.useRouter(),V=i.ref("overview"),U=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(V,F=>{F==="feed"?(j.push({name:Oe.feed}),console.log("Navigating to feed...")):F==="dev"?(j.push({name:Oe.dev}),console.log("Navigating to dev...")):F==="overview"?(j.push({name:Oe.project}),console.log("Navigating to feed...")):F==="mapping"&&(j.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(F,Q)=>{var me;const ee=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},F.$attrs),[i.createElementVNode("div",jpe,[i.createVNode(ts,null,{primary:i.withCtx(()=>[i.createVNode(ms,{modelValue:V.value,"onUpdate:modelValue":Q[0]||(Q[0]=se=>V.value=se),tabs:U},null,8,["modelValue"]),i.createVNode(ge,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=se=>F.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("project.phase.add"),onClick:l},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:1,class:"ao-project-overview__save-as-template",color:"primary",label:F.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=se=>M.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:2,class:"ao-project-overview__add-template",color:"primary",label:F.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=se=>D.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Wpe,[i.createVNode(cd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(me=t.project)==null?void 0:me.estimationUnit,onAddMilestone:p,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:a,onUpdatePhase:c,onArchivePhase:u,onUnarchivePhase:d,onCopyPhaseToTemplate:f},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),i.createVNode(ee,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:Q[4]||(Q[4]=se=>F.$router.push({name:i.unref(Oe).project})),onUpdateMilestone:m,onAddActivity:y,onUpdateActivity:C,onArchiveActivity:v,onUnarchiveActivity:_},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(ee,{name:"modal",activities:E.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":t.loadAttachmentPreview,"onUpdate:activity":C,onAddSubtask:k,onUpdateSubtask:w,onDeleteSubtask:b,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:L,onRemoveComment:A},{default:i.withCtx(({Component:se})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(se),null,{default:i.withCtx(ae=>[i.renderSlot(F.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(ae)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data","load-attachment-preview"])]))],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[M.value?(i.openBlock(),i.createBlock(Rg,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=se=>M.value=!1),onSave:P},null,8,["phases"])):i.createCommentVNode("",!0),D.value?(i.openBlock(),i.createBlock(Vg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=se=>D.value=!1),onApply:I},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Kpe={class:"ao-card-feed__header"},Gpe={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},Ype={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Jpe={class:"ao-card-feed__body"},Xpe={key:0,class:"ao-card-feed__breadcrumbs"},Qpe={class:i.normalizeClass(["ao-card-feed__title-group"])},eme={class:"ao-card-feed__title-line"},tme={key:0,class:"ao-card-feed__slug"},nme={key:1,class:"ao-card-feed__deadline"},ome={class:"ao-card-feed__footer"},rme={class:"ao-card-feed__footer-row"},ime={class:"ao-assignees"},sme={key:0,class:"ao-assignee"},ame={key:0,class:"ao-card-feed__subitems"},lme={key:0,class:"ao-card-feed__subitem"},cme={class:"ao-card-feed__subitem"},ume={key:1,class:"ao-card-feed__subitem"},dme={class:"ao-card-feed__subitem"},fme={class:"ao-card-feed__timer-wrapper"},pme={class:"ao-card-feed__footer-row"},mme={key:0,class:"ao-card-feed__progress-wrapper"},hme={class:"ao-card-feed__subitem"},gme={class:"ao-card-feed__subitem"},ud=i.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),s=i.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),a=g=>{o("updateActivity",{id:n.id,name:g})},l=i.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=i.computed(()=>n.assignee?[n.assignee]:[]),u=i.computed(()=>Ma(n.deadline)),d=g=>{o("removeAssignee",g)},f=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},p=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(y=>y.isDone).length}),h=i.computed(()=>(m.value||0)/(p.value||1));return(g,y)=>(i.openBlock(),i.createBlock(dl,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",Kpe,[r.value?(i.openBlock(),i.createBlock(Oi,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):i.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(i.openBlock(),i.createElementBlock("div",Gpe,[t.isPrivate?(i.openBlock(),i.createBlock(be,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(be,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(be,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Ype,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",Jpe,[l.value?(i.openBlock(),i.createElementBlock("span",Xpe,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",Qpe,[i.createElementVNode("div",eme,[t.slug?(i.openBlock(),i.createElementBlock("span",tme,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(ft,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":a},null,8,["id","title","is-editable"])])]),t.deadline?(i.openBlock(),i.createElementBlock("span",nme,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",ome,[i.createElementVNode("div",rme,[i.createElementVNode("ul",ime,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,C=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:C.id},[C?(i.openBlock(),i.createElementBlock("li",sme,[i.createVNode(jn,{"user-name":i.unref(Op)(C),"avatar-url":C.avatarUrl,"is-closable":!0,onClose:()=>d(C.id)},null,8,["user-name","avatar-url","onClose"])])):i.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(i.openBlock(),i.createElementBlock("ul",ame,[t.comments?(i.openBlock(),i.createElementBlock("li",lme,[i.createVNode(be,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",cme,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",ume,[i.createVNode(be,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",dme,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",fme,[i.createVNode(be,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",pme,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",mme,[i.createElementVNode("div",hme,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",gme,i.toDisplayString(m.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(fl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const vme={class:"ao-project-milestone"},yme={class:"ao-project-milestone__header"},_me={class:"ao-project-milestone__header_line"},Cme={class:"ao-project-milestone__header_line"},bme={class:"ao-project-milestone__title"},kme={key:0,class:"ao-fieldset ao-milestone__fieldset"},wme={class:"ao-field__row ao-milestone__field-row"},Eme={class:"ao-field ao-field--inline"},xme={class:"ao-field__row ao-milestone__field-row"},Sme={class:"ao-field ao-milestone__field-multiselect"},Tme={class:"ao-milestone__color-actions"},Ame=["onClick"],Nme=["title"],Dme={class:"ao-project-milestone__body"},Mme={key:0,class:"ao-project-milestone__footer"},fp=i.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e,s=b=>{var E;r("startTimer",b),(E=window.parent)==null||E.postMessage({type:"startTimer",data:b},"*")},a=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.find(E=>E.id===o.phaseId)}),l=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.flatMap(E=>E.milestones)}),c=i.computed(()=>{var b;return(b=l.value)==null?void 0:b.find(E=>E.id===o.milestoneId)}),u=i.computed(()=>{var b;return(b=c.value)==null?void 0:b.activities});i.watch(u,(b,E)=>{Vn(b,E)});const d=b=>{r("close",b)},f=()=>{const{name:b,rank:E}=qo(u.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},p=()=>{const b=n("template.defaultName.activity",{idx:1}),E=es(u.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},m=b=>{r("updateActivity",b)},h=b=>{u.value&&"moved"in b&&r("updateActivity",{id:b.moved.element.id,rank:Dr(u.value,b.moved.newIndex)})},g=i.computed({get:()=>{var b;return(b=c.value)==null?void 0:b.color},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,color:b})}}),y=i.computed({get:()=>{var b;return((b=c==null?void 0:c.value)==null?void 0:b.deadline)??""},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:b!=null&&b.length?b:null})}}),C=b=>o.closedStatus?Jc(b,o.closedStatus):!1,v=i.computed(()=>{var b;return((b=o.users)==null?void 0:b.map(E=>({label:`${E.firstName} ${E.lastName}`,value:E.id,avatar:E.avatarUrl})))||[]}),_=i.computed({get(){var b,E;return(E=(b=c.value)==null?void 0:b.assignee)!=null&&E.id?[c.value.assignee.id]:[]},set(b){r("updateMilestone",{id:o.milestoneId,assigneeId:b[0]??null})}}),k=i.computed({get(){var b;return((b=c.value)==null?void 0:b.important)??!1},set(b){r("updateMilestone",{id:o.milestoneId,important:b})}}),w=(b,E)=>{const T=b.currentTarget;T instanceof HTMLElement&&E(T)};return(b,E)=>{var T;return i.openBlock(),i.createElementBlock("div",vme,[i.createElementVNode("header",yme,[i.createElementVNode("div",_me,[i.createVNode(ge,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",Cme,[i.createElementVNode("div",bme,[i.createVNode(ft,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Pg,{modelValue:k.value,"onUpdate:modelValue":E[0]||(E[0]=S=>k.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:b.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(i.openBlock(),i.createElementBlock("div",kme,[i.createElementVNode("div",wme,[i.createElementVNode("label",Eme,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=S=>y.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,y.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",xme,[i.createElementVNode("label",Sme,[i.createVNode(Ct,{modelValue:_.value,"onUpdate:modelValue":E[2]||(E[2]=S=>_.value=S),options:v.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:b.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:i.withCtx(({option:S,handleTagRemove:N})=>[i.createVNode(jn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:L=>N(S,L)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createElementVNode("div",Tme,[i.createVNode(pl,{color:g.value,"onUpdate:color":E[3]||(E[3]=S=>g.value=S)},{clickable:i.withCtx(({openPicker:S,bgColor:N})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:N}),class:"color-button",onClick:L=>w(L,S)},null,12,Ame)]),_:1},8,["color"]),t.isEditable?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ao-project-milestone__quick-add",title:b.$t("project.activity.add"),onClick:p},[i.createVNode(be,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,Nme)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Dme,[i.createVNode(i.unref(go),i.mergeProps({class:"ao-project-milestone__activities",list:u.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},b.$attrs,{onChange:h}),{item:i.withCtx(({element:S})=>{var N,L,A,D,M;return[i.createVNode(ud,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=a.value)==null?void 0:N.name,"milestone-name":(L=c.value)==null?void 0:L.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:S.deadline,important:S.important,users:t.users,assignee:S.assignee,slug:S.slug,comments:(D=S.comments)==null?void 0:D.length,attachments:(M=S.attachments)==null?void 0:M.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":C(S),onClick:I=>b.$router.push({name:i.unref(Oe).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&S.active?(i.openBlock(),i.createBlock(ge,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("archive"),onClick:i.withModifiers(()=>b.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!S.active?(i.openBlock(),i.createBlock(ge,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>b.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Mme,[i.createVNode(vo,{"icon-name":"Add",label:b.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const Bme=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.find(v=>v.id===n.phaseId)}),s=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.flatMap(v=>v.milestones)}),a=i.computed(()=>{var C;return(C=s.value)==null?void 0:C.find(v=>v.id===n.milestoneId)}),l=i.computed(()=>{var C;return(C=n.activities)==null?void 0:C.find(v=>v.id===n.activityId)}),c=C=>{o("update:activity",C)},u=C=>{o("addSubtask",C)},d=C=>{o("updateSubtask",C)},f=C=>{o("deleteSubtask",C)},p=C=>{o("addFiles",C)},m=C=>{o("removeFile",C)},h=C=>{o("addComment",C)},g=C=>{o("updateComment",C)},y=C=>{o("removeComment",C)};return(C,v)=>{var _,k;return l.value?(i.openBlock(),i.createBlock(ed,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(_=r.value)==null?void 0:_.name} / ${(k=a.value)==null?void 0:k.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,onClose:C.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:y},{default:i.withCtx(w=>[i.renderSlot(C.$slots,"default",i.normalizeProps(i.guardReactiveProps(w)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","onClose"])):i.createCommentVNode("",!0)}}}),$me={class:"ao-col-header"},Ome=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",$me,[i.createVNode(ft,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock(Oi,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function Lme(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function Ea(t){return typeof t=="function"?t():i.unref(t)}const Ime=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Pme=t=>t!=null,$i=()=>{};function Fme(t,e){function n(...o){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(s)})}return n}function Vme(t,e={}){let n,o,r=$i;const s=l=>{clearTimeout(l),r(),r=$i};return l=>{const c=Ea(t),u=Ea(e.maxWait);return n&&s(n),c<=0||u!==void 0&&u<=0?(o&&(s(o),o=null),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,u&&!o&&(o=setTimeout(()=>{n&&s(n),o=null,d(l())},u)),n=setTimeout(()=>{o&&s(o),o=null,d(l())},c)})}}function Rme(t,e=200,n={}){return Fme(Vme(e,n),t)}function ac(t){var e;const n=Ea(t);return(e=n==null?void 0:n.$el)!=null?e:n}const zme=Ime?window:void 0;function Ume(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function qme(t){const e=Ume();return i.computed(()=>(e.value,!!t()))}function Hme(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=zme,immediate:l=!0}=n,c=qme(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const h=Ea(t);return(Array.isArray(h)?h:[h]).map(ac).filter(Pme)});let d=$i;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,ac(o),f.value],([h,g])=>{if(d(),!f.value||!h.length)return;const y=new IntersectionObserver(e,{root:ac(g),rootMargin:r,threshold:s});h.forEach(C=>C&&y.observe(C)),d=()=>{y.disconnect(),d=$i}},{immediate:l,flush:"post"}):$i,m=()=>{d(),p(),f.value=!1};return Lme(m),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:m}}const jme={class:i.normalizeClass(["ao-list-kanban"])},Wme={class:"ao-list-kanban__header"},Zme=["title"],Kme={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Gme={key:1,class:"ao-list-kanban__end"},Yme={key:0,class:"ao-list-kanban__no-more"},Jme={key:1,class:"ao-list-kanban__divider"},Xme={key:1,class:"ao-list-kanban__footer"},Qme=i.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{},showHeaderAdd:{type:Boolean},isDevMode:{type:Boolean}},emits:["add","addAtBeginning","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null);Hme(s,([{isIntersecting:f}])=>{r.value=f}),i.watch(r,f=>{f&&n.hasMore&&!n.isLoading&&o("loadMore")});const a=f=>{var p;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((p=f.assignee)==null?void 0:p.id):!1},l=f=>{o("selectActivity",f)},c=f=>{o("updateActivity",f)},u=f=>{if("added"in f){const p={id:f.added.element.id,rank:Dr(n.list,f.added.newIndex)};n.isDevMode?p.statusDevId=n.status.id:p.statusId=n.status.id,o("updateActivity",p)}else"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:Dr(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",jme,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var m;return[i.createElementVNode("div",Wme,[t.title?(i.openBlock(),i.createBlock(Ome,{key:0,class:"ao-list-kanban__col-header",title:t.title,level:3,items:(m=t.list)==null?void 0:m.length},null,8,["title","items"])):i.createCommentVNode("",!0),t.showHeaderAdd?(i.openBlock(),i.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:f.$t("feed.activity.add"),onClick:p[0]||(p[0]=h=>f.$emit("addAtBeginning"))},[i.createVNode(be,{name:"Add"})],8,Zme)):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(go),i.mergeProps({class:["ao-list-kanban__list",d.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},f.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:u,onStart:p[2]||(p[2]=m=>d.value=!0),onEnd:p[3]||(p[3]=m=>d.value=!1)}),{item:i.withCtx(({element:m})=>{var h,g,y,C,v,_,k,w,b,E;return[i.createVNode(ud,{id:m.id,class:i.normalizeClass(a(m)?"ao-list-draggable":""),name:m.name,"project-name":(h=m.project)==null?void 0:h.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(y=m.project)==null?void 0:y.color,"phase-name":(v=(C=m.milestone)==null?void 0:C.phase)==null?void 0:v.name,"milestone-name":(_=m.milestone)==null?void 0:_.name,"milestone-color":(k=m.milestone)==null?void 0:k.color,deadline:m.deadline,rules:((w=m.rules)==null?void 0:w.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(b=m.comments)==null?void 0:b.length,attachments:(E=m.attachments)==null?void 0:E.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":a(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>a(m)&&c(T),()=>a(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>a(m)&&c({id:m.id,assigneeId:null}),onStartTimer:p[1]||(p[1]=T=>f.$emit("startTimer",T))},{secondary:i.withCtx(()=>[a(m)&&m.active?(i.openBlock(),i.createBlock(ge,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.archive"),onClick:i.withModifiers(()=>f.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),a(m)&&!m.active?(i.openBlock(),i.createBlock(ge,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>f.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:i.withCtx(()=>[t.isLoading?(i.openBlock(),i.createElementBlock("div",Kme,[i.createVNode(be,{name:"Loading"})])):t.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(i.openBlock(),i.createElementBlock("div",Gme,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",Yme,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",Jme)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",Xme,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(vo,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:p[4]||(p[4]=m=>f.$emit("add"))},null,8,["label"])):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]))}});const ehe={class:"ao-field ao-search-field"},the=["value","placeholder"],nhe=i.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const u=l.target.value;o("update:modelValue",u,l)},s=Rme(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",ehe,[i.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...u)=>i.unref(s)&&i.unref(s)(...u)),onKeypress:i.withKeys(r,["enter"])},null,40,the),i.createVNode(be,{name:"SearchRounded",class:i.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),i.createVNode(ge,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:i.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:a},null,8,["class"])]))}});const ohe={class:"ao-feed"},rhe={class:"ao-feed__filters"},ihe={class:"ao-feed__body"},Kc=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e;function s(H,te){r("toast",H,te)}const a=i.toRef(o,"activities"),l=i.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses);i.computed(()=>o.feedMode==="dev"?"devStatus":"status");const c=i.computed(()=>o.feedMode==="dev"?a.value.filter(H=>H.activityType==="dev"):a.value),u=async(H,te)=>{await r("selectActivity",H,te)},d=i.ref({}),f=i.ref(!1),p=i.ref(!1),m=i.computed(()=>o.project?"milestone":"project");i.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([H,te,Le,le],[qe,$])=>{const G=o.feedMode==="dev"?"devStatus":"status";d.value=Object.fromEntries(H.map(de=>[de.id,te.filter(ke=>{const Me=ke[G];return(Me==null?void 0:Me.id)===de.id})])),Le&&!f.value?(u(Le,null),f.value=!0):le&&!f.value&&(u(null,le),f.value=!0),p.value&&Vn(te,$)},{immediate:!0});const h=i.computed(()=>{var H;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((H=o.selectedActivity.milestone.phase)==null?void 0:H.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=H=>{var de;const te=o.feedMode==="dev"?o.activities.filter(ke=>ke.activityType==="dev"):o.activities,Le=te==null?void 0:te.at(-1),le=Le?tt.LexoRank.parse(Le.rank).genNext():tt.LexoRank.middle(),qe=((de=o.activities)==null?void 0:de.length)??0,$=o.feedMode==="dev",G={name:n("activity.defaultName",{idx:qe+1}),rank:le.format(),...$?{statusDevId:H.id,type:"dev"}:{statusId:H.id}};o.filters.assigneeId.length>0&&(G.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(G.projectId=o.filters.projectId[0]),p.value=!0,r("addActivity",G)},y=H=>{var de,ke;const te=o.feedMode==="dev"?"devStatus":"status",Le=((de=o.activities)==null?void 0:de.filter(Me=>{const ve=Me[te];return(ve==null?void 0:ve.id)===H.id}))??[],le=es(Le),qe=((ke=o.activities)==null?void 0:ke.length)??0,$=o.feedMode==="dev",G={name:n("activity.defaultName",{idx:qe+1}),rank:le,...$?{statusDevId:H.id,type:"dev"}:{statusId:H.id}};o.filters.assigneeId.length>0&&(G.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(G.projectId=o.filters.projectId[0]),p.value=!0,r("addActivity",G)},C=(H,te)=>{p.value=!1,r("update:filters",{...o.filters,[H]:te})},v=i.computed(()=>o.project?[o.project]:o.projects??[]),_=i.computed(()=>v.value.map(H=>({value:H.id,label:H.name}))),k=i.computed(()=>{var H;return(H=o.activityTypes)==null?void 0:H.map(te=>({value:te.id,label:te.name}))}),w=i.computed(()=>o.users.map(H=>({value:H.id,label:`${H.firstName} ${H.lastName}`,avatar:H.avatarUrl}))),b=H=>{o.selectedActivity&&r("update:activity",H)},E=H=>{r("update:activity",H)},T=H=>{r("archiveActivity",H)},S=H=>{r("unarchiveActivity",H)},N=H=>{var te;r("startTimer",H),(te=window.parent)==null||te.postMessage({type:"startTimer",data:H},"*")},L=H=>{p.value=!1,r("update:searchText",H)},A=H=>{p.value=!1,r("clear:searchText",H)},D=H=>{o.selectedActivity&&r("addSubtask",H)},M=H=>{o.selectedActivity&&r("updateSubtask",H)},I=H=>{o.selectedActivity&&r("deleteSubtask",H)},P=H=>{r("addFiles",H)},j=H=>{r("removeFile",H)},V=H=>{o.selectedActivity&&r("addComment",{...H,activityId:o.selectedActivity.id})},U=H=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",H)},F=H=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",H)},Q=Nr.useRouter(),ee=Nr.useRoute(),me=i.ref("feed");i.watch(()=>ee.name,H=>{H===$o.feed||H==="ActivityFeed"||H==="ActivityFeedWithActivity"?me.value="feed":H===$o.dev||H==="ActivityFeedDev"||H==="ActivityFeedDevWithActivity"?me.value="dev":H===Oe.feed?me.value="feed":H===Oe.dev?me.value="dev":H===Oe.project?me.value="overview":H===Oe.mapping&&(me.value="mapping")},{immediate:!0});const se=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],ae=i.computed(()=>z.value?se.filter(H=>H.value==="feed"||H.value==="dev"):se),z=i.computed(()=>!o.project&&ee.name&&(ee.name===$o.feed||ee.name===$o.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),re=i.computed(()=>z.value?$o.feed:Oe.feed),_e=i.computed(()=>z.value?$o.dev:Oe.dev),De=i.computed(()=>Oe.project),Je=i.computed(()=>Oe.mapping);return i.watch(me,H=>{H==="feed"?Q.push({name:re.value}):H==="dev"?Q.push({name:_e.value}):H==="overview"?Q.push({name:De.value}):H==="mapping"&&Q.push({name:Je.value})}),(H,te)=>{var Le;return i.openBlock(),i.createElementBlock("div",ohe,[i.createVNode(ts,null,{primary:i.withCtx(()=>[i.createElementVNode("div",rhe,[i.createVNode(ms,{modelValue:me.value,"onUpdate:modelValue":te[0]||(te[0]=le=>me.value=le),tabs:ae.value},null,8,["modelValue","tabs"]),i.createVNode(nhe,{"model-value":t.searchText,placeholder:H.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":L,onClear:A},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Ct,{key:0,"model-value":t.filters[i.unref(No).project],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:H.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>C(i.unref(No).project,le))},null,8,["model-value","options","placeholder"])),k.value?(i.openBlock(),i.createBlock(Ct,{key:1,"model-value":t.filters[i.unref(No).type],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:H.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>C(i.unref(No).type,le))},null,8,["model-value","options","placeholder"])):i.createCommentVNode("",!0),w.value.length?(i.openBlock(),i.createBlock(Ct,{key:2,"model-value":t.filters[i.unref(No).assignee],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:H.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>C(i.unref(No).assignee,le))},{tag:i.withCtx(({option:le,handleTagRemove:qe})=>[i.createVNode(jn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:$=>qe(le,$)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):i.createCommentVNode("",!0)]),i.createVNode(ge,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:H.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>H.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),i.createVNode(ge,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:H.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>H.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),i.createVNode(ge,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:H.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>H.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",ihe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,le=>(i.openBlock(),i.createBlock(Qme,{key:le.id,status:le,list:d.value[le.id],title:le.name,"footer-label":H.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>y(le),onSelectActivity:u,onArchiveActivity:T,onUnarchiveActivity:S,onUpdateActivity:E,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(ed,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Le=t.selectedActivity.milestone)==null?void 0:Le.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:v.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,onClose:te[7]||(te[7]=()=>u(null,null)),"onUpdate:activity":b,onAddSubtask:D,onUpdateSubtask:M,onDeleteSubtask:I,onAddFiles:P,onRemoveFile:j,onAddComment:V,onUpdateComment:U,onRemoveComment:F,onToast:s},{default:i.withCtx(le=>[i.renderSlot(H.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview"])):i.createCommentVNode("",!0)]))])}}});const she={class:"ao-project-mapping"},ahe={class:"ao-project-mapping-mapping__body"},lhe={class:"ao-project-mapping-mapping__phases"},che={key:0,class:"ao-project-mapping-mapping__image-wrapper"},uhe=["src","alt"],dhe=i.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e,s=()=>{const{name:v,rank:_}=qo(o.phases,"phase",n);r("addPhase",{name:v,rank:_,projectId:o.project.id})},a=()=>{const v=n("template.defaultName.phase",{idx:1}),_=es(o.phases);r("addPhase",{name:v,rank:_,projectId:o.project.id})},l=v=>{r("updatePhase",v)},c=v=>{r("archivePhase",v)},u=v=>{r("unarchivePhase",v)},d=v=>{r("copyPhaseToTemplate",v)},f=i.ref(!1),p=i.ref(!1),m=(v,_)=>{r("applyTemplate",{templateId:v,projectId:_}),f.value=!1},h=(v,_)=>{var b;const k=(b=o.templates)==null?void 0:b.at(-1),w=k?tt.LexoRank.parse(k.rank).genNext():tt.LexoRank.middle();r("saveTemplate",{templateName:v,rank:w.format(),phaseIds:_}),p.value=!1},g=Nr.useRouter(),y=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(y,v=>{v==="feed"?(g.push({name:Oe.feed}),console.log("Navigating to feed...")):v==="dev"?(g.push({name:Oe.dev}),console.log("Navigating to dev...")):v==="overview"?(g.push({name:Oe.project}),console.log("Navigating to feed...")):v==="mapping"&&(g.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(v,_)=>{var k;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-mapping-overview"},v.$attrs),[i.createElementVNode("div",she,[i.createVNode(ts,null,{primary:i.withCtx(()=>[i.createVNode(ms,{modelValue:y.value,"onUpdate:modelValue":_[0]||(_[0]=w=>y.value=w),tabs:C},null,8,["modelValue"]),i.createVNode(ge,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:_[1]||(_[1]=w=>v.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("project.phase.add"),onClick:a},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:1,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:v.$t("project.template.save.label"),onClick:_[2]||(_[2]=w=>p.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:2,class:"ao-project-mapping-overview__add-template",color:"primary",label:v.$t("project.template.apply.label"),onClick:_[3]||(_[3]=w=>f.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",ahe,[i.createElementVNode("div",lhe,[i.createVNode(cd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(k=t.project)==null?void 0:k.estimationUnit,onAddPhase:s,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:u,onCopyPhaseToTemplate:d},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(i.openBlock(),i.createElementBlock("div",che,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,uhe)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[p.value?(i.openBlock(),i.createBlock(Rg,{key:0,phases:t.phases,onClose:_[4]||(_[4]=w=>p.value=!1),onSave:h},null,8,["phases"])):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(Vg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:_[5]||(_[5]=w=>f.value=!1),onApply:m},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Fo={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},fhe=(t,e={})=>[{path:t,name:Fo.TEMPLATES,redirect:{name:Fo.TEMPLATES_LIST},...e,children:[{path:"",name:Fo.TEMPLATES_LIST,component:zg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Fo.TEMPLATE_DETAILS,component:Fg,props:!0}]}],Oe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},$o={feed:"ActivityFeed",dev:"ActivityFeedDev"},phe=(t,e={})=>[{path:t,...e,redirect:{name:Oe.project},children:[{path:"",name:Oe.project,component:Zpe,props:!0,children:[{path:":phaseId/:milestoneId",name:Oe.milestone,component:fp,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Oe.activity,props:{default:!0,modal:!0},components:{default:fp,modal:Bme}}]},{path:"feed",name:Oe.feed,component:Kc,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Oe.dev,component:Kc,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Oe.mapping,component:dhe,props:!0}]}],mhe={class:"ao-templates"},zg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{Vn(u,d)});const s=()=>{var m,h;const u=(m=o.templates)==null?void 0:m.at(-1),d=u?tt.LexoRank.parse(u.rank).genNext():tt.LexoRank.middle(),f=((h=o.templates)==null?void 0:h.length)??0,p={name:n("template.defaultName.template",{idx:f+1}),rank:d.format()};r("addTemplate",p)},a=(u,d)=>{r("updateItem",{itemType:Ve.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:Ve.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=Qi(u,o.templates??[]);r("updateItem",{itemType:Ve.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",mhe,[i.createVNode(ts,null,{secondary:i.withCtx(()=>[i.createVNode(ge,{label:u.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),i.createVNode(i.unref(go),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:i.withCtx(({element:f})=>{var p;return[i.createVNode(q_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(p_)(f.phases):0,activities:f.phases?i.unref(m_)(f.phases):0,"updated-at":f.updatedAt,"updated-by":f.updatedBy,onUpdateTitle:m=>a(f.id,m),onClick:m=>u.$router.push({name:i.unref(Fo).TEMPLATE_DETAILS,params:{templateId:f.id}}),onDeleteItem:d[0]||(d[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const hhe={class:"ao-field__label"},Ug=i.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[i.createElementVNode("span",hhe,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),ghe=["type","value","disabled","readonly"],vhe=i.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.modelModifiers.lazy?"change":"input"),s=a=>{n.modelModifiers.number&&(a=Number(a)),o("update:modelValue",a)};return(a,l)=>(i.openBlock(),i.createBlock(Ug,{label:t.label},{default:i.withCtx(()=>[i.createElementVNode("input",i.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[i.toHandlerKey(r.value)]:l[0]||(l[0]=c=>s(c.target.value))}),null,16,ghe)]),_:1},8,["label"]))}}),yhe={class:"ao-field"},_he={class:"ao-field__label"},Che=["checked","disabled"],bhe=i.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",yhe,[i.createElementVNode("span",_he,i.toDisplayString(t.label),1),i.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,Che)]))}});exports.AoAvatar=jn;exports.AoCardFeed=ud;exports.AoCheckboxField=bhe;exports.AoColorPicker=pl;exports.AoFeed=Kc;exports.AoField=Ug;exports.AoInputField=vhe;exports.AoMultiselect=Ct;exports.AoProjectPhases=cd;exports.AoTabBar=ms;exports.AoTemplateDetails=Fg;exports.AoTemplates=Jg;exports.AoTemplatesList=zg;exports.EstimationUnit=_p;exports.TemplateItemTypeEnum=yp;exports.activityFeedRoutes=$o;exports.activityFeedStatus=xy;exports.durationTypes=Ey;exports.feedFilterTypes=No;exports.getProjectOverviewRoutes=phe;exports.getTemplateRoutes=fhe;exports.listUpdateTypes=Sy;exports.milestoneStatus=Li;exports.projectOverviewRoutes=Oe;exports.ruleComparators=hp;exports.ruleDurationUnits=vp;exports.ruleTriggerTypes=gp;exports.templateItemType=Ve;exports.templateRouteNames=Fo;
58
+ */function Ao(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=yfe(t):/rgb/.test(t)?e=dp(t):typeof t=="string"?e=dp(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:s}=e,{h:a,s:l,v:c}=_fe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function td(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function Zc(t,e,n,o,r,s){const a=t==="l",l=e.createLinearGradient(0,0,a?n:0,a?0:o);l.addColorStop(.01,r),l.addColorStop(.99,s),e.fillStyle=l,e.fillRect(0,0,n,o)}function vfe({r:t,g:e,b:n},o){const r=a=>("0"+Number(a).toString(16)).slice(-2),s=`#${r(t)}${r(e)}${r(n)}`;return o?s.toUpperCase():s}function yfe(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function dp(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function _fe({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),s=o-r;let a=0;o===r?a=0:o===t?e>=n?a=60*(e-n)/s:a=60*(e-n)/s+360:o===e?a=60*(n-t)/s+120:o===n&&(a=60*(t-e)/s+240),a=Math.floor(a);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:a,s:l,v:c}}var nd=i.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),Zc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Zc("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=a=>{let l=a.clientX-n,c=a.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const u=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,f,p]=u.data;this.$emit("selectSaturation",{r:d,g:f,b:p})};r(t);const s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}});const Cfe={ref:"canvasSaturation"};function bfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectSaturation&&t.selectSaturation(...a),["prevent","stop"]))},[i.createVNode("canvas",Cfe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}nd.render=bfe;nd.__file="src/color/Saturation.vue";var od=i.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=s=>{let a=s.clientY-e;a<0&&(a=0),a>this.height&&(a=this.height),this.slideHueStyle={top:a-2+"px"};const l=n.getImageData(0,Math.min(a,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const kfe={ref:"canvasHue"};function wfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectHue&&t.selectHue(...a),["prevent","stop"]))},[i.createVNode("canvas",kfe,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}od.render=wfe;od.__file="src/color/Hue.vue";var rd=i.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=td(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),Zc("p",s,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let s=r.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height);let a=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",a)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const Efe={ref:"canvasAlpha"};function xfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectAlpha&&t.selectAlpha(...a),["prevent","stop"]))},[i.createVNode("canvas",Efe,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}rd.render=xfe;rd.__file="src/color/Alpha.vue";var id=i.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=td(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),s.fillStyle=this.color,s.fillRect(0,0,e,n)}}});function Sfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}id.render=Sfe;id.__file="src/color/Preview.vue";var sd=i.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:s,height:a}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,a-1),1,1);let[f,p,m,h]=d.data;h=parseFloat((h/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${f}, ${p}, ${m}, ${h})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:s,width:a,height:l}=t.getBoundingClientRect(),c=n-s,u=o-r,f=t.getContext("2d").getImageData(Math.min(c,a-1),Math.min(u,l-1),1,1);let[p,m,h,g]=f.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:p,g:m,b:h,a:g})}))}}});const Tfe=i.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),Afe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},Nfe=i.createVNode("g",{fill:"none","fill-rule":"evenodd"},[i.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[i.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),i.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[i.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function Dfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[t.isSucking?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...a)=>t.openSucker&&t.openSucker(...a))},[Tfe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",Afe,[Nfe])):i.createCommentVNode("v-if",!0)])}sd.render=Dfe;sd.__file="src/color/Sucker.vue";var ad=i.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:i.computed({get(){return t.color||""},set(s){e("inputColor",s)}}),handleFocus:s=>{e("inputFocus",s)},handleBlur:s=>{e("inputBlur",s)}}}});const Mfe={class:"color-type"},Bfe={class:"name"};function $fe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",Mfe,[i.createVNode("span",Bfe,i.toDisplayString(t.name),1),i.withDirectives(i.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.modelColor=a),class:"value",onFocus:e[2]||(e[2]=(...a)=>t.handleFocus&&t.handleFocus(...a)),onBlur:e[3]||(e[3]=(...a)=>t.handleBlur&&t.handleBlur(...a))},null,544),[[i.vModelText,t.modelColor]])])}ad.render=$fe;ad.__file="src/color/Box.vue";var ld=i.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=i.ref(),o=i.ref([]),r=i.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=td(4).toDataURL(),i.onUnmounted(()=>{s(n.value)});function s(l){if(!l)return;const c=o.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function a(l){e("selectColor",l)}return{setColorsHistory:s,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:a}}});const Ofe={class:"colors"},Lfe={key:0,class:"colors history"};function Ife(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[i.createVNode("ul",Ofe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsDefault,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(i.openBlock(),i.createBlock("ul",Lfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsHistory,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))])):i.createCommentVNode("v-if",!0)])}ld.render=Ife;ld.__file="src/color/Colors.vue";var Ar=i.defineComponent({components:{Saturation:nd,Hue:od,Alpha:rd,Preview:id,Sucker:sd,Box:ad,Colors:ld},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return vfe(this.rgba,!0)}},created(){Object.assign(this,Ao(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Pfe={class:"color-set"};function Ffe(t,e,n,o,r,s){const a=i.resolveComponent("Saturation"),l=i.resolveComponent("Hue"),c=i.resolveComponent("Alpha"),u=i.resolveComponent("Preview"),d=i.resolveComponent("Sucker"),f=i.resolveComponent("Box"),p=i.resolveComponent("Colors");return i.openBlock(),i.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[i.createVNode("div",Pfe,[i.createVNode(a,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),i.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),i.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),i.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[i.createVNode(u,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock(d,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),i.createVNode(f,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(f,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(p,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),i.createCommentVNode(" custom options "),i.renderSlot(t.$slots,"default")],6)}Ar.render=Ffe;Ar.__file="src/color/ColorPicker.vue";Ar.install=t=>{t.component(Ar.name,Ar)};const Vfe={class:"color-picker-wrapper"},pl=i.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null),a=i.ref(null),l=i.ref(0),c=i.ref(0),u=async h=>{a.value=h,r.value=!0,await i.nextTick();const g=h.getBoundingClientRect(),y=s.value,C=(y==null?void 0:y.offsetHeight)||300,v=window.innerHeight-g.bottom,_=g.top,k=v<C&&_>C;console.log("pickerHeight = "+C),l.value=k?g.top-C-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",f)},0)},d=i.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),f=h=>{const g=h.target;s.value&&!s.value.contains(g)&&(r.value=!1,o("update:color",p.value),window.removeEventListener("click",f))};i.onBeforeUnmount(()=>{window.removeEventListener("click",f)}),i.watch(()=>n.color,h=>{r.value||(p.value=h)});const p=i.ref(n.color),m=h=>{const{r:g,g:y,b:C,a:v}=h.rgba;p.value=`rgba(${g}, ${y}, ${C}, ${v})`};return(h,g)=>(i.openBlock(),i.createElementBlock("div",Vfe,[i.renderSlot(h.$slots,"clickable",{openPicker:u,bgColor:t.color}),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:i.normalizeStyle(d.value)},[i.createVNode(i.unref(Ar),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const Rfe={class:"ao-card-project-phase__header"},zfe={class:"ao-card-project-item__title-line"},Ufe={key:0,class:"ao-card-project-item-phase__estimation"},qfe={class:"ao-card-project-phase__footer"},Hfe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},jfe={class:"ao-card-project-phase__subitem"},Wfe={class:"ao-card-project-phase__subitem"},Zfe={key:0,class:"ao-card-project-phase__secondary"},Kfe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},Gfe=i.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Da(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===Li.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y(C)};return(g,y)=>(i.openBlock(),i.createBlock(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",zfe,[i.createVNode(ft,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",Ufe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",qfe,[u.value?(i.openBlock(),i.createElementBlock("div",Hfe,[i.createElementVNode("div",jfe,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Wfe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Zfe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-card-project-phase__footer-row",p.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Kfe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Rfe,[i.createVNode(ge,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Yfe=i.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{class:"aoBadge",style:i.normalizeStyle({backgroundColor:t.color})},null,4))}});const Jfe={class:"ao-card-project-milestone__default"},Xfe={class:"ao-title-with-badge-wrapper"},Qfe={class:"ao-card-project-item__title-line"},epe={key:0,class:"ao-card-project-item-milestone__estimation"},tpe={key:0,class:"ao-card-project-milestone__archive"},npe={class:"ao-card-project-milestone__activities"},ope={class:"ao-card-project-milestone__activities-row"},rpe={class:"ao-card-project-milestone__subitem"},ipe={class:"ao-card-project-milestone__subitem"},spe={key:1,class:"ao-card-project-milestone__secondary"},ape={class:"ao-card-project-milestone__footer"},lpe={key:1,class:"ao-field ao-card-project-milestone__deadline"},cpe={class:"ao-field__label"},upe={key:2,class:"ao-card-project-milestone__assignee"},dpe=i.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var p;return((p=n.activities)==null?void 0:p.reduce((m,h)=>m+(h.estimation||0),0))||0}),s=i.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((p,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return p+((h==null?void 0:h.timeSpent)||0)},0)),a=i.computed(()=>n.estimationUnit==="days"?"d":"h"),l=i.computed(()=>Da(s.value,n.estimationUnit));i.computed(()=>{const p=s.value/60;return p%1===0?p.toString():p.toFixed(2)});const c=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.length}),u=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.filter(m=>Jc(m,n.closedStatus)).length}),d=i.computed(()=>(u.value||0)/(c.value||1)),f=p=>{o("updateMilestone",{id:n.id,name:p})};return(p,m)=>(i.openBlock(),i.createBlock(dl,{class:i.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:i.withCtx(()=>[i.createElementVNode("div",Jfe,[i.createElementVNode("div",Xfe,[i.createVNode(Yfe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",Qfe,[i.createVNode(ft,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":f},null,8,["id","title","is-editable"]),r.value||s.value?(i.openBlock(),i.createElementBlock("span",epe," ("+i.toDisplayString(l.value)+"/"+i.toDisplayString(r.value)+i.toDisplayString(a.value)+")",1)):i.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(i.openBlock(),i.createElementBlock("div",tpe,[i.createVNode(ge,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=i.withModifiers(()=>t.active?p.$emit("archiveMilestone",{id:t.id}):p.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",npe,[i.createElementVNode("div",ope,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",rpe,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",ipe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(fl,{percentages:d.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):i.createCommentVNode("",!0),p.$slots.secondary?(i.openBlock(),i.createElementBlock("div",spe,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",ape,[t.important?(i.openBlock(),i.createBlock(be,{key:0,name:"FlagRounded",class:i.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):i.createCommentVNode("",!0),t.deadline?(i.openBlock(),i.createElementBlock("label",lpe,[i.createElementVNode("span",cpe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",upe,[i.createVNode(jn,{"user-name":i.unref(Op)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):i.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const fpe={class:"ao-mapping-card-project-phase__header"},ppe={class:"ao-card-project-item__title-line"},mpe={key:0,class:"ao-card-project-item-phase__estimation"},hpe={class:"ao-mapping-card-project-phase__footer"},gpe={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},vpe={class:"ao-mapping-card-project-phase__subitem"},ype={class:"ao-mapping-card-project-phase__subitem"},_pe={key:0,class:"ao-mapping-card-project-phase__secondary"},Cpe={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},bpe=i.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Da(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===Li.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y()};return(g,y)=>(i.openBlock(),i.createBlock(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",ppe,[i.createVNode(ft,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",mpe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",hpe,[u.value?(i.openBlock(),i.createElementBlock("div",gpe,[i.createElementVNode("div",vpe,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",ype,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{percentages:f.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",_pe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-mapping-card-project-phase__footer-row",p.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Cpe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",fpe,[i.createVNode(ge,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const kpe={class:"ao-project-phase"},wpe={key:0,class:"ao-project-phase__drag ao-card__drag"},Epe={key:1,class:"ao-project-phase__col-phase"},xpe={key:2,class:"ao-mapping-project-phase__col-phase"},Spe={key:0,class:"ao-project-phase__col-milestones"},Tpe=["title"],Ape={class:"ao-project-phase__milestones-list-footer"},Npe=i.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e;i.watch(()=>o.phase.milestones,(w,b)=>{Vn(w,b)});const s=w=>{r("updatePhase",{id:o.phase.id,name:w})},a=w=>{r("updatePhase",{id:o.phase.id,deadline:w})},l=w=>{r("updatePhase",w)},c=i.computed(()=>o.phase.milestones.map(w=>v_(w,o.closedStatus))),u=w=>{const{name:b,rank:E}=qo(c.value??[],"milestone",n);r("addMilestone",{name:b,rank:E,phaseId:w})},d=w=>{const b=n("template.defaultName.milestone",{idx:1}),E=es(c.value??[]);r("addMilestone",{name:b,rank:E,phaseId:w})},f=w=>{r("updateMilestone",w)},p=w=>{r("archiveMilestone",w)},m=w=>{r("unarchiveMilestone",w)},h=w=>{r("archivePhase",w)},g=w=>{r("unarchivePhase",w)},y=w=>{"added"in w?r("updateMilestone",{id:w.added.element.id,phaseId:o.phase.id,rank:Dr(c.value,w.added.newIndex)}):"removed"in w||"moved"in w&&r("updateMilestone",{id:w.moved.element.id,rank:Dr(c.value,w.moved.newIndex)})},C=Nr.useRoute(),v=i.computed(()=>C.path.includes("/mapping")),_=i.computed(()=>{var w;return o.phase.id===((w=C.params)==null?void 0:w.phaseId)});i.ref(!1);const k=i.computed(()=>{var w;return o.phase.id!==((w=C.params)==null?void 0:w.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:__(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(w,b)=>(i.openBlock(),i.createElementBlock("li",kpe,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",wpe,[i.createVNode(be,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("div",xpe,[i.createVNode(bpe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(i.openBlock(),i.createElementBlock("div",Epe,[i.createVNode(Gfe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),v.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Spe,[i.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":_.value}]),title:w.$t("project.milestone.add"),onClick:b[0]||(b[0]=()=>d(t.phase.id))},[i.createVNode(be,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,Tpe)):i.createCommentVNode("",!0),i.createVNode(i.unref(go),i.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},w.$attrs,{onChange:y}),{item:i.withCtx(({element:E})=>{var T;return[i.createVNode(dpe,{id:E.id,name:E.name,color:E.color,"phase-color":t.phase.color,activities:E.activities,deadline:E.deadline,active:E.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":E.id===((T=w.$route.params)==null?void 0:T.milestoneId),assignee:E.assignee,important:E.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:i.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&w.$router.push({name:i.unref(Oe).milestone,params:{phaseId:t.phase.id,milestoneId:E.id}}),onUpdateMilestone:f,onArchiveMilestone:p,onUnarchiveMilestone:m},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),i.createElementVNode("div",Ape,[t.isEditable?(i.openBlock(),i.createBlock(vo,{key:0,label:w.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:b[1]||(b[1]=()=>u(t.phase.id))},null,8,["label"])):i.createCommentVNode("",!0)])],4)]))]))}});const Dpe={class:"ao-project__phases"},Mpe={key:0,class:"ao-project-phase__phases-list-footer"},Bpe={class:"ao-project-phase__col-phase"},cd=i.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;i.watch(()=>n.phases,(m,h)=>{Vn(m,h)});const r=m=>{o("addMilestone",m)},s=m=>{o("updateMilestone",m)},a=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},u=m=>{o("unarchivePhase",m)},d=m=>{if(m.moved){const h=Qi(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},f=m=>{o("updatePhase",m)},p=m=>{o("addPhase",m)};return(m,h)=>(i.openBlock(),i.createElementBlock("div",Dpe,[i.createVNode(i.unref(go),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:d},{item:i.withCtx(({element:g})=>[i.createVNode(Npe,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:s,onArchiveMilestone:a,onUnarchiveMilestone:l,onUpdatePhase:f,onArchivePhase:c,onUnarchivePhase:u},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Mpe,[h[0]||(h[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",Bpe,[i.createVNode(vo,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),h[1]||(h[1]=i.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):i.createCommentVNode("",!0)]))}});const $pe={class:"ao-add-template-modal__form-body"},Ope={class:"field__row"},Lpe={class:"ao-add-template-modal__form-footer"},Vg=i.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),s=i.ref(null),a=c=>{s.value=c},l=()=>{s.value&&o("apply",s.value,n.projectId)};return(c,u)=>(i.openBlock(),i.createBlock(Ba,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ft,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("p",null,i.toDisplayString(c.$t("project.template.apply.notice")),1),i.createElementVNode("div",$pe,[i.createElementVNode("div",Ope,[i.createVNode(Ct,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",Lpe,[i.createVNode(ge,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const Ipe={class:"ao-save-template-modal__form-body"},Ppe={class:"field__row"},Fpe={class:"ao-field ao-field--inline"},Vpe={class:"ao-field__label"},Rpe={class:"ao-save-template-modal__phases"},zpe={class:"ao-field__label"},Upe={class:"ao-save-template-modal__phases-list"},qpe=["value"],Hpe={class:"ao-save-template-modal__form-footer"},Rg=i.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(""),s=i.ref([]);i.onMounted(()=>{s.value=n.phases.map(l=>l.id)});const a=()=>{r.value&&o("save",r.value,s.value)};return(l,c)=>(i.openBlock(),i.createBlock(Ba,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ft,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:i.withModifiers(a,["prevent"])},[i.createElementVNode("div",Ipe,[i.createElementVNode("div",Ppe,[i.createElementVNode("label",Fpe,[i.createElementVNode("span",Vpe,i.toDisplayString(l.$t("project.template.name.label"))+": ",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),type:"text"},null,512),[[i.vModelText,r.value]])])]),i.createElementVNode("div",Rpe,[i.createElementVNode("div",zpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",Upe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.phases,u=>(i.openBlock(),i.createElementBlock("label",{key:u.id,class:"ao-field ao-field--checkbox"},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=d=>s.value=d),type:"checkbox",value:u.id},null,8,qpe),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",Hpe,[i.createVNode(ge,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const jpe={class:"ao-project"},Wpe={class:"ao-project__body"},Zpe=i.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(F=>F.milestones)),a=()=>{const{name:F,rank:Q}=qo(o.phases,"phase",n);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},l=()=>{const F=n("template.defaultName.phase",{idx:1}),Q=es(o.phases);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},c=F=>{r("updatePhase",F)},u=F=>{r("archivePhase",F)},d=F=>{r("unarchivePhase",F)},f=F=>{r("copyPhaseToTemplate",F)},p=F=>{r("addMilestone",F)},m=F=>{r("updateMilestone",F)},h=F=>{r("archiveMilestone",F)},g=F=>{r("unarchiveMilestone",F)},y=F=>{r("addActivity",F)},C=F=>{r("update:activity",F)},v=F=>{r("archiveActivity",F)},_=F=>{r("unarchiveActivity",F)},k=F=>{r("addSubtask",F)},w=F=>{r("updateSubtask",F)},b=F=>{r("deleteSubtask",F)},E=i.computed(()=>s.value.flatMap(F=>F.activities)),T=F=>{r("addFiles",F)},S=F=>{r("removeFile",F)},N=F=>{r("addComment",F)},L=F=>{r("updateComment",F)},A=F=>{r("removeComment",F)},D=i.ref(!1),M=i.ref(!1),I=(F,Q)=>{r("applyTemplate",{templateId:F,projectId:Q}),D.value=!1},P=(F,Q)=>{var se;const ee=(se=o.templates)==null?void 0:se.at(-1),me=ee?tt.LexoRank.parse(ee.rank).genNext():tt.LexoRank.middle();r("saveTemplate",{templateName:F,rank:me.format(),phaseIds:Q}),M.value=!1},j=Nr.useRouter(),V=i.ref("overview"),U=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(V,F=>{F==="feed"?(j.push({name:Oe.feed}),console.log("Navigating to feed...")):F==="dev"?(j.push({name:Oe.dev}),console.log("Navigating to dev...")):F==="overview"?(j.push({name:Oe.project}),console.log("Navigating to feed...")):F==="mapping"&&(j.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(F,Q)=>{var me;const ee=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},F.$attrs),[i.createElementVNode("div",jpe,[i.createVNode(ts,null,{primary:i.withCtx(()=>[i.createVNode(ms,{modelValue:V.value,"onUpdate:modelValue":Q[0]||(Q[0]=se=>V.value=se),tabs:U},null,8,["modelValue"]),i.createVNode(ge,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=se=>F.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("project.phase.add"),onClick:l},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:1,class:"ao-project-overview__save-as-template",color:"primary",label:F.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=se=>M.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:2,class:"ao-project-overview__add-template",color:"primary",label:F.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=se=>D.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Wpe,[i.createVNode(cd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(me=t.project)==null?void 0:me.estimationUnit,onAddMilestone:p,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:a,onUpdatePhase:c,onArchivePhase:u,onUnarchivePhase:d,onCopyPhaseToTemplate:f},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),i.createVNode(ee,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:Q[4]||(Q[4]=se=>F.$router.push({name:i.unref(Oe).project})),onUpdateMilestone:m,onAddActivity:y,onUpdateActivity:C,onArchiveActivity:v,onUnarchiveActivity:_},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(ee,{name:"modal",activities:E.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":t.loadAttachmentPreview,"onUpdate:activity":C,onAddSubtask:k,onUpdateSubtask:w,onDeleteSubtask:b,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:L,onRemoveComment:A},{default:i.withCtx(({Component:se})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(se),null,{default:i.withCtx(ae=>[i.renderSlot(F.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(ae)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data","load-attachment-preview"])]))],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[M.value?(i.openBlock(),i.createBlock(Rg,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=se=>M.value=!1),onSave:P},null,8,["phases"])):i.createCommentVNode("",!0),D.value?(i.openBlock(),i.createBlock(Vg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=se=>D.value=!1),onApply:I},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Kpe={class:"ao-card-feed__header"},Gpe={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},Ype={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Jpe={class:"ao-card-feed__body"},Xpe={key:0,class:"ao-card-feed__breadcrumbs"},Qpe={class:i.normalizeClass(["ao-card-feed__title-group"])},eme={class:"ao-card-feed__title-line"},tme={key:0,class:"ao-card-feed__slug"},nme={key:1,class:"ao-card-feed__deadline"},ome={class:"ao-card-feed__footer"},rme={class:"ao-card-feed__footer-row"},ime={class:"ao-assignees"},sme={key:0,class:"ao-assignee"},ame={key:0,class:"ao-card-feed__subitems"},lme={key:0,class:"ao-card-feed__subitem"},cme={class:"ao-card-feed__subitem"},ume={key:1,class:"ao-card-feed__subitem"},dme={class:"ao-card-feed__subitem"},fme={class:"ao-card-feed__timer-wrapper"},pme={class:"ao-card-feed__footer-row"},mme={key:0,class:"ao-card-feed__progress-wrapper"},hme={class:"ao-card-feed__subitem"},gme={class:"ao-card-feed__subitem"},ud=i.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),s=i.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),a=g=>{o("updateActivity",{id:n.id,name:g})},l=i.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=i.computed(()=>n.assignee?[n.assignee]:[]),u=i.computed(()=>Ma(n.deadline)),d=g=>{o("removeAssignee",g)},f=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},p=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(y=>y.isDone).length}),h=i.computed(()=>(m.value||0)/(p.value||1));return(g,y)=>(i.openBlock(),i.createBlock(dl,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",Kpe,[r.value?(i.openBlock(),i.createBlock(Oi,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):i.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(i.openBlock(),i.createElementBlock("div",Gpe,[t.isPrivate?(i.openBlock(),i.createBlock(be,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(be,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(be,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Ype,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",Jpe,[l.value?(i.openBlock(),i.createElementBlock("span",Xpe,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",Qpe,[i.createElementVNode("div",eme,[t.slug?(i.openBlock(),i.createElementBlock("span",tme,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(ft,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":a},null,8,["id","title","is-editable"])])]),t.deadline?(i.openBlock(),i.createElementBlock("span",nme,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",ome,[i.createElementVNode("div",rme,[i.createElementVNode("ul",ime,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,C=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:C.id},[C?(i.openBlock(),i.createElementBlock("li",sme,[i.createVNode(jn,{"user-name":i.unref(Op)(C),"avatar-url":C.avatarUrl,"is-closable":!0,onClose:()=>d(C.id)},null,8,["user-name","avatar-url","onClose"])])):i.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(i.openBlock(),i.createElementBlock("ul",ame,[t.comments?(i.openBlock(),i.createElementBlock("li",lme,[i.createVNode(be,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",cme,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",ume,[i.createVNode(be,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",dme,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",fme,[i.createVNode(be,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",pme,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",mme,[i.createElementVNode("div",hme,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",gme,i.toDisplayString(m.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(fl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const vme={class:"ao-project-milestone"},yme={class:"ao-project-milestone__header"},_me={class:"ao-project-milestone__header_line"},Cme={class:"ao-project-milestone__header_line"},bme={class:"ao-project-milestone__title"},kme={key:0,class:"ao-fieldset ao-milestone__fieldset"},wme={class:"ao-field__row ao-milestone__field-row"},Eme={class:"ao-field ao-field--inline"},xme={class:"ao-field__row ao-milestone__field-row"},Sme={class:"ao-field ao-milestone__field-multiselect"},Tme={class:"ao-milestone__color-actions"},Ame=["onClick"],Nme=["title"],Dme={class:"ao-project-milestone__body"},Mme={key:0,class:"ao-project-milestone__footer"},fp=i.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e,s=b=>{var E;r("startTimer",b),(E=window.parent)==null||E.postMessage({type:"startTimer",data:b},"*")},a=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.find(E=>E.id===o.phaseId)}),l=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.flatMap(E=>E.milestones)}),c=i.computed(()=>{var b;return(b=l.value)==null?void 0:b.find(E=>E.id===o.milestoneId)}),u=i.computed(()=>{var b;return(b=c.value)==null?void 0:b.activities});i.watch(u,(b,E)=>{Vn(b,E)});const d=b=>{r("close",b)},f=()=>{const{name:b,rank:E}=qo(u.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},p=()=>{const b=n("template.defaultName.activity",{idx:1}),E=es(u.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},m=b=>{r("updateActivity",b)},h=b=>{u.value&&"moved"in b&&r("updateActivity",{id:b.moved.element.id,rank:Dr(u.value,b.moved.newIndex)})},g=i.computed({get:()=>{var b;return(b=c.value)==null?void 0:b.color},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,color:b})}}),y=i.computed({get:()=>{var b;return((b=c==null?void 0:c.value)==null?void 0:b.deadline)??""},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:b!=null&&b.length?b:null})}}),C=b=>o.closedStatus?Jc(b,o.closedStatus):!1,v=i.computed(()=>{var b;return((b=o.users)==null?void 0:b.map(E=>({label:`${E.firstName} ${E.lastName}`,value:E.id,avatar:E.avatarUrl})))||[]}),_=i.computed({get(){var b,E;return(E=(b=c.value)==null?void 0:b.assignee)!=null&&E.id?[c.value.assignee.id]:[]},set(b){r("updateMilestone",{id:o.milestoneId,assigneeId:b[0]??null})}}),k=i.computed({get(){var b;return((b=c.value)==null?void 0:b.important)??!1},set(b){r("updateMilestone",{id:o.milestoneId,important:b})}}),w=(b,E)=>{const T=b.currentTarget;T instanceof HTMLElement&&E(T)};return(b,E)=>{var T;return i.openBlock(),i.createElementBlock("div",vme,[i.createElementVNode("header",yme,[i.createElementVNode("div",_me,[i.createVNode(ge,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",Cme,[i.createElementVNode("div",bme,[i.createVNode(ft,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Pg,{modelValue:k.value,"onUpdate:modelValue":E[0]||(E[0]=S=>k.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:b.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(i.openBlock(),i.createElementBlock("div",kme,[i.createElementVNode("div",wme,[i.createElementVNode("label",Eme,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=S=>y.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,y.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",xme,[i.createElementVNode("label",Sme,[i.createVNode(Ct,{modelValue:_.value,"onUpdate:modelValue":E[2]||(E[2]=S=>_.value=S),options:v.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:b.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:i.withCtx(({option:S,handleTagRemove:N})=>[i.createVNode(jn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:L=>N(S,L)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createElementVNode("div",Tme,[i.createVNode(pl,{color:g.value,"onUpdate:color":E[3]||(E[3]=S=>g.value=S)},{clickable:i.withCtx(({openPicker:S,bgColor:N})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:N}),class:"color-button",onClick:L=>w(L,S)},null,12,Ame)]),_:1},8,["color"]),t.isEditable?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ao-project-milestone__quick-add",title:b.$t("project.activity.add"),onClick:p},[i.createVNode(be,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,Nme)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Dme,[i.createVNode(i.unref(go),i.mergeProps({class:"ao-project-milestone__activities",list:u.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},b.$attrs,{onChange:h}),{item:i.withCtx(({element:S})=>{var N,L,A,D,M;return[i.createVNode(ud,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=a.value)==null?void 0:N.name,"milestone-name":(L=c.value)==null?void 0:L.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:S.deadline,important:S.important,users:t.users,assignee:S.assignee,slug:S.slug,comments:(D=S.comments)==null?void 0:D.length,attachments:(M=S.attachments)==null?void 0:M.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":C(S),onClick:I=>b.$router.push({name:i.unref(Oe).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&S.active?(i.openBlock(),i.createBlock(ge,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("archive"),onClick:i.withModifiers(()=>b.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!S.active?(i.openBlock(),i.createBlock(ge,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>b.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Mme,[i.createVNode(vo,{"icon-name":"Add",label:b.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const Bme=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.find(v=>v.id===n.phaseId)}),s=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.flatMap(v=>v.milestones)}),a=i.computed(()=>{var C;return(C=s.value)==null?void 0:C.find(v=>v.id===n.milestoneId)}),l=i.computed(()=>{var C;return(C=n.activities)==null?void 0:C.find(v=>v.id===n.activityId)}),c=C=>{o("update:activity",C)},u=C=>{o("addSubtask",C)},d=C=>{o("updateSubtask",C)},f=C=>{o("deleteSubtask",C)},p=C=>{o("addFiles",C)},m=C=>{o("removeFile",C)},h=C=>{o("addComment",C)},g=C=>{o("updateComment",C)},y=C=>{o("removeComment",C)};return(C,v)=>{var _,k;return l.value?(i.openBlock(),i.createBlock(ed,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(_=r.value)==null?void 0:_.name} / ${(k=a.value)==null?void 0:k.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,onClose:C.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:y},{default:i.withCtx(w=>[i.renderSlot(C.$slots,"default",i.normalizeProps(i.guardReactiveProps(w)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","onClose"])):i.createCommentVNode("",!0)}}}),$me={class:"ao-col-header"},Ome=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",$me,[i.createVNode(ft,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock(Oi,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function Lme(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function Ea(t){return typeof t=="function"?t():i.unref(t)}const Ime=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Pme=t=>t!=null,$i=()=>{};function Fme(t,e){function n(...o){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(s)})}return n}function Vme(t,e={}){let n,o,r=$i;const s=l=>{clearTimeout(l),r(),r=$i};return l=>{const c=Ea(t),u=Ea(e.maxWait);return n&&s(n),c<=0||u!==void 0&&u<=0?(o&&(s(o),o=null),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,u&&!o&&(o=setTimeout(()=>{n&&s(n),o=null,d(l())},u)),n=setTimeout(()=>{o&&s(o),o=null,d(l())},c)})}}function Rme(t,e=200,n={}){return Fme(Vme(e,n),t)}function ac(t){var e;const n=Ea(t);return(e=n==null?void 0:n.$el)!=null?e:n}const zme=Ime?window:void 0;function Ume(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function qme(t){const e=Ume();return i.computed(()=>(e.value,!!t()))}function Hme(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=zme,immediate:l=!0}=n,c=qme(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const h=Ea(t);return(Array.isArray(h)?h:[h]).map(ac).filter(Pme)});let d=$i;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,ac(o),f.value],([h,g])=>{if(d(),!f.value||!h.length)return;const y=new IntersectionObserver(e,{root:ac(g),rootMargin:r,threshold:s});h.forEach(C=>C&&y.observe(C)),d=()=>{y.disconnect(),d=$i}},{immediate:l,flush:"post"}):$i,m=()=>{d(),p(),f.value=!1};return Lme(m),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:m}}const jme={class:i.normalizeClass(["ao-list-kanban"])},Wme={class:"ao-list-kanban__header"},Zme=["title"],Kme={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Gme={key:1,class:"ao-list-kanban__end"},Yme={key:0,class:"ao-list-kanban__no-more"},Jme={key:1,class:"ao-list-kanban__divider"},Xme={key:1,class:"ao-list-kanban__footer"},Qme=i.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{},showHeaderAdd:{type:Boolean},isDevMode:{type:Boolean}},emits:["add","addAtBeginning","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null);Hme(s,([{isIntersecting:f}])=>{r.value=f}),i.watch(r,f=>{f&&n.hasMore&&!n.isLoading&&o("loadMore")});const a=f=>{var p;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((p=f.assignee)==null?void 0:p.id):!1},l=f=>{o("selectActivity",f)},c=f=>{o("updateActivity",f)},u=f=>{if("added"in f){const p={id:f.added.element.id,rank:Dr(n.list,f.added.newIndex)};n.isDevMode?p.statusDevId=n.status.id:p.statusId=n.status.id,o("updateActivity",p)}else"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:Dr(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",jme,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var m;return[i.createElementVNode("div",Wme,[t.title?(i.openBlock(),i.createBlock(Ome,{key:0,class:"ao-list-kanban__col-header",title:t.title,level:3,items:(m=t.list)==null?void 0:m.length},null,8,["title","items"])):i.createCommentVNode("",!0),t.showHeaderAdd?(i.openBlock(),i.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:f.$t("feed.activity.add"),onClick:p[0]||(p[0]=h=>f.$emit("addAtBeginning"))},[i.createVNode(be,{name:"Add"})],8,Zme)):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(go),i.mergeProps({class:["ao-list-kanban__list",d.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},f.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:u,onStart:p[2]||(p[2]=m=>d.value=!0),onEnd:p[3]||(p[3]=m=>d.value=!1)}),{item:i.withCtx(({element:m})=>{var h,g,y,C,v,_,k,w,b,E;return[i.createVNode(ud,{id:m.id,class:i.normalizeClass(a(m)?"ao-list-draggable":""),name:m.name,"project-name":(h=m.project)==null?void 0:h.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(y=m.project)==null?void 0:y.color,"phase-name":(v=(C=m.milestone)==null?void 0:C.phase)==null?void 0:v.name,"milestone-name":(_=m.milestone)==null?void 0:_.name,"milestone-color":(k=m.milestone)==null?void 0:k.color,deadline:m.deadline,rules:((w=m.rules)==null?void 0:w.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(b=m.comments)==null?void 0:b.length,attachments:(E=m.attachments)==null?void 0:E.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":a(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>a(m)&&c(T),()=>a(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>a(m)&&c({id:m.id,assigneeId:null}),onStartTimer:p[1]||(p[1]=T=>f.$emit("startTimer",T))},{secondary:i.withCtx(()=>[a(m)&&m.active?(i.openBlock(),i.createBlock(ge,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.archive"),onClick:i.withModifiers(()=>f.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),a(m)&&!m.active?(i.openBlock(),i.createBlock(ge,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>f.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:i.withCtx(()=>[t.isLoading?(i.openBlock(),i.createElementBlock("div",Kme,[i.createVNode(be,{name:"Loading"})])):t.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(i.openBlock(),i.createElementBlock("div",Gme,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",Yme,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",Jme)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",Xme,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(vo,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:p[4]||(p[4]=m=>f.$emit("add"))},null,8,["label"])):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]))}});const ehe={class:"ao-field ao-search-field"},the=["value","placeholder"],nhe=i.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const u=l.target.value;o("update:modelValue",u,l)},s=Rme(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",ehe,[i.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...u)=>i.unref(s)&&i.unref(s)(...u)),onKeypress:i.withKeys(r,["enter"])},null,40,the),i.createVNode(be,{name:"SearchRounded",class:i.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),i.createVNode(ge,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:i.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:a},null,8,["class"])]))}});const ohe={class:"ao-feed"},rhe={class:"ao-feed__filters"},ihe={class:"ao-feed__body"},Kc=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e;function s(H,te){r("toast",H,te)}const a=i.toRef(o,"activities"),l=i.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses),c=i.computed(()=>o.feedMode==="dev"?a.value.filter(H=>H.activityType==="dev"):a.value),u=async(H,te)=>{await r("selectActivity",H,te)},d=i.ref({}),f=i.ref(!1),p=i.ref(!1),m=i.computed(()=>o.project?"milestone":"project");i.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([H,te,Le,le],[qe,$])=>{const G=o.feedMode==="dev"?"devStatus":"status";d.value=Object.fromEntries(H.map(de=>[de.id,te.filter(ke=>{const Me=ke[G];return(Me==null?void 0:Me.id)===de.id})])),Le&&!f.value?(u(Le,null),f.value=!0):le&&!f.value&&(u(null,le),f.value=!0),p.value&&Vn(te,$)},{immediate:!0});const h=i.computed(()=>{var H;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((H=o.selectedActivity.milestone.phase)==null?void 0:H.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=H=>{var de;const te=o.feedMode==="dev"?o.activities.filter(ke=>ke.activityType==="dev"):o.activities,Le=te==null?void 0:te.at(-1),le=Le?tt.LexoRank.parse(Le.rank).genNext():tt.LexoRank.middle(),qe=((de=o.activities)==null?void 0:de.length)??0,$=o.feedMode==="dev",G={name:n("activity.defaultName",{idx:qe+1}),rank:le.format(),...$?{statusDevId:H.id,type:"dev"}:{statusId:H.id}};o.filters.assigneeId.length>0&&(G.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(G.projectId=o.filters.projectId[0]),p.value=!0,r("addActivity",G)},y=H=>{var de,ke;const te=o.feedMode==="dev"?"devStatus":"status",Le=((de=o.activities)==null?void 0:de.filter(Me=>{const ve=Me[te];return(ve==null?void 0:ve.id)===H.id}))??[],le=es(Le),qe=((ke=o.activities)==null?void 0:ke.length)??0,$=o.feedMode==="dev",G={name:n("activity.defaultName",{idx:qe+1}),rank:le,...$?{statusDevId:H.id,type:"dev"}:{statusId:H.id}};o.filters.assigneeId.length>0&&(G.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(G.projectId=o.filters.projectId[0]),p.value=!0,r("addActivity",G)},C=(H,te)=>{p.value=!1,r("update:filters",{...o.filters,[H]:te})},v=i.computed(()=>o.project?[o.project]:o.projects??[]),_=i.computed(()=>v.value.map(H=>({value:H.id,label:H.name}))),k=i.computed(()=>{var H;return(H=o.activityTypes)==null?void 0:H.map(te=>({value:te.id,label:te.name}))}),w=i.computed(()=>o.users.map(H=>({value:H.id,label:`${H.firstName} ${H.lastName}`,avatar:H.avatarUrl}))),b=H=>{o.selectedActivity&&r("update:activity",H)},E=H=>{r("update:activity",H)},T=H=>{r("archiveActivity",H)},S=H=>{r("unarchiveActivity",H)},N=H=>{var te;r("startTimer",H),(te=window.parent)==null||te.postMessage({type:"startTimer",data:H},"*")},L=H=>{p.value=!1,r("update:searchText",H)},A=H=>{p.value=!1,r("clear:searchText",H)},D=H=>{o.selectedActivity&&r("addSubtask",H)},M=H=>{o.selectedActivity&&r("updateSubtask",H)},I=H=>{o.selectedActivity&&r("deleteSubtask",H)},P=H=>{r("addFiles",H)},j=H=>{r("removeFile",H)},V=H=>{o.selectedActivity&&r("addComment",{...H,activityId:o.selectedActivity.id})},U=H=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",H)},F=H=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",H)},Q=Nr.useRouter(),ee=Nr.useRoute(),me=i.ref("feed");i.watch(()=>ee.name,H=>{H===$o.feed||H==="ActivityFeed"||H==="ActivityFeedWithActivity"?me.value="feed":H===$o.dev||H==="ActivityFeedDev"||H==="ActivityFeedDevWithActivity"?me.value="dev":H===Oe.feed?me.value="feed":H===Oe.dev?me.value="dev":H===Oe.project?me.value="overview":H===Oe.mapping&&(me.value="mapping")},{immediate:!0});const se=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],ae=i.computed(()=>z.value?se.filter(H=>H.value==="feed"||H.value==="dev"):se),z=i.computed(()=>!o.project&&ee.name&&(ee.name===$o.feed||ee.name===$o.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),re=i.computed(()=>z.value?$o.feed:Oe.feed),_e=i.computed(()=>z.value?$o.dev:Oe.dev),De=i.computed(()=>Oe.project),Je=i.computed(()=>Oe.mapping);return i.watch(me,H=>{H==="feed"?Q.push({name:re.value}):H==="dev"?Q.push({name:_e.value}):H==="overview"?Q.push({name:De.value}):H==="mapping"&&Q.push({name:Je.value})}),(H,te)=>{var Le;return i.openBlock(),i.createElementBlock("div",ohe,[i.createVNode(ts,null,{primary:i.withCtx(()=>[i.createElementVNode("div",rhe,[i.createVNode(ms,{modelValue:me.value,"onUpdate:modelValue":te[0]||(te[0]=le=>me.value=le),tabs:ae.value},null,8,["modelValue","tabs"]),i.createVNode(nhe,{"model-value":t.searchText,placeholder:H.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":L,onClear:A},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Ct,{key:0,"model-value":t.filters[i.unref(No).project],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:H.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>C(i.unref(No).project,le))},null,8,["model-value","options","placeholder"])),k.value?(i.openBlock(),i.createBlock(Ct,{key:1,"model-value":t.filters[i.unref(No).type],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:H.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>C(i.unref(No).type,le))},null,8,["model-value","options","placeholder"])):i.createCommentVNode("",!0),w.value.length?(i.openBlock(),i.createBlock(Ct,{key:2,"model-value":t.filters[i.unref(No).assignee],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:H.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>C(i.unref(No).assignee,le))},{tag:i.withCtx(({option:le,handleTagRemove:qe})=>[i.createVNode(jn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:$=>qe(le,$)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):i.createCommentVNode("",!0)]),i.createVNode(ge,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:H.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>H.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),i.createVNode(ge,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:H.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>H.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),i.createVNode(ge,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:H.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>H.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",ihe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,le=>(i.openBlock(),i.createBlock(Qme,{key:le.id,status:le,list:d.value[le.id],title:le.name,"footer-label":H.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>y(le),onSelectActivity:u,onArchiveActivity:T,onUnarchiveActivity:S,onUpdateActivity:E,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(ed,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Le=t.selectedActivity.milestone)==null?void 0:Le.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:v.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,onClose:te[7]||(te[7]=()=>u(null,null)),"onUpdate:activity":b,onAddSubtask:D,onUpdateSubtask:M,onDeleteSubtask:I,onAddFiles:P,onRemoveFile:j,onAddComment:V,onUpdateComment:U,onRemoveComment:F,onToast:s},{default:i.withCtx(le=>[i.renderSlot(H.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview"])):i.createCommentVNode("",!0)]))])}}});const she={class:"ao-project-mapping"},ahe={class:"ao-project-mapping-mapping__body"},lhe={class:"ao-project-mapping-mapping__phases"},che={key:0,class:"ao-project-mapping-mapping__image-wrapper"},uhe=["src","alt"],dhe=i.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e,s=()=>{const{name:v,rank:_}=qo(o.phases,"phase",n);r("addPhase",{name:v,rank:_,projectId:o.project.id})},a=()=>{const v=n("template.defaultName.phase",{idx:1}),_=es(o.phases);r("addPhase",{name:v,rank:_,projectId:o.project.id})},l=v=>{r("updatePhase",v)},c=v=>{r("archivePhase",v)},u=v=>{r("unarchivePhase",v)},d=v=>{r("copyPhaseToTemplate",v)},f=i.ref(!1),p=i.ref(!1),m=(v,_)=>{r("applyTemplate",{templateId:v,projectId:_}),f.value=!1},h=(v,_)=>{var b;const k=(b=o.templates)==null?void 0:b.at(-1),w=k?tt.LexoRank.parse(k.rank).genNext():tt.LexoRank.middle();r("saveTemplate",{templateName:v,rank:w.format(),phaseIds:_}),p.value=!1},g=Nr.useRouter(),y=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(y,v=>{v==="feed"?(g.push({name:Oe.feed}),console.log("Navigating to feed...")):v==="dev"?(g.push({name:Oe.dev}),console.log("Navigating to dev...")):v==="overview"?(g.push({name:Oe.project}),console.log("Navigating to feed...")):v==="mapping"&&(g.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(v,_)=>{var k;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-mapping-overview"},v.$attrs),[i.createElementVNode("div",she,[i.createVNode(ts,null,{primary:i.withCtx(()=>[i.createVNode(ms,{modelValue:y.value,"onUpdate:modelValue":_[0]||(_[0]=w=>y.value=w),tabs:C},null,8,["modelValue"]),i.createVNode(ge,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:_[1]||(_[1]=w=>v.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("project.phase.add"),onClick:a},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:1,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:v.$t("project.template.save.label"),onClick:_[2]||(_[2]=w=>p.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(ge,{key:2,class:"ao-project-mapping-overview__add-template",color:"primary",label:v.$t("project.template.apply.label"),onClick:_[3]||(_[3]=w=>f.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",ahe,[i.createElementVNode("div",lhe,[i.createVNode(cd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(k=t.project)==null?void 0:k.estimationUnit,onAddPhase:s,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:u,onCopyPhaseToTemplate:d},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(i.openBlock(),i.createElementBlock("div",che,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,uhe)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[p.value?(i.openBlock(),i.createBlock(Rg,{key:0,phases:t.phases,onClose:_[4]||(_[4]=w=>p.value=!1),onSave:h},null,8,["phases"])):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(Vg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:_[5]||(_[5]=w=>f.value=!1),onApply:m},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Fo={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},fhe=(t,e={})=>[{path:t,name:Fo.TEMPLATES,redirect:{name:Fo.TEMPLATES_LIST},...e,children:[{path:"",name:Fo.TEMPLATES_LIST,component:zg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Fo.TEMPLATE_DETAILS,component:Fg,props:!0}]}],Oe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},$o={feed:"ActivityFeed",dev:"ActivityFeedDev"},phe=(t,e={})=>[{path:t,...e,redirect:{name:Oe.project},children:[{path:"",name:Oe.project,component:Zpe,props:!0,children:[{path:":phaseId/:milestoneId",name:Oe.milestone,component:fp,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Oe.activity,props:{default:!0,modal:!0},components:{default:fp,modal:Bme}}]},{path:"feed",name:Oe.feed,component:Kc,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Oe.dev,component:Kc,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Oe.mapping,component:dhe,props:!0}]}],mhe={class:"ao-templates"},zg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=En(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{Vn(u,d)});const s=()=>{var m,h;const u=(m=o.templates)==null?void 0:m.at(-1),d=u?tt.LexoRank.parse(u.rank).genNext():tt.LexoRank.middle(),f=((h=o.templates)==null?void 0:h.length)??0,p={name:n("template.defaultName.template",{idx:f+1}),rank:d.format()};r("addTemplate",p)},a=(u,d)=>{r("updateItem",{itemType:Ve.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:Ve.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=Qi(u,o.templates??[]);r("updateItem",{itemType:Ve.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",mhe,[i.createVNode(ts,null,{secondary:i.withCtx(()=>[i.createVNode(ge,{label:u.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),i.createVNode(i.unref(go),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:i.withCtx(({element:f})=>{var p;return[i.createVNode(q_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(p_)(f.phases):0,activities:f.phases?i.unref(m_)(f.phases):0,"updated-at":f.updatedAt,"updated-by":f.updatedBy,onUpdateTitle:m=>a(f.id,m),onClick:m=>u.$router.push({name:i.unref(Fo).TEMPLATE_DETAILS,params:{templateId:f.id}}),onDeleteItem:d[0]||(d[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const hhe={class:"ao-field__label"},Ug=i.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[i.createElementVNode("span",hhe,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),ghe=["type","value","disabled","readonly"],vhe=i.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.modelModifiers.lazy?"change":"input"),s=a=>{n.modelModifiers.number&&(a=Number(a)),o("update:modelValue",a)};return(a,l)=>(i.openBlock(),i.createBlock(Ug,{label:t.label},{default:i.withCtx(()=>[i.createElementVNode("input",i.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[i.toHandlerKey(r.value)]:l[0]||(l[0]=c=>s(c.target.value))}),null,16,ghe)]),_:1},8,["label"]))}}),yhe={class:"ao-field"},_he={class:"ao-field__label"},Che=["checked","disabled"],bhe=i.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",yhe,[i.createElementVNode("span",_he,i.toDisplayString(t.label),1),i.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,Che)]))}});exports.AoAvatar=jn;exports.AoCardFeed=ud;exports.AoCheckboxField=bhe;exports.AoColorPicker=pl;exports.AoFeed=Kc;exports.AoField=Ug;exports.AoInputField=vhe;exports.AoMultiselect=Ct;exports.AoProjectPhases=cd;exports.AoTabBar=ms;exports.AoTemplateDetails=Fg;exports.AoTemplates=Jg;exports.AoTemplatesList=zg;exports.EstimationUnit=_p;exports.TemplateItemTypeEnum=yp;exports.activityFeedRoutes=$o;exports.activityFeedStatus=xy;exports.durationTypes=Ey;exports.feedFilterTypes=No;exports.getProjectOverviewRoutes=phe;exports.getTemplateRoutes=fhe;exports.listUpdateTypes=Sy;exports.milestoneStatus=Li;exports.projectOverviewRoutes=Oe;exports.ruleComparators=hp;exports.ruleDurationUnits=vp;exports.ruleTriggerTypes=gp;exports.templateItemType=Ve;exports.templateRouteNames=Fo;
package/dist/orcha.es.js CHANGED
@@ -30531,9 +30531,7 @@ const Yme = { class: "ao-feed" }, Jme = { class: "ao-feed__filters" }, Xme = { c
30531
30531
  function i(G, ce) {
30532
30532
  o("toast", G, ce);
30533
30533
  }
30534
- const s = Jo(r, "activities"), a = O(() => r.feedMode === "dev" ? r.devStatuses : r.statuses);
30535
- O(() => r.feedMode === "dev" ? "devStatus" : "status");
30536
- const l = O(() => r.feedMode === "dev" ? s.value.filter((G) => G.activityType === "dev") : s.value), c = async (G, ce) => {
30534
+ const s = Jo(r, "activities"), a = O(() => r.feedMode === "dev" ? r.devStatuses : r.statuses), l = O(() => r.feedMode === "dev" ? s.value.filter((G) => G.activityType === "dev") : s.value), c = async (G, ce) => {
30537
30535
  await o("selectActivity", G, ce);
30538
30536
  }, u = ae({}), d = ae(!1), f = ae(!1), p = O(() => r.project ? "milestone" : "project");
30539
30537
  Pe(
package/dist/orcha.umd.js CHANGED
@@ -56,4 +56,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
56
56
  * vue-color-kit v1.0.6
57
57
  * (c) 2023
58
58
  * @license MIT
59
- */function nr(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=zT(t):/rgb/.test(t)?e=Sg(t):typeof t=="string"?e=Sg(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:i}=e,{h:s,s:l,v:c}=qT(e);return{r:n,g:o,b:r,a:i===void 0?1:i,h:s,s:l,v:c}}function Gd(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function Kd(t,e,n,o,r,i){const s=t==="l",l=e.createLinearGradient(0,0,s?n:0,s?0:o);l.addColorStop(.01,r),l.addColorStop(.99,i),e.fillStyle=l,e.fillRect(0,0,n,o)}function FT({r:t,g:e,b:n},o){const r=s=>("0"+Number(s).toString(16)).slice(-2),i=`#${r(t)}${r(e)}${r(n)}`;return o?i.toUpperCase():i}function zT(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function Sg(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function qT({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),i=o-r;let s=0;o===r?s=0:o===t?e>=n?s=60*(e-n)/i:s=60*(e-n)/i+360:o===e?s=60*(n-t)/i+120:o===n&&(s=60*(t-e)/i+240),s=Math.floor(s);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:s,s:l,v:c}}var Yd=a.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),Kd("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Kd("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=s=>{let l=s.clientX-n,c=s.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const d=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[u,p,f]=d.data;this.$emit("selectSaturation",{r:u,g:p,b:f})};r(t);const i=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)}}});const jT={ref:"canvasSaturation"};function UT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectSaturation&&t.selectSaturation(...s),["prevent","stop"]))},[a.createVNode("canvas",jT,null,512),a.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}Yd.render=UT,Yd.__file="src/color/Saturation.vue";var Jd=a.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=i=>{let s=i.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height),this.slideHueStyle={top:s-2+"px"};const l=n.getImageData(0,Math.min(s,this.height-1),1,1),[c,d,u]=l.data;this.$emit("selectHue",{r:c,g:d,b:u})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const HT={ref:"canvasHue"};function WT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectHue&&t.selectHue(...s),["prevent","stop"]))},[a.createVNode("canvas",HT,null,512),a.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}Jd.render=WT,Jd.__file="src/color/Hue.vue";var Xd=a.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),Kd("p",i,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let i=r.clientY-e;i<0&&(i=0),i>this.height&&(i=this.height);let s=parseFloat((i/this.height).toFixed(2));this.$emit("selectAlpha",s)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const ZT={ref:"canvasAlpha"};function GT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectAlpha&&t.selectAlpha(...s),["prevent","stop"]))},[a.createVNode("canvas",ZT,null,512),a.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}Xd.render=GT,Xd.__file="src/color/Alpha.vue";var Qd=a.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),i.fillStyle=this.color,i.fillRect(0,0,e,n)}}});function KT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("canvas")}Qd.render=KT,Qd.__file="src/color/Preview.vue";var eu=a.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:i,height:s}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,u=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,i-1),Math.min(c,s-1),1,1);let[p,f,m,h]=u.data;h=parseFloat((h/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${p}, ${f}, ${m}, ${h})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:i,width:s,height:l}=t.getBoundingClientRect(),c=n-i,d=o-r,p=t.getContext("2d").getImageData(Math.min(c,s-1),Math.min(d,l-1),1,1);let[f,m,h,g]=p.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:f,g:m,b:h,a:g})}))}}});const YT=a.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),JT={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},XT=a.createVNode("g",{fill:"none","fill-rule":"evenodd"},[a.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[a.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),a.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[a.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function QT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[t.isSucking?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...s)=>t.openSucker&&t.openSucker(...s))},[YT],2)),t.isSucking?(a.openBlock(),a.createBlock("svg",JT,[XT])):a.createCommentVNode("v-if",!0)])}eu.render=QT,eu.__file="src/color/Sucker.vue";var tu=a.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:a.computed({get(){return t.color||""},set(i){e("inputColor",i)}}),handleFocus:i=>{e("inputFocus",i)},handleBlur:i=>{e("inputBlur",i)}}}});const eA={class:"color-type"},tA={class:"name"};function nA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",eA,[a.createVNode("span",tA,a.toDisplayString(t.name),1),a.withDirectives(a.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>t.modelColor=s),class:"value",onFocus:e[2]||(e[2]=(...s)=>t.handleFocus&&t.handleFocus(...s)),onBlur:e[3]||(e[3]=(...s)=>t.handleBlur&&t.handleBlur(...s))},null,544),[[a.vModelText,t.modelColor]])])}tu.render=nA,tu.__file="src/color/Box.vue";var nu=a.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=a.ref(),o=a.ref([]),r=a.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Gd(4).toDataURL(),a.onUnmounted(()=>{i(n.value)});function i(l){if(!l)return;const c=o.value||[],d=c.indexOf(l);d>=0&&c.splice(d,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function s(l){e("selectColor",l)}return{setColorsHistory:i,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:s}}});const oA={class:"colors"},rA={key:0,class:"colors history"};function aA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[a.createVNode("ul",oA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsDefault,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(a.openBlock(),a.createBlock("ul",rA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsHistory,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))])):a.createCommentVNode("v-if",!0)])}nu.render=aA,nu.__file="src/color/Colors.vue";var Wr=a.defineComponent({components:{Saturation:Yd,Hue:Jd,Alpha:Xd,Preview:Qd,Sucker:eu,Box:tu,Colors:nu},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return FT(this.rgba,!0)}},created(){Object.assign(this,nr(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s:i,v:s}=nr(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s:i,v:s}=nr(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const iA={class:"color-set"};function sA(t,e,n,o,r,i){const s=a.resolveComponent("Saturation"),l=a.resolveComponent("Hue"),c=a.resolveComponent("Alpha"),d=a.resolveComponent("Preview"),u=a.resolveComponent("Sucker"),p=a.resolveComponent("Box"),f=a.resolveComponent("Colors");return a.openBlock(),a.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[a.createVNode("div",iA,[a.createVNode(s,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),a.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),a.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),a.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[a.createVNode(d,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(u,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),a.createVNode(p,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(p,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(f,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),a.createCommentVNode(" custom options "),a.renderSlot(t.$slots,"default")],6)}Wr.render=sA,Wr.__file="src/color/ColorPicker.vue",Wr.install=t=>{t.component(Wr.name,Wr)};const oge="",lA={class:"color-picker-wrapper"},rl=a.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(!1),i=a.ref(null),s=a.ref(null),l=a.ref(0),c=a.ref(0),d=async h=>{s.value=h,r.value=!0,await a.nextTick();const g=h.getBoundingClientRect(),v=i.value,_=(v==null?void 0:v.offsetHeight)||300,b=window.innerHeight-g.bottom,y=g.top,w=b<_&&y>_;console.log("pickerHeight = "+_),l.value=w?g.top-_-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",p)},0)},u=a.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),p=h=>{const g=h.target;i.value&&!i.value.contains(g)&&(r.value=!1,o("update:color",f.value),window.removeEventListener("click",p))};a.onBeforeUnmount(()=>{window.removeEventListener("click",p)}),a.watch(()=>n.color,h=>{r.value||(f.value=h)});const f=a.ref(n.color),m=h=>{const{r:g,g:v,b:_,a:b}=h.rgba;f.value=`rgba(${g}, ${v}, ${_}, ${b})`};return(h,g)=>(a.openBlock(),a.createElementBlock("div",lA,[a.renderSlot(h.$slots,"clickable",{openPicker:d,bgColor:t.color}),r.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:i,class:"color-picker",style:a.normalizeStyle(u.value)},[a.createVNode(a.unref(Wr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):a.createCommentVNode("",!0)]))}}),rge="",cA={class:"ao-card-project-phase__header"},dA={class:"ao-card-project-item__title-line"},uA={key:0,class:"ao-card-project-item-phase__estimation"},pA={class:"ao-card-project-phase__footer"},fA={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},mA={class:"ao-card-project-phase__subitem"},hA={class:"ao-card-project-phase__subitem"},gA={key:0,class:"ao-card-project-phase__secondary"},bA={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},vA=a.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ti(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===ea.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v(_)};return(g,v)=>(a.openBlock(),a.createBlock(rl,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(nl,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",dA,[a.createVNode(dt,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",uA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",pA,[d.value?(a.openBlock(),a.createElementBlock("div",fA,[a.createElementVNode("div",mA,[a.createVNode(we,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",hA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(ol,{percentages:p.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",gA,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-card-project-phase__footer-row",f.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",bA,a.toDisplayString(a.unref(Ai)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",cA,[a.createVNode(he,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:v[0]||(v[0]=a.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),age="",yA=a.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",{class:"aoBadge",style:a.normalizeStyle({backgroundColor:t.color})},null,4))}}),ige="",_A={class:"ao-card-project-milestone__default"},CA={class:"ao-title-with-badge-wrapper"},wA={class:"ao-card-project-item__title-line"},kA={key:0,class:"ao-card-project-item-milestone__estimation"},xA={key:0,class:"ao-card-project-milestone__archive"},EA={class:"ao-card-project-milestone__activities"},SA={class:"ao-card-project-milestone__activities-row"},TA={class:"ao-card-project-milestone__subitem"},AA={class:"ao-card-project-milestone__subitem"},NA={key:1,class:"ao-card-project-milestone__secondary"},DA={class:"ao-card-project-milestone__footer"},BA={key:1,class:"ao-field ao-card-project-milestone__deadline"},MA={class:"ao-field__label"},LA={key:2,class:"ao-card-project-milestone__assignee"},$A=a.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>{var f;return((f=n.activities)==null?void 0:f.reduce((m,h)=>m+(h.estimation||0),0))||0}),i=a.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((f,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return f+((h==null?void 0:h.timeSpent)||0)},0)),s=a.computed(()=>n.estimationUnit==="days"?"d":"h"),l=a.computed(()=>Ti(i.value,n.estimationUnit));a.computed(()=>{const f=i.value/60;return f%1===0?f.toString():f.toFixed(2)});const c=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.length}),d=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.filter(m=>_l(m,n.closedStatus)).length}),u=a.computed(()=>(d.value||0)/(c.value||1)),p=f=>{o("updateMilestone",{id:n.id,name:f})};return(f,m)=>(a.openBlock(),a.createBlock(nl,{class:a.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:a.withCtx(()=>[a.createElementVNode("div",_A,[a.createElementVNode("div",CA,[a.createVNode(yA,{color:t.color||""},null,8,["color"]),a.createElementVNode("div",wA,[a.createVNode(dt,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":p},null,8,["id","title","is-editable"]),r.value||i.value?(a.openBlock(),a.createElementBlock("span",kA," ("+a.toDisplayString(l.value)+"/"+a.toDisplayString(r.value)+a.toDisplayString(s.value)+")",1)):a.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(a.openBlock(),a.createElementBlock("div",xA,[a.createVNode(he,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?f.$t("archive"):f.$t("unarchive"),onClick:m[0]||(m[0]=a.withModifiers(()=>t.active?f.$emit("archiveMilestone",{id:t.id}):f.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",EA,[a.createElementVNode("div",SA,[c.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",TA,[a.createVNode(we,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",AA,a.toDisplayString(d.value)+" / "+a.toDisplayString(c.value),1)]),a.createVNode(ol,{percentages:u.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):a.createCommentVNode("",!0),f.$slots.secondary?(a.openBlock(),a.createElementBlock("div",NA,[a.renderSlot(f.$slots,"secondary")])):a.createCommentVNode("",!0)])])]),footer:a.withCtx(()=>[a.createElementVNode("div",DA,[t.important?(a.openBlock(),a.createBlock(we,{key:0,name:"FlagRounded",class:a.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):a.createCommentVNode("",!0),t.deadline?(a.openBlock(),a.createElementBlock("label",BA,[a.createElementVNode("span",MA,a.toDisplayString(a.unref(Ai)(t.deadline)),1)])):a.createCommentVNode("",!0),t.assignee?(a.openBlock(),a.createElementBlock("div",LA,[a.createVNode(Dn,{"user-name":a.unref(zu)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):a.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}}),sge="",OA={class:"ao-mapping-card-project-phase__header"},IA={class:"ao-card-project-item__title-line"},VA={key:0,class:"ao-card-project-item-phase__estimation"},PA={class:"ao-mapping-card-project-phase__footer"},RA={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},FA={class:"ao-mapping-card-project-phase__subitem"},zA={class:"ao-mapping-card-project-phase__subitem"},qA={key:0,class:"ao-mapping-card-project-phase__secondary"},jA={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},UA=a.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ti(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===ea.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v()};return(g,v)=>(a.openBlock(),a.createBlock(rl,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(nl,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",IA,[a.createVNode(dt,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",VA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",PA,[d.value?(a.openBlock(),a.createElementBlock("div",RA,[a.createElementVNode("div",FA,[a.createVNode(we,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",zA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(ol,{percentages:p.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",qA,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-mapping-card-project-phase__footer-row",f.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",jA,a.toDisplayString(a.unref(Ai)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",OA,[a.createVNode(he,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:v[0]||(v[0]=a.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),lge="",HA={class:"ao-project-phase"},WA={key:0,class:"ao-project-phase__drag ao-card__drag"},ZA={key:1,class:"ao-project-phase__col-phase"},GA={key:2,class:"ao-mapping-project-phase__col-phase"},KA={key:0,class:"ao-project-phase__col-milestones"},YA=["title"],JA={class:"ao-project-phase__milestones-list-footer"},XA=a.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e;a.watch(()=>o.phase.milestones,(k,C)=>{On(k,C)});const i=k=>{r("updatePhase",{id:o.phase.id,name:k})},s=k=>{r("updatePhase",{id:o.phase.id,deadline:k})},l=k=>{r("updatePhase",k)},c=a.computed(()=>o.phase.milestones.map(k=>i5(k,o.closedStatus))),d=k=>{const{name:C,rank:x}=tr(c.value??[],"milestone",n);r("addMilestone",{name:C,rank:x,phaseId:k})},u=k=>{const C=n("template.defaultName.milestone",{idx:1}),x=fa(c.value??[]);r("addMilestone",{name:C,rank:x,phaseId:k})},p=k=>{r("updateMilestone",k)},f=k=>{r("archiveMilestone",k)},m=k=>{r("unarchiveMilestone",k)},h=k=>{r("archivePhase",k)},g=k=>{r("unarchivePhase",k)},v=k=>{"added"in k?r("updateMilestone",{id:k.added.element.id,phaseId:o.phase.id,rank:dr(c.value,k.added.newIndex)}):"removed"in k||"moved"in k&&r("updateMilestone",{id:k.moved.element.id,rank:dr(c.value,k.moved.newIndex)})},_=mt.useRoute(),b=a.computed(()=>_.path.includes("/mapping")),y=a.computed(()=>{var k;return o.phase.id===((k=_.params)==null?void 0:k.phaseId)});a.ref(!1);const w=a.computed(()=>{var k;return o.phase.id!==((k=_.params)==null?void 0:k.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:l5(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(k,C)=>(a.openBlock(),a.createElementBlock("li",HA,[a.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",WA,[a.createVNode(we,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):a.createCommentVNode("",!0),b.value?(a.openBlock(),a.createElementBlock("div",GA,[a.createVNode(UA,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(a.openBlock(),a.createElementBlock("div",ZA,[a.createVNode(vA,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),b.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",KA,[a.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":y.value}]),title:k.$t("project.milestone.add"),onClick:C[0]||(C[0]=()=>u(t.phase.id))},[a.createVNode(we,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,YA)):a.createCommentVNode("",!0),a.createVNode(a.unref(Yn),a.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},k.$attrs,{onChange:v}),{item:a.withCtx(({element:x})=>{var T;return[a.createVNode($A,{id:x.id,name:x.name,color:x.color,"phase-color":t.phase.color,activities:x.activities,deadline:x.deadline,active:x.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":x.id===((T=k.$route.params)==null?void 0:T.milestoneId),assignee:x.assignee,important:x.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:a.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&k.$router.push({name:a.unref(Oe).milestone,params:{phaseId:t.phase.id,milestoneId:x.id}}),onUpdateMilestone:p,onArchiveMilestone:f,onUnarchiveMilestone:m},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),a.createElementVNode("div",JA,[t.isEditable?(a.openBlock(),a.createBlock(Xn,{key:0,label:k.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:C[1]||(C[1]=()=>d(t.phase.id))},null,8,["label"])):a.createCommentVNode("",!0)])],4)]))]))}}),cge="",QA={class:"ao-project__phases"},eN={key:0,class:"ao-project-phase__phases-list-footer"},tN={class:"ao-project-phase__col-phase"},ou=a.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;a.watch(()=>n.phases,(m,h)=>{On(m,h)});const r=m=>{o("addMilestone",m)},i=m=>{o("updateMilestone",m)},s=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},d=m=>{o("unarchivePhase",m)},u=m=>{if(m.moved){const h=pa(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},p=m=>{o("updatePhase",m)},f=m=>{o("addPhase",m)};return(m,h)=>(a.openBlock(),a.createElementBlock("div",QA,[a.createVNode(a.unref(Yn),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:u},{item:a.withCtx(({element:g})=>[a.createVNode(XA,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:i,onArchiveMilestone:s,onUnarchiveMilestone:l,onUpdatePhase:p,onArchivePhase:c,onUnarchivePhase:d},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(a.openBlock(),a.createElementBlock("div",eN,[h[0]||(h[0]=a.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),a.createElementVNode("div",tN,[a.createVNode(Xn,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:f},null,8,["label"])]),h[1]||(h[1]=a.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):a.createCommentVNode("",!0)]))}}),dge="",nN={class:"ao-add-template-modal__form-body"},oN={class:"field__row"},rN={class:"ao-add-template-modal__form-footer"},Tg=a.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),i=a.ref(null),s=c=>{i.value=c},l=()=>{i.value&&o("apply",i.value,n.projectId)};return(c,d)=>(a.openBlock(),a.createBlock(Ni,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(dt,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:a.withModifiers(l,["prevent"])},[a.createElementVNode("p",null,a.toDisplayString(c.$t("project.template.apply.notice")),1),a.createElementVNode("div",nN,[a.createElementVNode("div",oN,[a.createVNode(_t,{value:i.value,options:r.value,detached:!0,onChange:s},null,8,["value","options"])])]),a.createElementVNode("footer",rN,[a.createVNode(he,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}}),uge="",aN={class:"ao-save-template-modal__form-body"},iN={class:"field__row"},sN={class:"ao-field ao-field--inline"},lN={class:"ao-field__label"},cN={class:"ao-save-template-modal__phases"},dN={class:"ao-field__label"},uN={class:"ao-save-template-modal__phases-list"},pN=["value"],fN={class:"ao-save-template-modal__form-footer"},Ag=a.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(""),i=a.ref([]);a.onMounted(()=>{i.value=n.phases.map(l=>l.id)});const s=()=>{r.value&&o("save",r.value,i.value)};return(l,c)=>(a.openBlock(),a.createBlock(Ni,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(dt,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:a.withModifiers(s,["prevent"])},[a.createElementVNode("div",aN,[a.createElementVNode("div",iN,[a.createElementVNode("label",sN,[a.createElementVNode("span",lN,a.toDisplayString(l.$t("project.template.name.label"))+": ",1),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),type:"text"},null,512),[[a.vModelText,r.value]])])]),a.createElementVNode("div",cN,[a.createElementVNode("div",dN,a.toDisplayString(l.$t("project.template.phases.label")),1),a.createElementVNode("div",uN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.phases,d=>(a.openBlock(),a.createElementBlock("label",{key:d.id,class:"ao-field ao-field--checkbox"},[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>i.value=u),type:"checkbox",value:d.id},null,8,pN),[[a.vModelCheckbox,i.value]]),a.createElementVNode("span",null,a.toDisplayString(d.name),1)]))),128))])])]),a.createElementVNode("footer",fN,[a.createVNode(he,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:s},null,8,["label"])])],32)]),_:1}))}}),pge="",mN={class:"ao-project"},hN={class:"ao-project__body"},gN=a.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e,i=a.computed(()=>o.phases.flatMap(P=>P.milestones)),s=()=>{const{name:P,rank:Q}=tr(o.phases,"phase",n);r("addPhase",{name:P,rank:Q,projectId:o.project.id})},l=()=>{const P=n("template.defaultName.phase",{idx:1}),Q=fa(o.phases);r("addPhase",{name:P,rank:Q,projectId:o.project.id})},c=P=>{r("updatePhase",P)},d=P=>{r("archivePhase",P)},u=P=>{r("unarchivePhase",P)},p=P=>{r("copyPhaseToTemplate",P)},f=P=>{r("addMilestone",P)},m=P=>{r("updateMilestone",P)},h=P=>{r("archiveMilestone",P)},g=P=>{r("unarchiveMilestone",P)},v=P=>{r("addActivity",P)},_=P=>{r("update:activity",P)},b=P=>{r("archiveActivity",P)},y=P=>{r("unarchiveActivity",P)},w=P=>{r("addSubtask",P)},k=P=>{r("updateSubtask",P)},C=P=>{r("deleteSubtask",P)},x=a.computed(()=>i.value.flatMap(P=>P.activities)),T=P=>{r("addFiles",P)},S=P=>{r("removeFile",P)},N=P=>{r("addComment",P)},O=P=>{r("updateComment",P)},A=P=>{r("removeComment",P)},D=a.ref(!1),B=a.ref(!1),I=(P,Q)=>{r("applyTemplate",{templateId:P,projectId:Q}),D.value=!1},V=(P,Q)=>{var ie;const ee=(ie=o.templates)==null?void 0:ie.at(-1),be=ee?Xe.LexoRank.parse(ee.rank).genNext():Xe.LexoRank.middle();r("saveTemplate",{templateName:P,rank:be.format(),phaseIds:Q}),B.value=!1},H=mt.useRouter(),R=a.ref("overview"),q=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(R,P=>{P==="feed"?(H.push({name:Oe.feed}),console.log("Navigating to feed...")):P==="dev"?(H.push({name:Oe.dev}),console.log("Navigating to dev...")):P==="overview"?(H.push({name:Oe.project}),console.log("Navigating to feed...")):P==="mapping"&&(H.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(P,Q)=>{var be;const ee=a.resolveComponent("RouterView");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-overview"},P.$attrs),[a.createElementVNode("div",mN,[a.createVNode(ma,null,{primary:a.withCtx(()=>[a.createVNode(oi,{modelValue:R.value,"onUpdate:modelValue":Q[0]||(Q[0]=ie=>R.value=ie),tabs:q},null,8,["modelValue"]),a.createVNode(he,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=ie=>P.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("project.phase.add"),onClick:l},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:1,class:"ao-project-overview__save-as-template",color:"primary",label:P.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=ie=>B.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:2,class:"ao-project-overview__add-template",color:"primary",label:P.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=ie=>D.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",hN,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(be=t.project)==null?void 0:be.estimationUnit,onAddMilestone:f,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:s,onUpdatePhase:c,onArchivePhase:d,onUnarchivePhase:u,onCopyPhaseToTemplate:p},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),a.createVNode(ee,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:Q[4]||(Q[4]=ie=>P.$router.push({name:a.unref(Oe).project})),onUpdateMilestone:m,onAddActivity:v,onUpdateActivity:_,onArchiveActivity:b,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(ee,{name:"modal",activities:x.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":t.loadAttachmentPreview,"onUpdate:activity":_,onAddSubtask:w,onUpdateSubtask:k,onDeleteSubtask:C,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:O,onRemoveComment:A},{default:a.withCtx(({Component:ie})=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ie),null,{default:a.withCtx(se=>[a.renderSlot(P.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(se)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data","load-attachment-preview"])]))],16),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[B.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=ie=>B.value=!1),onSave:V},null,8,["phases"])):a.createCommentVNode("",!0),D.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=ie=>D.value=!1),onApply:I},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),fge="",bN={class:"ao-card-feed__header"},vN={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},yN={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},_N={class:"ao-card-feed__body"},CN={key:0,class:"ao-card-feed__breadcrumbs"},wN={class:a.normalizeClass(["ao-card-feed__title-group"])},kN={class:"ao-card-feed__title-line"},xN={key:0,class:"ao-card-feed__slug"},EN={key:1,class:"ao-card-feed__deadline"},SN={class:"ao-card-feed__footer"},TN={class:"ao-card-feed__footer-row"},AN={class:"ao-assignees"},NN={key:0,class:"ao-assignee"},DN={key:0,class:"ao-card-feed__subitems"},BN={key:0,class:"ao-card-feed__subitem"},MN={class:"ao-card-feed__subitem"},LN={key:1,class:"ao-card-feed__subitem"},$N={class:"ao-card-feed__subitem"},ON={class:"ao-card-feed__timer-wrapper"},IN={class:"ao-card-feed__footer-row"},VN={key:0,class:"ao-card-feed__progress-wrapper"},PN={class:"ao-card-feed__subitem"},RN={class:"ao-card-feed__subitem"},ru=a.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),i=a.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),s=g=>{o("updateActivity",{id:n.id,name:g})},l=a.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=a.computed(()=>n.assignee?[n.assignee]:[]),d=a.computed(()=>Ai(n.deadline)),u=g=>{o("removeAssignee",g)},p=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},f=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(v=>v.isDone).length}),h=a.computed(()=>(m.value||0)/(f.value||1));return(g,v)=>(a.openBlock(),a.createBlock(nl,{class:a.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:a.withCtx(()=>[a.createElementVNode("div",bN,[r.value?(a.openBlock(),a.createBlock(Qr,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":i.value},null,8,["label","color","raw-color"])):a.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(a.openBlock(),a.createElementBlock("div",vN,[t.isPrivate?(a.openBlock(),a.createBlock(we,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):a.createCommentVNode("",!0),t.important?(a.openBlock(),a.createBlock(we,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):a.createCommentVNode("",!0),t.isClosed?(a.openBlock(),a.createBlock(we,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",yN,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])]),default:a.withCtx(()=>[a.createElementVNode("div",_N,[l.value?(a.openBlock(),a.createElementBlock("span",CN,a.toDisplayString(l.value),1)):a.createCommentVNode("",!0),a.createElementVNode("div",wN,[a.createElementVNode("div",kN,[t.slug?(a.openBlock(),a.createElementBlock("span",xN,a.toDisplayString(t.slug)+": ",1)):a.createCommentVNode("",!0),a.createVNode(dt,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":s},null,8,["id","title","is-editable"])])]),t.deadline?(a.openBlock(),a.createElementBlock("span",EN,a.toDisplayString(d.value),1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",SN,[a.createElementVNode("div",TN,[a.createElementVNode("ul",AN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,_=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_.id},[_?(a.openBlock(),a.createElementBlock("li",NN,[a.createVNode(Dn,{"user-name":a.unref(zu)(_),"avatar-url":_.avatarUrl,"is-closable":!0,onClose:()=>u(_.id)},null,8,["user-name","avatar-url","onClose"])])):a.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(a.openBlock(),a.createElementBlock("ul",DN,[t.comments?(a.openBlock(),a.createElementBlock("li",BN,[a.createVNode(we,{name:"ChatOutline",size:"sm"}),a.createElementVNode("span",MN,a.toDisplayString(t.comments),1)])):a.createCommentVNode("",!0),t.attachments?(a.openBlock(),a.createElementBlock("li",LN,[a.createVNode(we,{name:"AttachFileRounded",size:"sm"}),a.createElementVNode("span",$N,a.toDisplayString(t.attachments),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",ON,[a.createVNode(we,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:a.withModifiers(p,["stop"])})])]),a.createElementVNode("div",IN,[t.tasks&&t.tasks.length?(a.openBlock(),a.createElementBlock("div",VN,[a.createElementVNode("div",PN,[a.createVNode(we,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",RN,a.toDisplayString(m.value)+" / "+a.toDisplayString(f.value),1)]),a.createVNode(ol,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):a.createCommentVNode("",!0)])])]),_:3},8,["class"]))}}),mge="",FN={class:"ao-project-milestone"},zN={class:"ao-project-milestone__header"},qN={class:"ao-project-milestone__header_line"},jN={class:"ao-project-milestone__header_line"},UN={class:"ao-project-milestone__title"},HN={key:0,class:"ao-fieldset ao-milestone__fieldset"},WN={class:"ao-field__row ao-milestone__field-row"},ZN={class:"ao-field ao-field--inline"},GN={class:"ao-field__row ao-milestone__field-row"},KN={class:"ao-field ao-milestone__field-multiselect"},YN={class:"ao-milestone__color-actions"},JN=["onClick"],XN=["title"],QN={class:"ao-project-milestone__body"},eD={key:0,class:"ao-project-milestone__footer"},Ng=a.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e,i=C=>{var x;r("startTimer",C),(x=window.parent)==null||x.postMessage({type:"startTimer",data:C},"*")},s=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(x=>x.id===o.phaseId)}),l=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(x=>x.milestones)}),c=a.computed(()=>{var C;return(C=l.value)==null?void 0:C.find(x=>x.id===o.milestoneId)}),d=a.computed(()=>{var C;return(C=c.value)==null?void 0:C.activities});a.watch(d,(C,x)=>{On(C,x)});const u=C=>{r("close",C)},p=()=>{const{name:C,rank:x}=tr(d.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},f=()=>{const C=n("template.defaultName.activity",{idx:1}),x=fa(d.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},m=C=>{r("updateActivity",C)},h=C=>{d.value&&"moved"in C&&r("updateActivity",{id:C.moved.element.id,rank:dr(d.value,C.moved.newIndex)})},g=a.computed({get:()=>{var C;return(C=c.value)==null?void 0:C.color},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,color:C})}}),v=a.computed({get:()=>{var C;return((C=c==null?void 0:c.value)==null?void 0:C.deadline)??""},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:C!=null&&C.length?C:null})}}),_=C=>o.closedStatus?_l(C,o.closedStatus):!1,b=a.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(x=>({label:`${x.firstName} ${x.lastName}`,value:x.id,avatar:x.avatarUrl})))||[]}),y=a.computed({get(){var C,x;return(x=(C=c.value)==null?void 0:C.assignee)!=null&&x.id?[c.value.assignee.id]:[]},set(C){r("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),w=a.computed({get(){var C;return((C=c.value)==null?void 0:C.important)??!1},set(C){r("updateMilestone",{id:o.milestoneId,important:C})}}),k=(C,x)=>{const T=C.currentTarget;T instanceof HTMLElement&&x(T)};return(C,x)=>{var T;return a.openBlock(),a.createElementBlock("div",FN,[a.createElementVNode("header",zN,[a.createElementVNode("div",qN,[a.createVNode(he,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:u})]),a.createElementVNode("div",jN,[a.createElementVNode("div",UN,[a.createVNode(dt,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),a.createVNode(xg,{modelValue:w.value,"onUpdate:modelValue":x[0]||(x[0]=S=>w.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:C.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(a.openBlock(),a.createElementBlock("div",HN,[a.createElementVNode("div",WN,[a.createElementVNode("label",ZN,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=S=>v.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[a.vModelText,v.value,void 0,{lazy:!0}]])])]),a.createElementVNode("div",GN,[a.createElementVNode("label",KN,[a.createVNode(_t,{modelValue:y.value,"onUpdate:modelValue":x[2]||(x[2]=S=>y.value=S),options:b.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:C.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:a.withCtx(({option:S,handleTagRemove:N})=>[a.createVNode(Dn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:O=>N(S,O)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),a.createElementVNode("div",YN,[a.createVNode(rl,{color:g.value,"onUpdate:color":x[3]||(x[3]=S=>g.value=S)},{clickable:a.withCtx(({openPicker:S,bgColor:N})=>[a.createElementVNode("button",{style:a.normalizeStyle({background:N}),class:"color-button",onClick:O=>k(O,S)},null,12,JN)]),_:1},8,["color"]),t.isEditable?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"ao-project-milestone__quick-add",title:C.$t("project.activity.add"),onClick:f},[a.createVNode(we,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,XN)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",QN,[a.createVNode(a.unref(Yn),a.mergeProps({class:"ao-project-milestone__activities",list:d.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:h}),{item:a.withCtx(({element:S})=>{var N,O,A,D,B;return[a.createVNode(ru,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=s.value)==null?void 0:N.name,"milestone-name":(O=c.value)==null?void 0:O.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:S.deadline,important:S.important,users:t.users,assignee:S.assignee,slug:S.slug,comments:(D=S.comments)==null?void 0:D.length,attachments:(B=S.attachments)==null?void 0:B.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":_(S),onClick:I=>C.$router.push({name:a.unref(Oe).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:i},a.createSlots({_:2},[t.isEditable?{name:"secondary",fn:a.withCtx(()=>[t.isEditable&&S.active?(a.openBlock(),a.createBlock(he,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:a.withModifiers(()=>C.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),t.isEditable&&!S.active?(a.openBlock(),a.createBlock(he,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>C.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(a.openBlock(),a.createElementBlock("div",eD,[a.createVNode(Xn,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:p},null,8,["label"])])):a.createCommentVNode("",!0)])])}}}),hge="",tD=a.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.find(b=>b.id===n.phaseId)}),i=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.flatMap(b=>b.milestones)}),s=a.computed(()=>{var _;return(_=i.value)==null?void 0:_.find(b=>b.id===n.milestoneId)}),l=a.computed(()=>{var _;return(_=n.activities)==null?void 0:_.find(b=>b.id===n.activityId)}),c=_=>{o("update:activity",_)},d=_=>{o("addSubtask",_)},u=_=>{o("updateSubtask",_)},p=_=>{o("deleteSubtask",_)},f=_=>{o("addFiles",_)},m=_=>{o("removeFile",_)},h=_=>{o("addComment",_)},g=_=>{o("updateComment",_)},v=_=>{o("removeComment",_)};return(_,b)=>{var y,w;return l.value?(a.openBlock(),a.createBlock(Zd,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(y=r.value)==null?void 0:y.name} / ${(w=s.value)==null?void 0:w.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,onClose:_.$router.back,"onUpdate:activity":c,onAddSubtask:d,onUpdateSubtask:u,onDeleteSubtask:p,onAddFiles:f,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:v},{default:a.withCtx(k=>[a.renderSlot(_.$slots,"default",a.normalizeProps(a.guardReactiveProps(k)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","onClose"])):a.createCommentVNode("",!0)}}}),nD={class:"ao-col-header"},oD=a.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("header",nD,[a.createVNode(dt,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(a.openBlock(),a.createBlock(Qr,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):a.createCommentVNode("",!0)]))}}),gge="";function rD(t){return a.getCurrentScope()?(a.onScopeDispose(t),!0):!1}function al(t){return typeof t=="function"?t():a.unref(t)}const aD=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const iD=t=>t!=null,ri=()=>{};function sD(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function lD(t,e={}){let n,o,r=ri;const i=l=>{clearTimeout(l),r(),r=ri};return l=>{const c=al(t),d=al(e.maxWait);return n&&i(n),c<=0||d!==void 0&&d<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((u,p)=>{r=e.rejectOnCancel?p:u,d&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,u(l())},d)),n=setTimeout(()=>{o&&i(o),o=null,u(l())},c)})}}function cD(t,e=200,n={}){return sD(lD(e,n),t)}function au(t){var e;const n=al(t);return(e=n==null?void 0:n.$el)!=null?e:n}const dD=aD?window:void 0;function uD(){const t=a.ref(!1),e=a.getCurrentInstance();return e&&a.onMounted(()=>{t.value=!0},e),t}function pD(t){const e=uD();return a.computed(()=>(e.value,!!t()))}function fD(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:i=.1,window:s=dD,immediate:l=!0}=n,c=pD(()=>s&&"IntersectionObserver"in s),d=a.computed(()=>{const h=al(t);return(Array.isArray(h)?h:[h]).map(au).filter(iD)});let u=ri;const p=a.ref(l),f=c.value?a.watch(()=>[d.value,au(o),p.value],([h,g])=>{if(u(),!p.value||!h.length)return;const v=new IntersectionObserver(e,{root:au(g),rootMargin:r,threshold:i});h.forEach(_=>_&&v.observe(_)),u=()=>{v.disconnect(),u=ri}},{immediate:l,flush:"post"}):ri,m=()=>{u(),f(),p.value=!1};return rD(m),{isSupported:c,isActive:p,pause(){u(),p.value=!1},resume(){p.value=!0},stop:m}}const mD={class:a.normalizeClass(["ao-list-kanban"])},hD={class:"ao-list-kanban__header"},gD=["title"],bD={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},vD={key:1,class:"ao-list-kanban__end"},yD={key:0,class:"ao-list-kanban__no-more"},_D={key:1,class:"ao-list-kanban__divider"},CD={key:1,class:"ao-list-kanban__footer"},wD=a.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{},showHeaderAdd:{type:Boolean},isDevMode:{type:Boolean}},emits:["add","addAtBeginning","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(!1),i=a.ref(null);fD(i,([{isIntersecting:p}])=>{r.value=p}),a.watch(r,p=>{p&&n.hasMore&&!n.isLoading&&o("loadMore")});const s=p=>{var f;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((f=p.assignee)==null?void 0:f.id):!1},l=p=>{o("selectActivity",p)},c=p=>{o("updateActivity",p)},d=p=>{if("added"in p){const f={id:p.added.element.id,rank:dr(n.list,p.added.newIndex)};n.isDevMode?f.statusDevId=n.status.id:f.statusId=n.status.id,o("updateActivity",f)}else"removed"in p||"moved"in p&&o("updateActivity",{id:p.moved.element.id,rank:dr(n.list,p.moved.newIndex)})},u=a.ref(!1);return(p,f)=>(a.openBlock(),a.createElementBlock("div",mD,[t.title||p.$slots.header?a.renderSlot(p.$slots,"header",{},()=>{var m;return[a.createElementVNode("div",hD,[t.title?(a.openBlock(),a.createBlock(oD,{key:0,class:"ao-list-kanban__col-header",title:t.title,level:3,items:(m=t.list)==null?void 0:m.length},null,8,["title","items"])):a.createCommentVNode("",!0),t.showHeaderAdd?(a.openBlock(),a.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:p.$t("feed.activity.add"),onClick:f[0]||(f[0]=h=>p.$emit("addAtBeginning"))},[a.createVNode(we,{name:"Add"})],8,gD)):a.createCommentVNode("",!0)])]},void 0,0):a.createCommentVNode("",!0),a.createVNode(a.unref(Yn),a.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},p.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:d,onStart:f[2]||(f[2]=m=>u.value=!0),onEnd:f[3]||(f[3]=m=>u.value=!1)}),{item:a.withCtx(({element:m})=>{var h,g,v,_,b,y,w,k,C,x;return[a.createVNode(ru,{id:m.id,class:a.normalizeClass(s(m)?"ao-list-draggable":""),name:m.name,"project-name":(h=m.project)==null?void 0:h.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(v=m.project)==null?void 0:v.color,"phase-name":(b=(_=m.milestone)==null?void 0:_.phase)==null?void 0:b.name,"milestone-name":(y=m.milestone)==null?void 0:y.name,"milestone-color":(w=m.milestone)==null?void 0:w.color,deadline:m.deadline,rules:((k=m.rules)==null?void 0:k.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(C=m.comments)==null?void 0:C.length,attachments:(x=m.attachments)==null?void 0:x.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":s(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>s(m)&&c(T),()=>s(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>s(m)&&c({id:m.id,assigneeId:null}),onStartTimer:f[1]||(f[1]=T=>p.$emit("startTimer",T))},{secondary:a.withCtx(()=>[s(m)&&m.active?(a.openBlock(),a.createBlock(he,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.archive"),onClick:a.withModifiers(()=>p.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),s(m)&&!m.active?(a.openBlock(),a.createBlock(he,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>p.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:a.withCtx(()=>[t.isLoading?(a.openBlock(),a.createElementBlock("div",bD,[a.createVNode(we,{name:"Loading"})])):t.hasMore?(a.openBlock(),a.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:i,class:"ao-list-kanban__end"},null,512)):(a.openBlock(),a.createElementBlock("div",vD,[t.noMoreLabel?(a.openBlock(),a.createElementBlock("span",yD,a.toDisplayString(t.noMoreLabel),1)):t.isEditable?(a.openBlock(),a.createElementBlock("span",_D)):a.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),p.$slots.footer||t.footerLabel?(a.openBlock(),a.createElementBlock("div",CD,[a.renderSlot(p.$slots,"footer",{},()=>[t.isEditable?(a.openBlock(),a.createBlock(Xn,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:f[4]||(f[4]=m=>p.$emit("add"))},null,8,["label"])):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]))}}),bge="",kD={class:"ao-field ao-search-field"},xD=["value","placeholder"],ED=a.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const d=l.target.value;o("update:modelValue",d,l)},i=cD(r,n.delay),s=l=>{o("clear",l)};return(l,c)=>(a.openBlock(),a.createElementBlock("div",kD,[a.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...d)=>a.unref(i)&&a.unref(i)(...d)),onKeypress:a.withKeys(r,["enter"])},null,40,xD),a.createVNode(we,{name:"SearchRounded",class:a.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),a.createVNode(he,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:a.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:s},null,8,["class"])]))}}),vge="",SD={class:"ao-feed"},TD={class:"ao-feed__filters"},AD={class:"ao-feed__body"},iu=a.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e;function i(U,te){r("toast",U,te)}const s=a.toRef(o,"activities"),l=a.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses);a.computed(()=>o.feedMode==="dev"?"devStatus":"status");const c=a.computed(()=>o.feedMode==="dev"?s.value.filter(U=>U.activityType==="dev"):s.value),d=async(U,te)=>{await r("selectActivity",U,te)},u=a.ref({}),p=a.ref(!1),f=a.ref(!1),m=a.computed(()=>o.project?"milestone":"project");a.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([U,te,Ie,le],[Ue,L])=>{const K=o.feedMode==="dev"?"devStatus":"status";u.value=Object.fromEntries(U.map(ue=>[ue.id,te.filter(Ee=>{const Me=Ee[K];return(Me==null?void 0:Me.id)===ue.id})])),Ie&&!p.value?(d(Ie,null),p.value=!0):le&&!p.value&&(d(null,le),p.value=!0),f.value&&On(te,L)},{immediate:!0});const h=a.computed(()=>{var U;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((U=o.selectedActivity.milestone.phase)==null?void 0:U.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=U=>{var ue;const te=o.feedMode==="dev"?o.activities.filter(Ee=>Ee.activityType==="dev"):o.activities,Ie=te==null?void 0:te.at(-1),le=Ie?Xe.LexoRank.parse(Ie.rank).genNext():Xe.LexoRank.middle(),Ue=((ue=o.activities)==null?void 0:ue.length)??0,L=o.feedMode==="dev",K={name:n("activity.defaultName",{idx:Ue+1}),rank:le.format(),...L?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};o.filters.assigneeId.length>0&&(K.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(K.projectId=o.filters.projectId[0]),f.value=!0,r("addActivity",K)},v=U=>{var ue,Ee;const te=o.feedMode==="dev"?"devStatus":"status",Ie=((ue=o.activities)==null?void 0:ue.filter(Me=>{const ve=Me[te];return(ve==null?void 0:ve.id)===U.id}))??[],le=fa(Ie),Ue=((Ee=o.activities)==null?void 0:Ee.length)??0,L=o.feedMode==="dev",K={name:n("activity.defaultName",{idx:Ue+1}),rank:le,...L?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};o.filters.assigneeId.length>0&&(K.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(K.projectId=o.filters.projectId[0]),f.value=!0,r("addActivity",K)},_=(U,te)=>{f.value=!1,r("update:filters",{...o.filters,[U]:te})},b=a.computed(()=>o.project?[o.project]:o.projects??[]),y=a.computed(()=>b.value.map(U=>({value:U.id,label:U.name}))),w=a.computed(()=>{var U;return(U=o.activityTypes)==null?void 0:U.map(te=>({value:te.id,label:te.name}))}),k=a.computed(()=>o.users.map(U=>({value:U.id,label:`${U.firstName} ${U.lastName}`,avatar:U.avatarUrl}))),C=U=>{o.selectedActivity&&r("update:activity",U)},x=U=>{r("update:activity",U)},T=U=>{r("archiveActivity",U)},S=U=>{r("unarchiveActivity",U)},N=U=>{var te;r("startTimer",U),(te=window.parent)==null||te.postMessage({type:"startTimer",data:U},"*")},O=U=>{f.value=!1,r("update:searchText",U)},A=U=>{f.value=!1,r("clear:searchText",U)},D=U=>{o.selectedActivity&&r("addSubtask",U)},B=U=>{o.selectedActivity&&r("updateSubtask",U)},I=U=>{o.selectedActivity&&r("deleteSubtask",U)},V=U=>{r("addFiles",U)},H=U=>{r("removeFile",U)},R=U=>{o.selectedActivity&&r("addComment",{...U,activityId:o.selectedActivity.id})},q=U=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",U)},P=U=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",U)},Q=mt.useRouter(),ee=mt.useRoute(),be=a.ref("feed");a.watch(()=>ee.name,U=>{U===rr.feed||U==="ActivityFeed"||U==="ActivityFeedWithActivity"?be.value="feed":U===rr.dev||U==="ActivityFeedDev"||U==="ActivityFeedDevWithActivity"?be.value="dev":U===Oe.feed?be.value="feed":U===Oe.dev?be.value="dev":U===Oe.project?be.value="overview":U===Oe.mapping&&(be.value="mapping")},{immediate:!0});const ie=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],se=a.computed(()=>z.value?ie.filter(U=>U.value==="feed"||U.value==="dev"):ie),z=a.computed(()=>!o.project&&ee.name&&(ee.name===rr.feed||ee.name===rr.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),re=a.computed(()=>z.value?rr.feed:Oe.feed),_e=a.computed(()=>z.value?rr.dev:Oe.dev),Be=a.computed(()=>Oe.project),rt=a.computed(()=>Oe.mapping);return a.watch(be,U=>{U==="feed"?Q.push({name:re.value}):U==="dev"?Q.push({name:_e.value}):U==="overview"?Q.push({name:Be.value}):U==="mapping"&&Q.push({name:rt.value})}),(U,te)=>{var Ie;return a.openBlock(),a.createElementBlock("div",SD,[a.createVNode(ma,null,{primary:a.withCtx(()=>[a.createElementVNode("div",TD,[a.createVNode(oi,{modelValue:be.value,"onUpdate:modelValue":te[0]||(te[0]=le=>be.value=le),tabs:se.value},null,8,["modelValue","tabs"]),a.createVNode(ED,{"model-value":t.searchText,placeholder:U.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":O,onClear:A},null,8,["model-value","placeholder"]),o.project?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(_t,{key:0,"model-value":t.filters[a.unref(xo).project],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:U.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>_(a.unref(xo).project,le))},null,8,["model-value","options","placeholder"])),w.value?(a.openBlock(),a.createBlock(_t,{key:1,"model-value":t.filters[a.unref(xo).type],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:U.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>_(a.unref(xo).type,le))},null,8,["model-value","options","placeholder"])):a.createCommentVNode("",!0),k.value.length?(a.openBlock(),a.createBlock(_t,{key:2,"model-value":t.filters[a.unref(xo).assignee],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:U.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>_(a.unref(xo).assignee,le))},{tag:a.withCtx(({option:le,handleTagRemove:Ue})=>[a.createVNode(Dn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:L=>Ue(le,L)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):a.createCommentVNode("",!0)]),a.createVNode(he,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:U.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>U.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),a.createVNode(he,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:U.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>U.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),a.createVNode(he,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:U.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>U.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),a.createElementVNode("div",AD,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,le=>(a.openBlock(),a.createBlock(wD,{key:le.id,status:le,list:u.value[le.id],title:le.name,"footer-label":U.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>v(le),onSelectActivity:d,onArchiveActivity:T,onUnarchiveActivity:S,onUpdateActivity:x,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[t.selectedActivity?(a.openBlock(),a.createBlock(Zd,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Ie=t.selectedActivity.milestone)==null?void 0:Ie.id,"template-activities":s.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:b.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,onClose:te[7]||(te[7]=()=>d(null,null)),"onUpdate:activity":C,onAddSubtask:D,onUpdateSubtask:B,onDeleteSubtask:I,onAddFiles:V,onRemoveFile:H,onAddComment:R,onUpdateComment:q,onRemoveComment:P,onToast:i},{default:a.withCtx(le=>[a.renderSlot(U.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview"])):a.createCommentVNode("",!0)]))])}}}),yge="",ND={class:"ao-project-mapping"},DD={class:"ao-project-mapping-mapping__body"},BD={class:"ao-project-mapping-mapping__phases"},MD={key:0,class:"ao-project-mapping-mapping__image-wrapper"},LD=["src","alt"],$D=a.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e,i=()=>{const{name:b,rank:y}=tr(o.phases,"phase",n);r("addPhase",{name:b,rank:y,projectId:o.project.id})},s=()=>{const b=n("template.defaultName.phase",{idx:1}),y=fa(o.phases);r("addPhase",{name:b,rank:y,projectId:o.project.id})},l=b=>{r("updatePhase",b)},c=b=>{r("archivePhase",b)},d=b=>{r("unarchivePhase",b)},u=b=>{r("copyPhaseToTemplate",b)},p=a.ref(!1),f=a.ref(!1),m=(b,y)=>{r("applyTemplate",{templateId:b,projectId:y}),p.value=!1},h=(b,y)=>{var C;const w=(C=o.templates)==null?void 0:C.at(-1),k=w?Xe.LexoRank.parse(w.rank).genNext():Xe.LexoRank.middle();r("saveTemplate",{templateName:b,rank:k.format(),phaseIds:y}),f.value=!1},g=mt.useRouter(),v=a.ref("mapping"),_=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(v,b=>{b==="feed"?(g.push({name:Oe.feed}),console.log("Navigating to feed...")):b==="dev"?(g.push({name:Oe.dev}),console.log("Navigating to dev...")):b==="overview"?(g.push({name:Oe.project}),console.log("Navigating to feed...")):b==="mapping"&&(g.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(b,y)=>{var w;return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-mapping-overview"},b.$attrs),[a.createElementVNode("div",ND,[a.createVNode(ma,null,{primary:a.withCtx(()=>[a.createVNode(oi,{modelValue:v.value,"onUpdate:modelValue":y[0]||(y[0]=k=>v.value=k),tabs:_},null,8,["modelValue"]),a.createVNode(he,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:y[1]||(y[1]=k=>b.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("project.phase.add"),onClick:s},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:1,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:b.$t("project.template.save.label"),onClick:y[2]||(y[2]=k=>f.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:2,class:"ao-project-mapping-overview__add-template",color:"primary",label:b.$t("project.template.apply.label"),onClick:y[3]||(y[3]=k=>p.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",DD,[a.createElementVNode("div",BD,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(w=t.project)==null?void 0:w.estimationUnit,onAddPhase:i,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:d,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(a.openBlock(),a.createElementBlock("div",MD,[a.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:a.unref(n)("architectureImage.alt")},null,8,LD)])):a.createCommentVNode("",!0)])])],16),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[f.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:y[4]||(y[4]=k=>f.value=!1),onSave:h},null,8,["phases"])):a.createCommentVNode("",!0),p.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:y[5]||(y[5]=k=>p.value=!1),onApply:m},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),_ge="",or={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},OD=(t,e={})=>[{path:t,name:or.TEMPLATES,redirect:{name:or.TEMPLATES_LIST},...e,children:[{path:"",name:or.TEMPLATES_LIST,component:Dg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:or.TEMPLATE_DETAILS,component:Eg,props:!0}]}],Oe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},rr={feed:"ActivityFeed",dev:"ActivityFeedDev"},ID=(t,e={})=>[{path:t,...e,redirect:{name:Oe.project},children:[{path:"",name:Oe.project,component:gN,props:!0,children:[{path:":phaseId/:milestoneId",name:Oe.milestone,component:Ng,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Oe.activity,props:{default:!0,modal:!0},components:{default:Ng,modal:tD}}]},{path:"feed",name:Oe.feed,component:iu,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Oe.dev,component:iu,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Oe.mapping,component:$D,props:!0}]}],VD={class:"ao-templates"},Dg=a.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e;a.watch(()=>o.templates,(d,u)=>{On(d,u)});const i=()=>{var m,h;const d=(m=o.templates)==null?void 0:m.at(-1),u=d?Xe.LexoRank.parse(d.rank).genNext():Xe.LexoRank.middle(),p=((h=o.templates)==null?void 0:h.length)??0,f={name:n("template.defaultName.template",{idx:p+1}),rank:u.format()};r("addTemplate",f)},s=(d,u)=>{r("updateItem",{itemType:Pe.TEMPLATES,id:d,templateId:d,data:{name:u}})},l=(d,u)=>{r("removeItem",{itemType:Pe.TEMPLATES,templateId:d,data:{id:d,...u?{name:u}:{}}})},c=d=>{if(d.moved){const u=pa(d,o.templates??[]);r("updateItem",{itemType:Pe.TEMPLATES,id:d.moved.element.id,templateId:d.moved.element.id,data:{rank:u}})}};return(d,u)=>(a.openBlock(),a.createElementBlock("div",VD,[a.createVNode(ma,null,{secondary:a.withCtx(()=>[a.createVNode(he,{label:d.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:i},null,8,["label"])]),_:1}),a.createVNode(a.unref(Yn),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:a.withCtx(({element:p})=>{var f;return[a.createVNode(M5,{id:p.id,title:p.name,phases:p.phases,milestones:(f=p.phases)!=null&&f.length?a.unref(n5)(p.phases):0,activities:p.phases?a.unref(o5)(p.phases):0,"updated-at":p.updatedAt,"updated-by":p.updatedBy,onUpdateTitle:m=>s(p.id,m),onClick:m=>d.$router.push({name:a.unref(or).TEMPLATE_DETAILS,params:{templateId:p.id}}),onDeleteItem:u[0]||(u[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}}),Cge="",PD={class:"ao-field__label"},Bg=a.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[a.createElementVNode("span",PD,a.toDisplayString(t.label),1),a.renderSlot(e.$slots,"default")],2))}}),RD=["type","value","disabled","readonly"],FD=a.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.modelModifiers.lazy?"change":"input"),i=s=>{n.modelModifiers.number&&(s=Number(s)),o("update:modelValue",s)};return(s,l)=>(a.openBlock(),a.createBlock(Bg,{label:t.label},{default:a.withCtx(()=>[a.createElementVNode("input",a.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[a.toHandlerKey(r.value)]:l[0]||(l[0]=c=>i(c.target.value))}),null,16,RD)]),_:1},8,["label"]))}}),zD={class:"ao-field"},qD={class:"ao-field__label"},jD=["checked","disabled"],UD=a.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("label",zD,[a.createElementVNode("span",qD,a.toDisplayString(t.label),1),a.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,jD)]))}});me.AoAvatar=Dn,me.AoCardFeed=ru,me.AoCheckboxField=UD,me.AoColorPicker=rl,me.AoFeed=iu,me.AoField=Bg,me.AoInputField=FD,me.AoMultiselect=_t,me.AoProjectPhases=ou,me.AoTabBar=oi,me.AoTemplateDetails=Eg,me.AoTemplates=Ug,me.AoTemplatesList=Dg,me.EstimationUnit=vu,me.TemplateItemTypeEnum=bu,me.activityFeedRoutes=rr,me.activityFeedStatus=g_,me.durationTypes=h_,me.feedFilterTypes=xo,me.getProjectOverviewRoutes=ID,me.getTemplateRoutes=OD,me.listUpdateTypes=b_,me.milestoneStatus=ea,me.projectOverviewRoutes=Oe,me.ruleComparators=mu,me.ruleDurationUnits=gu,me.ruleTriggerTypes=hu,me.templateItemType=Pe,me.templateRouteNames=or,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
59
+ */function nr(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=zT(t):/rgb/.test(t)?e=Sg(t):typeof t=="string"?e=Sg(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:i}=e,{h:s,s:l,v:c}=qT(e);return{r:n,g:o,b:r,a:i===void 0?1:i,h:s,s:l,v:c}}function Gd(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function Kd(t,e,n,o,r,i){const s=t==="l",l=e.createLinearGradient(0,0,s?n:0,s?0:o);l.addColorStop(.01,r),l.addColorStop(.99,i),e.fillStyle=l,e.fillRect(0,0,n,o)}function FT({r:t,g:e,b:n},o){const r=s=>("0"+Number(s).toString(16)).slice(-2),i=`#${r(t)}${r(e)}${r(n)}`;return o?i.toUpperCase():i}function zT(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function Sg(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function qT({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),i=o-r;let s=0;o===r?s=0:o===t?e>=n?s=60*(e-n)/i:s=60*(e-n)/i+360:o===e?s=60*(n-t)/i+120:o===n&&(s=60*(t-e)/i+240),s=Math.floor(s);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:s,s:l,v:c}}var Yd=a.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),Kd("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Kd("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=s=>{let l=s.clientX-n,c=s.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const d=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[u,p,f]=d.data;this.$emit("selectSaturation",{r:u,g:p,b:f})};r(t);const i=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)}}});const jT={ref:"canvasSaturation"};function UT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectSaturation&&t.selectSaturation(...s),["prevent","stop"]))},[a.createVNode("canvas",jT,null,512),a.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}Yd.render=UT,Yd.__file="src/color/Saturation.vue";var Jd=a.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=i=>{let s=i.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height),this.slideHueStyle={top:s-2+"px"};const l=n.getImageData(0,Math.min(s,this.height-1),1,1),[c,d,u]=l.data;this.$emit("selectHue",{r:c,g:d,b:u})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const HT={ref:"canvasHue"};function WT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectHue&&t.selectHue(...s),["prevent","stop"]))},[a.createVNode("canvas",HT,null,512),a.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}Jd.render=WT,Jd.__file="src/color/Hue.vue";var Xd=a.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),Kd("p",i,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let i=r.clientY-e;i<0&&(i=0),i>this.height&&(i=this.height);let s=parseFloat((i/this.height).toFixed(2));this.$emit("selectAlpha",s)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const ZT={ref:"canvasAlpha"};function GT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectAlpha&&t.selectAlpha(...s),["prevent","stop"]))},[a.createVNode("canvas",ZT,null,512),a.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}Xd.render=GT,Xd.__file="src/color/Alpha.vue";var Qd=a.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),i.fillStyle=this.color,i.fillRect(0,0,e,n)}}});function KT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("canvas")}Qd.render=KT,Qd.__file="src/color/Preview.vue";var eu=a.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:i,height:s}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,u=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,i-1),Math.min(c,s-1),1,1);let[p,f,m,h]=u.data;h=parseFloat((h/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${p}, ${f}, ${m}, ${h})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:i,width:s,height:l}=t.getBoundingClientRect(),c=n-i,d=o-r,p=t.getContext("2d").getImageData(Math.min(c,s-1),Math.min(d,l-1),1,1);let[f,m,h,g]=p.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:f,g:m,b:h,a:g})}))}}});const YT=a.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),JT={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},XT=a.createVNode("g",{fill:"none","fill-rule":"evenodd"},[a.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[a.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),a.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[a.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function QT(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[t.isSucking?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...s)=>t.openSucker&&t.openSucker(...s))},[YT],2)),t.isSucking?(a.openBlock(),a.createBlock("svg",JT,[XT])):a.createCommentVNode("v-if",!0)])}eu.render=QT,eu.__file="src/color/Sucker.vue";var tu=a.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:a.computed({get(){return t.color||""},set(i){e("inputColor",i)}}),handleFocus:i=>{e("inputFocus",i)},handleBlur:i=>{e("inputBlur",i)}}}});const eA={class:"color-type"},tA={class:"name"};function nA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",eA,[a.createVNode("span",tA,a.toDisplayString(t.name),1),a.withDirectives(a.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>t.modelColor=s),class:"value",onFocus:e[2]||(e[2]=(...s)=>t.handleFocus&&t.handleFocus(...s)),onBlur:e[3]||(e[3]=(...s)=>t.handleBlur&&t.handleBlur(...s))},null,544),[[a.vModelText,t.modelColor]])])}tu.render=nA,tu.__file="src/color/Box.vue";var nu=a.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=a.ref(),o=a.ref([]),r=a.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Gd(4).toDataURL(),a.onUnmounted(()=>{i(n.value)});function i(l){if(!l)return;const c=o.value||[],d=c.indexOf(l);d>=0&&c.splice(d,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function s(l){e("selectColor",l)}return{setColorsHistory:i,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:s}}});const oA={class:"colors"},rA={key:0,class:"colors history"};function aA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[a.createVNode("ul",oA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsDefault,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(a.openBlock(),a.createBlock("ul",rA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsHistory,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))])):a.createCommentVNode("v-if",!0)])}nu.render=aA,nu.__file="src/color/Colors.vue";var Wr=a.defineComponent({components:{Saturation:Yd,Hue:Jd,Alpha:Xd,Preview:Qd,Sucker:eu,Box:tu,Colors:nu},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return FT(this.rgba,!0)}},created(){Object.assign(this,nr(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s:i,v:s}=nr(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s:i,v:s}=nr(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:i,s,v:l}=nr(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const iA={class:"color-set"};function sA(t,e,n,o,r,i){const s=a.resolveComponent("Saturation"),l=a.resolveComponent("Hue"),c=a.resolveComponent("Alpha"),d=a.resolveComponent("Preview"),u=a.resolveComponent("Sucker"),p=a.resolveComponent("Box"),f=a.resolveComponent("Colors");return a.openBlock(),a.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[a.createVNode("div",iA,[a.createVNode(s,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),a.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),a.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),a.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[a.createVNode(d,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(u,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),a.createVNode(p,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(p,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(f,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),a.createCommentVNode(" custom options "),a.renderSlot(t.$slots,"default")],6)}Wr.render=sA,Wr.__file="src/color/ColorPicker.vue",Wr.install=t=>{t.component(Wr.name,Wr)};const oge="",lA={class:"color-picker-wrapper"},rl=a.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(!1),i=a.ref(null),s=a.ref(null),l=a.ref(0),c=a.ref(0),d=async h=>{s.value=h,r.value=!0,await a.nextTick();const g=h.getBoundingClientRect(),v=i.value,_=(v==null?void 0:v.offsetHeight)||300,b=window.innerHeight-g.bottom,y=g.top,w=b<_&&y>_;console.log("pickerHeight = "+_),l.value=w?g.top-_-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",p)},0)},u=a.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),p=h=>{const g=h.target;i.value&&!i.value.contains(g)&&(r.value=!1,o("update:color",f.value),window.removeEventListener("click",p))};a.onBeforeUnmount(()=>{window.removeEventListener("click",p)}),a.watch(()=>n.color,h=>{r.value||(f.value=h)});const f=a.ref(n.color),m=h=>{const{r:g,g:v,b:_,a:b}=h.rgba;f.value=`rgba(${g}, ${v}, ${_}, ${b})`};return(h,g)=>(a.openBlock(),a.createElementBlock("div",lA,[a.renderSlot(h.$slots,"clickable",{openPicker:d,bgColor:t.color}),r.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:i,class:"color-picker",style:a.normalizeStyle(u.value)},[a.createVNode(a.unref(Wr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):a.createCommentVNode("",!0)]))}}),rge="",cA={class:"ao-card-project-phase__header"},dA={class:"ao-card-project-item__title-line"},uA={key:0,class:"ao-card-project-item-phase__estimation"},pA={class:"ao-card-project-phase__footer"},fA={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},mA={class:"ao-card-project-phase__subitem"},hA={class:"ao-card-project-phase__subitem"},gA={key:0,class:"ao-card-project-phase__secondary"},bA={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},vA=a.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ti(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===ea.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v(_)};return(g,v)=>(a.openBlock(),a.createBlock(rl,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(nl,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",dA,[a.createVNode(dt,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",uA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",pA,[d.value?(a.openBlock(),a.createElementBlock("div",fA,[a.createElementVNode("div",mA,[a.createVNode(we,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",hA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(ol,{percentages:p.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",gA,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-card-project-phase__footer-row",f.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",bA,a.toDisplayString(a.unref(Ai)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",cA,[a.createVNode(he,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:v[0]||(v[0]=a.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),age="",yA=a.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",{class:"aoBadge",style:a.normalizeStyle({backgroundColor:t.color})},null,4))}}),ige="",_A={class:"ao-card-project-milestone__default"},CA={class:"ao-title-with-badge-wrapper"},wA={class:"ao-card-project-item__title-line"},kA={key:0,class:"ao-card-project-item-milestone__estimation"},xA={key:0,class:"ao-card-project-milestone__archive"},EA={class:"ao-card-project-milestone__activities"},SA={class:"ao-card-project-milestone__activities-row"},TA={class:"ao-card-project-milestone__subitem"},AA={class:"ao-card-project-milestone__subitem"},NA={key:1,class:"ao-card-project-milestone__secondary"},DA={class:"ao-card-project-milestone__footer"},BA={key:1,class:"ao-field ao-card-project-milestone__deadline"},MA={class:"ao-field__label"},LA={key:2,class:"ao-card-project-milestone__assignee"},$A=a.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>{var f;return((f=n.activities)==null?void 0:f.reduce((m,h)=>m+(h.estimation||0),0))||0}),i=a.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((f,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return f+((h==null?void 0:h.timeSpent)||0)},0)),s=a.computed(()=>n.estimationUnit==="days"?"d":"h"),l=a.computed(()=>Ti(i.value,n.estimationUnit));a.computed(()=>{const f=i.value/60;return f%1===0?f.toString():f.toFixed(2)});const c=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.length}),d=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.filter(m=>_l(m,n.closedStatus)).length}),u=a.computed(()=>(d.value||0)/(c.value||1)),p=f=>{o("updateMilestone",{id:n.id,name:f})};return(f,m)=>(a.openBlock(),a.createBlock(nl,{class:a.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:a.withCtx(()=>[a.createElementVNode("div",_A,[a.createElementVNode("div",CA,[a.createVNode(yA,{color:t.color||""},null,8,["color"]),a.createElementVNode("div",wA,[a.createVNode(dt,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":p},null,8,["id","title","is-editable"]),r.value||i.value?(a.openBlock(),a.createElementBlock("span",kA," ("+a.toDisplayString(l.value)+"/"+a.toDisplayString(r.value)+a.toDisplayString(s.value)+")",1)):a.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(a.openBlock(),a.createElementBlock("div",xA,[a.createVNode(he,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?f.$t("archive"):f.$t("unarchive"),onClick:m[0]||(m[0]=a.withModifiers(()=>t.active?f.$emit("archiveMilestone",{id:t.id}):f.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",EA,[a.createElementVNode("div",SA,[c.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",TA,[a.createVNode(we,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",AA,a.toDisplayString(d.value)+" / "+a.toDisplayString(c.value),1)]),a.createVNode(ol,{percentages:u.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):a.createCommentVNode("",!0),f.$slots.secondary?(a.openBlock(),a.createElementBlock("div",NA,[a.renderSlot(f.$slots,"secondary")])):a.createCommentVNode("",!0)])])]),footer:a.withCtx(()=>[a.createElementVNode("div",DA,[t.important?(a.openBlock(),a.createBlock(we,{key:0,name:"FlagRounded",class:a.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):a.createCommentVNode("",!0),t.deadline?(a.openBlock(),a.createElementBlock("label",BA,[a.createElementVNode("span",MA,a.toDisplayString(a.unref(Ai)(t.deadline)),1)])):a.createCommentVNode("",!0),t.assignee?(a.openBlock(),a.createElementBlock("div",LA,[a.createVNode(Dn,{"user-name":a.unref(zu)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):a.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}}),sge="",OA={class:"ao-mapping-card-project-phase__header"},IA={class:"ao-card-project-item__title-line"},VA={key:0,class:"ao-card-project-item-phase__estimation"},PA={class:"ao-mapping-card-project-phase__footer"},RA={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},FA={class:"ao-mapping-card-project-phase__subitem"},zA={class:"ao-mapping-card-project-phase__subitem"},qA={key:0,class:"ao-mapping-card-project-phase__secondary"},jA={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},UA=a.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ti(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===ea.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v()};return(g,v)=>(a.openBlock(),a.createBlock(rl,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(nl,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",IA,[a.createVNode(dt,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",VA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",PA,[d.value?(a.openBlock(),a.createElementBlock("div",RA,[a.createElementVNode("div",FA,[a.createVNode(we,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",zA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(ol,{percentages:p.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",qA,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-mapping-card-project-phase__footer-row",f.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",jA,a.toDisplayString(a.unref(Ai)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",OA,[a.createVNode(he,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:v[0]||(v[0]=a.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),lge="",HA={class:"ao-project-phase"},WA={key:0,class:"ao-project-phase__drag ao-card__drag"},ZA={key:1,class:"ao-project-phase__col-phase"},GA={key:2,class:"ao-mapping-project-phase__col-phase"},KA={key:0,class:"ao-project-phase__col-milestones"},YA=["title"],JA={class:"ao-project-phase__milestones-list-footer"},XA=a.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e;a.watch(()=>o.phase.milestones,(k,C)=>{On(k,C)});const i=k=>{r("updatePhase",{id:o.phase.id,name:k})},s=k=>{r("updatePhase",{id:o.phase.id,deadline:k})},l=k=>{r("updatePhase",k)},c=a.computed(()=>o.phase.milestones.map(k=>i5(k,o.closedStatus))),d=k=>{const{name:C,rank:x}=tr(c.value??[],"milestone",n);r("addMilestone",{name:C,rank:x,phaseId:k})},u=k=>{const C=n("template.defaultName.milestone",{idx:1}),x=fa(c.value??[]);r("addMilestone",{name:C,rank:x,phaseId:k})},p=k=>{r("updateMilestone",k)},f=k=>{r("archiveMilestone",k)},m=k=>{r("unarchiveMilestone",k)},h=k=>{r("archivePhase",k)},g=k=>{r("unarchivePhase",k)},v=k=>{"added"in k?r("updateMilestone",{id:k.added.element.id,phaseId:o.phase.id,rank:dr(c.value,k.added.newIndex)}):"removed"in k||"moved"in k&&r("updateMilestone",{id:k.moved.element.id,rank:dr(c.value,k.moved.newIndex)})},_=mt.useRoute(),b=a.computed(()=>_.path.includes("/mapping")),y=a.computed(()=>{var k;return o.phase.id===((k=_.params)==null?void 0:k.phaseId)});a.ref(!1);const w=a.computed(()=>{var k;return o.phase.id!==((k=_.params)==null?void 0:k.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:l5(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(k,C)=>(a.openBlock(),a.createElementBlock("li",HA,[a.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",WA,[a.createVNode(we,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):a.createCommentVNode("",!0),b.value?(a.openBlock(),a.createElementBlock("div",GA,[a.createVNode(UA,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(a.openBlock(),a.createElementBlock("div",ZA,[a.createVNode(vA,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),b.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",KA,[a.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":y.value}]),title:k.$t("project.milestone.add"),onClick:C[0]||(C[0]=()=>u(t.phase.id))},[a.createVNode(we,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,YA)):a.createCommentVNode("",!0),a.createVNode(a.unref(Yn),a.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},k.$attrs,{onChange:v}),{item:a.withCtx(({element:x})=>{var T;return[a.createVNode($A,{id:x.id,name:x.name,color:x.color,"phase-color":t.phase.color,activities:x.activities,deadline:x.deadline,active:x.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":x.id===((T=k.$route.params)==null?void 0:T.milestoneId),assignee:x.assignee,important:x.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:a.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&k.$router.push({name:a.unref(Oe).milestone,params:{phaseId:t.phase.id,milestoneId:x.id}}),onUpdateMilestone:p,onArchiveMilestone:f,onUnarchiveMilestone:m},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),a.createElementVNode("div",JA,[t.isEditable?(a.openBlock(),a.createBlock(Xn,{key:0,label:k.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:C[1]||(C[1]=()=>d(t.phase.id))},null,8,["label"])):a.createCommentVNode("",!0)])],4)]))]))}}),cge="",QA={class:"ao-project__phases"},eN={key:0,class:"ao-project-phase__phases-list-footer"},tN={class:"ao-project-phase__col-phase"},ou=a.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;a.watch(()=>n.phases,(m,h)=>{On(m,h)});const r=m=>{o("addMilestone",m)},i=m=>{o("updateMilestone",m)},s=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},d=m=>{o("unarchivePhase",m)},u=m=>{if(m.moved){const h=pa(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},p=m=>{o("updatePhase",m)},f=m=>{o("addPhase",m)};return(m,h)=>(a.openBlock(),a.createElementBlock("div",QA,[a.createVNode(a.unref(Yn),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:u},{item:a.withCtx(({element:g})=>[a.createVNode(XA,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:i,onArchiveMilestone:s,onUnarchiveMilestone:l,onUpdatePhase:p,onArchivePhase:c,onUnarchivePhase:d},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(a.openBlock(),a.createElementBlock("div",eN,[h[0]||(h[0]=a.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),a.createElementVNode("div",tN,[a.createVNode(Xn,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:f},null,8,["label"])]),h[1]||(h[1]=a.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):a.createCommentVNode("",!0)]))}}),dge="",nN={class:"ao-add-template-modal__form-body"},oN={class:"field__row"},rN={class:"ao-add-template-modal__form-footer"},Tg=a.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),i=a.ref(null),s=c=>{i.value=c},l=()=>{i.value&&o("apply",i.value,n.projectId)};return(c,d)=>(a.openBlock(),a.createBlock(Ni,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(dt,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:a.withModifiers(l,["prevent"])},[a.createElementVNode("p",null,a.toDisplayString(c.$t("project.template.apply.notice")),1),a.createElementVNode("div",nN,[a.createElementVNode("div",oN,[a.createVNode(_t,{value:i.value,options:r.value,detached:!0,onChange:s},null,8,["value","options"])])]),a.createElementVNode("footer",rN,[a.createVNode(he,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}}),uge="",aN={class:"ao-save-template-modal__form-body"},iN={class:"field__row"},sN={class:"ao-field ao-field--inline"},lN={class:"ao-field__label"},cN={class:"ao-save-template-modal__phases"},dN={class:"ao-field__label"},uN={class:"ao-save-template-modal__phases-list"},pN=["value"],fN={class:"ao-save-template-modal__form-footer"},Ag=a.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(""),i=a.ref([]);a.onMounted(()=>{i.value=n.phases.map(l=>l.id)});const s=()=>{r.value&&o("save",r.value,i.value)};return(l,c)=>(a.openBlock(),a.createBlock(Ni,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(dt,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:a.withModifiers(s,["prevent"])},[a.createElementVNode("div",aN,[a.createElementVNode("div",iN,[a.createElementVNode("label",sN,[a.createElementVNode("span",lN,a.toDisplayString(l.$t("project.template.name.label"))+": ",1),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),type:"text"},null,512),[[a.vModelText,r.value]])])]),a.createElementVNode("div",cN,[a.createElementVNode("div",dN,a.toDisplayString(l.$t("project.template.phases.label")),1),a.createElementVNode("div",uN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.phases,d=>(a.openBlock(),a.createElementBlock("label",{key:d.id,class:"ao-field ao-field--checkbox"},[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>i.value=u),type:"checkbox",value:d.id},null,8,pN),[[a.vModelCheckbox,i.value]]),a.createElementVNode("span",null,a.toDisplayString(d.name),1)]))),128))])])]),a.createElementVNode("footer",fN,[a.createVNode(he,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:s},null,8,["label"])])],32)]),_:1}))}}),pge="",mN={class:"ao-project"},hN={class:"ao-project__body"},gN=a.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e,i=a.computed(()=>o.phases.flatMap(P=>P.milestones)),s=()=>{const{name:P,rank:Q}=tr(o.phases,"phase",n);r("addPhase",{name:P,rank:Q,projectId:o.project.id})},l=()=>{const P=n("template.defaultName.phase",{idx:1}),Q=fa(o.phases);r("addPhase",{name:P,rank:Q,projectId:o.project.id})},c=P=>{r("updatePhase",P)},d=P=>{r("archivePhase",P)},u=P=>{r("unarchivePhase",P)},p=P=>{r("copyPhaseToTemplate",P)},f=P=>{r("addMilestone",P)},m=P=>{r("updateMilestone",P)},h=P=>{r("archiveMilestone",P)},g=P=>{r("unarchiveMilestone",P)},v=P=>{r("addActivity",P)},_=P=>{r("update:activity",P)},b=P=>{r("archiveActivity",P)},y=P=>{r("unarchiveActivity",P)},w=P=>{r("addSubtask",P)},k=P=>{r("updateSubtask",P)},C=P=>{r("deleteSubtask",P)},x=a.computed(()=>i.value.flatMap(P=>P.activities)),T=P=>{r("addFiles",P)},S=P=>{r("removeFile",P)},N=P=>{r("addComment",P)},O=P=>{r("updateComment",P)},A=P=>{r("removeComment",P)},D=a.ref(!1),B=a.ref(!1),I=(P,Q)=>{r("applyTemplate",{templateId:P,projectId:Q}),D.value=!1},V=(P,Q)=>{var ie;const ee=(ie=o.templates)==null?void 0:ie.at(-1),be=ee?Xe.LexoRank.parse(ee.rank).genNext():Xe.LexoRank.middle();r("saveTemplate",{templateName:P,rank:be.format(),phaseIds:Q}),B.value=!1},H=mt.useRouter(),R=a.ref("overview"),q=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(R,P=>{P==="feed"?(H.push({name:Oe.feed}),console.log("Navigating to feed...")):P==="dev"?(H.push({name:Oe.dev}),console.log("Navigating to dev...")):P==="overview"?(H.push({name:Oe.project}),console.log("Navigating to feed...")):P==="mapping"&&(H.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(P,Q)=>{var be;const ee=a.resolveComponent("RouterView");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-overview"},P.$attrs),[a.createElementVNode("div",mN,[a.createVNode(ma,null,{primary:a.withCtx(()=>[a.createVNode(oi,{modelValue:R.value,"onUpdate:modelValue":Q[0]||(Q[0]=ie=>R.value=ie),tabs:q},null,8,["modelValue"]),a.createVNode(he,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=ie=>P.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("project.phase.add"),onClick:l},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:1,class:"ao-project-overview__save-as-template",color:"primary",label:P.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=ie=>B.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:2,class:"ao-project-overview__add-template",color:"primary",label:P.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=ie=>D.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",hN,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(be=t.project)==null?void 0:be.estimationUnit,onAddMilestone:f,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:s,onUpdatePhase:c,onArchivePhase:d,onUnarchivePhase:u,onCopyPhaseToTemplate:p},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),a.createVNode(ee,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:Q[4]||(Q[4]=ie=>P.$router.push({name:a.unref(Oe).project})),onUpdateMilestone:m,onAddActivity:v,onUpdateActivity:_,onArchiveActivity:b,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(ee,{name:"modal",activities:x.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":t.loadAttachmentPreview,"onUpdate:activity":_,onAddSubtask:w,onUpdateSubtask:k,onDeleteSubtask:C,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:O,onRemoveComment:A},{default:a.withCtx(({Component:ie})=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ie),null,{default:a.withCtx(se=>[a.renderSlot(P.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(se)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data","load-attachment-preview"])]))],16),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[B.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=ie=>B.value=!1),onSave:V},null,8,["phases"])):a.createCommentVNode("",!0),D.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=ie=>D.value=!1),onApply:I},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),fge="",bN={class:"ao-card-feed__header"},vN={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},yN={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},_N={class:"ao-card-feed__body"},CN={key:0,class:"ao-card-feed__breadcrumbs"},wN={class:a.normalizeClass(["ao-card-feed__title-group"])},kN={class:"ao-card-feed__title-line"},xN={key:0,class:"ao-card-feed__slug"},EN={key:1,class:"ao-card-feed__deadline"},SN={class:"ao-card-feed__footer"},TN={class:"ao-card-feed__footer-row"},AN={class:"ao-assignees"},NN={key:0,class:"ao-assignee"},DN={key:0,class:"ao-card-feed__subitems"},BN={key:0,class:"ao-card-feed__subitem"},MN={class:"ao-card-feed__subitem"},LN={key:1,class:"ao-card-feed__subitem"},$N={class:"ao-card-feed__subitem"},ON={class:"ao-card-feed__timer-wrapper"},IN={class:"ao-card-feed__footer-row"},VN={key:0,class:"ao-card-feed__progress-wrapper"},PN={class:"ao-card-feed__subitem"},RN={class:"ao-card-feed__subitem"},ru=a.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),i=a.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),s=g=>{o("updateActivity",{id:n.id,name:g})},l=a.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=a.computed(()=>n.assignee?[n.assignee]:[]),d=a.computed(()=>Ai(n.deadline)),u=g=>{o("removeAssignee",g)},p=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},f=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(v=>v.isDone).length}),h=a.computed(()=>(m.value||0)/(f.value||1));return(g,v)=>(a.openBlock(),a.createBlock(nl,{class:a.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:a.withCtx(()=>[a.createElementVNode("div",bN,[r.value?(a.openBlock(),a.createBlock(Qr,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":i.value},null,8,["label","color","raw-color"])):a.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(a.openBlock(),a.createElementBlock("div",vN,[t.isPrivate?(a.openBlock(),a.createBlock(we,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):a.createCommentVNode("",!0),t.important?(a.openBlock(),a.createBlock(we,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):a.createCommentVNode("",!0),t.isClosed?(a.openBlock(),a.createBlock(we,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",yN,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])]),default:a.withCtx(()=>[a.createElementVNode("div",_N,[l.value?(a.openBlock(),a.createElementBlock("span",CN,a.toDisplayString(l.value),1)):a.createCommentVNode("",!0),a.createElementVNode("div",wN,[a.createElementVNode("div",kN,[t.slug?(a.openBlock(),a.createElementBlock("span",xN,a.toDisplayString(t.slug)+": ",1)):a.createCommentVNode("",!0),a.createVNode(dt,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":s},null,8,["id","title","is-editable"])])]),t.deadline?(a.openBlock(),a.createElementBlock("span",EN,a.toDisplayString(d.value),1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",SN,[a.createElementVNode("div",TN,[a.createElementVNode("ul",AN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,_=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_.id},[_?(a.openBlock(),a.createElementBlock("li",NN,[a.createVNode(Dn,{"user-name":a.unref(zu)(_),"avatar-url":_.avatarUrl,"is-closable":!0,onClose:()=>u(_.id)},null,8,["user-name","avatar-url","onClose"])])):a.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(a.openBlock(),a.createElementBlock("ul",DN,[t.comments?(a.openBlock(),a.createElementBlock("li",BN,[a.createVNode(we,{name:"ChatOutline",size:"sm"}),a.createElementVNode("span",MN,a.toDisplayString(t.comments),1)])):a.createCommentVNode("",!0),t.attachments?(a.openBlock(),a.createElementBlock("li",LN,[a.createVNode(we,{name:"AttachFileRounded",size:"sm"}),a.createElementVNode("span",$N,a.toDisplayString(t.attachments),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",ON,[a.createVNode(we,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:a.withModifiers(p,["stop"])})])]),a.createElementVNode("div",IN,[t.tasks&&t.tasks.length?(a.openBlock(),a.createElementBlock("div",VN,[a.createElementVNode("div",PN,[a.createVNode(we,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",RN,a.toDisplayString(m.value)+" / "+a.toDisplayString(f.value),1)]),a.createVNode(ol,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):a.createCommentVNode("",!0)])])]),_:3},8,["class"]))}}),mge="",FN={class:"ao-project-milestone"},zN={class:"ao-project-milestone__header"},qN={class:"ao-project-milestone__header_line"},jN={class:"ao-project-milestone__header_line"},UN={class:"ao-project-milestone__title"},HN={key:0,class:"ao-fieldset ao-milestone__fieldset"},WN={class:"ao-field__row ao-milestone__field-row"},ZN={class:"ao-field ao-field--inline"},GN={class:"ao-field__row ao-milestone__field-row"},KN={class:"ao-field ao-milestone__field-multiselect"},YN={class:"ao-milestone__color-actions"},JN=["onClick"],XN=["title"],QN={class:"ao-project-milestone__body"},eD={key:0,class:"ao-project-milestone__footer"},Ng=a.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e,i=C=>{var x;r("startTimer",C),(x=window.parent)==null||x.postMessage({type:"startTimer",data:C},"*")},s=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(x=>x.id===o.phaseId)}),l=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(x=>x.milestones)}),c=a.computed(()=>{var C;return(C=l.value)==null?void 0:C.find(x=>x.id===o.milestoneId)}),d=a.computed(()=>{var C;return(C=c.value)==null?void 0:C.activities});a.watch(d,(C,x)=>{On(C,x)});const u=C=>{r("close",C)},p=()=>{const{name:C,rank:x}=tr(d.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},f=()=>{const C=n("template.defaultName.activity",{idx:1}),x=fa(d.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},m=C=>{r("updateActivity",C)},h=C=>{d.value&&"moved"in C&&r("updateActivity",{id:C.moved.element.id,rank:dr(d.value,C.moved.newIndex)})},g=a.computed({get:()=>{var C;return(C=c.value)==null?void 0:C.color},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,color:C})}}),v=a.computed({get:()=>{var C;return((C=c==null?void 0:c.value)==null?void 0:C.deadline)??""},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:C!=null&&C.length?C:null})}}),_=C=>o.closedStatus?_l(C,o.closedStatus):!1,b=a.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(x=>({label:`${x.firstName} ${x.lastName}`,value:x.id,avatar:x.avatarUrl})))||[]}),y=a.computed({get(){var C,x;return(x=(C=c.value)==null?void 0:C.assignee)!=null&&x.id?[c.value.assignee.id]:[]},set(C){r("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),w=a.computed({get(){var C;return((C=c.value)==null?void 0:C.important)??!1},set(C){r("updateMilestone",{id:o.milestoneId,important:C})}}),k=(C,x)=>{const T=C.currentTarget;T instanceof HTMLElement&&x(T)};return(C,x)=>{var T;return a.openBlock(),a.createElementBlock("div",FN,[a.createElementVNode("header",zN,[a.createElementVNode("div",qN,[a.createVNode(he,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:u})]),a.createElementVNode("div",jN,[a.createElementVNode("div",UN,[a.createVNode(dt,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),a.createVNode(xg,{modelValue:w.value,"onUpdate:modelValue":x[0]||(x[0]=S=>w.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:C.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(a.openBlock(),a.createElementBlock("div",HN,[a.createElementVNode("div",WN,[a.createElementVNode("label",ZN,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=S=>v.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[a.vModelText,v.value,void 0,{lazy:!0}]])])]),a.createElementVNode("div",GN,[a.createElementVNode("label",KN,[a.createVNode(_t,{modelValue:y.value,"onUpdate:modelValue":x[2]||(x[2]=S=>y.value=S),options:b.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:C.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:a.withCtx(({option:S,handleTagRemove:N})=>[a.createVNode(Dn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:O=>N(S,O)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),a.createElementVNode("div",YN,[a.createVNode(rl,{color:g.value,"onUpdate:color":x[3]||(x[3]=S=>g.value=S)},{clickable:a.withCtx(({openPicker:S,bgColor:N})=>[a.createElementVNode("button",{style:a.normalizeStyle({background:N}),class:"color-button",onClick:O=>k(O,S)},null,12,JN)]),_:1},8,["color"]),t.isEditable?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"ao-project-milestone__quick-add",title:C.$t("project.activity.add"),onClick:f},[a.createVNode(we,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,XN)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",QN,[a.createVNode(a.unref(Yn),a.mergeProps({class:"ao-project-milestone__activities",list:d.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:h}),{item:a.withCtx(({element:S})=>{var N,O,A,D,B;return[a.createVNode(ru,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=s.value)==null?void 0:N.name,"milestone-name":(O=c.value)==null?void 0:O.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:S.deadline,important:S.important,users:t.users,assignee:S.assignee,slug:S.slug,comments:(D=S.comments)==null?void 0:D.length,attachments:(B=S.attachments)==null?void 0:B.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":_(S),onClick:I=>C.$router.push({name:a.unref(Oe).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:i},a.createSlots({_:2},[t.isEditable?{name:"secondary",fn:a.withCtx(()=>[t.isEditable&&S.active?(a.openBlock(),a.createBlock(he,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:a.withModifiers(()=>C.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),t.isEditable&&!S.active?(a.openBlock(),a.createBlock(he,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>C.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(a.openBlock(),a.createElementBlock("div",eD,[a.createVNode(Xn,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:p},null,8,["label"])])):a.createCommentVNode("",!0)])])}}}),hge="",tD=a.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.find(b=>b.id===n.phaseId)}),i=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.flatMap(b=>b.milestones)}),s=a.computed(()=>{var _;return(_=i.value)==null?void 0:_.find(b=>b.id===n.milestoneId)}),l=a.computed(()=>{var _;return(_=n.activities)==null?void 0:_.find(b=>b.id===n.activityId)}),c=_=>{o("update:activity",_)},d=_=>{o("addSubtask",_)},u=_=>{o("updateSubtask",_)},p=_=>{o("deleteSubtask",_)},f=_=>{o("addFiles",_)},m=_=>{o("removeFile",_)},h=_=>{o("addComment",_)},g=_=>{o("updateComment",_)},v=_=>{o("removeComment",_)};return(_,b)=>{var y,w;return l.value?(a.openBlock(),a.createBlock(Zd,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(y=r.value)==null?void 0:y.name} / ${(w=s.value)==null?void 0:w.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,onClose:_.$router.back,"onUpdate:activity":c,onAddSubtask:d,onUpdateSubtask:u,onDeleteSubtask:p,onAddFiles:f,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:v},{default:a.withCtx(k=>[a.renderSlot(_.$slots,"default",a.normalizeProps(a.guardReactiveProps(k)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","onClose"])):a.createCommentVNode("",!0)}}}),nD={class:"ao-col-header"},oD=a.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("header",nD,[a.createVNode(dt,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(a.openBlock(),a.createBlock(Qr,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):a.createCommentVNode("",!0)]))}}),gge="";function rD(t){return a.getCurrentScope()?(a.onScopeDispose(t),!0):!1}function al(t){return typeof t=="function"?t():a.unref(t)}const aD=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const iD=t=>t!=null,ri=()=>{};function sD(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function lD(t,e={}){let n,o,r=ri;const i=l=>{clearTimeout(l),r(),r=ri};return l=>{const c=al(t),d=al(e.maxWait);return n&&i(n),c<=0||d!==void 0&&d<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((u,p)=>{r=e.rejectOnCancel?p:u,d&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,u(l())},d)),n=setTimeout(()=>{o&&i(o),o=null,u(l())},c)})}}function cD(t,e=200,n={}){return sD(lD(e,n),t)}function au(t){var e;const n=al(t);return(e=n==null?void 0:n.$el)!=null?e:n}const dD=aD?window:void 0;function uD(){const t=a.ref(!1),e=a.getCurrentInstance();return e&&a.onMounted(()=>{t.value=!0},e),t}function pD(t){const e=uD();return a.computed(()=>(e.value,!!t()))}function fD(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:i=.1,window:s=dD,immediate:l=!0}=n,c=pD(()=>s&&"IntersectionObserver"in s),d=a.computed(()=>{const h=al(t);return(Array.isArray(h)?h:[h]).map(au).filter(iD)});let u=ri;const p=a.ref(l),f=c.value?a.watch(()=>[d.value,au(o),p.value],([h,g])=>{if(u(),!p.value||!h.length)return;const v=new IntersectionObserver(e,{root:au(g),rootMargin:r,threshold:i});h.forEach(_=>_&&v.observe(_)),u=()=>{v.disconnect(),u=ri}},{immediate:l,flush:"post"}):ri,m=()=>{u(),f(),p.value=!1};return rD(m),{isSupported:c,isActive:p,pause(){u(),p.value=!1},resume(){p.value=!0},stop:m}}const mD={class:a.normalizeClass(["ao-list-kanban"])},hD={class:"ao-list-kanban__header"},gD=["title"],bD={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},vD={key:1,class:"ao-list-kanban__end"},yD={key:0,class:"ao-list-kanban__no-more"},_D={key:1,class:"ao-list-kanban__divider"},CD={key:1,class:"ao-list-kanban__footer"},wD=a.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{},showHeaderAdd:{type:Boolean},isDevMode:{type:Boolean}},emits:["add","addAtBeginning","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(!1),i=a.ref(null);fD(i,([{isIntersecting:p}])=>{r.value=p}),a.watch(r,p=>{p&&n.hasMore&&!n.isLoading&&o("loadMore")});const s=p=>{var f;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((f=p.assignee)==null?void 0:f.id):!1},l=p=>{o("selectActivity",p)},c=p=>{o("updateActivity",p)},d=p=>{if("added"in p){const f={id:p.added.element.id,rank:dr(n.list,p.added.newIndex)};n.isDevMode?f.statusDevId=n.status.id:f.statusId=n.status.id,o("updateActivity",f)}else"removed"in p||"moved"in p&&o("updateActivity",{id:p.moved.element.id,rank:dr(n.list,p.moved.newIndex)})},u=a.ref(!1);return(p,f)=>(a.openBlock(),a.createElementBlock("div",mD,[t.title||p.$slots.header?a.renderSlot(p.$slots,"header",{},()=>{var m;return[a.createElementVNode("div",hD,[t.title?(a.openBlock(),a.createBlock(oD,{key:0,class:"ao-list-kanban__col-header",title:t.title,level:3,items:(m=t.list)==null?void 0:m.length},null,8,["title","items"])):a.createCommentVNode("",!0),t.showHeaderAdd?(a.openBlock(),a.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:p.$t("feed.activity.add"),onClick:f[0]||(f[0]=h=>p.$emit("addAtBeginning"))},[a.createVNode(we,{name:"Add"})],8,gD)):a.createCommentVNode("",!0)])]},void 0,0):a.createCommentVNode("",!0),a.createVNode(a.unref(Yn),a.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},p.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:d,onStart:f[2]||(f[2]=m=>u.value=!0),onEnd:f[3]||(f[3]=m=>u.value=!1)}),{item:a.withCtx(({element:m})=>{var h,g,v,_,b,y,w,k,C,x;return[a.createVNode(ru,{id:m.id,class:a.normalizeClass(s(m)?"ao-list-draggable":""),name:m.name,"project-name":(h=m.project)==null?void 0:h.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(v=m.project)==null?void 0:v.color,"phase-name":(b=(_=m.milestone)==null?void 0:_.phase)==null?void 0:b.name,"milestone-name":(y=m.milestone)==null?void 0:y.name,"milestone-color":(w=m.milestone)==null?void 0:w.color,deadline:m.deadline,rules:((k=m.rules)==null?void 0:k.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(C=m.comments)==null?void 0:C.length,attachments:(x=m.attachments)==null?void 0:x.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":s(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>s(m)&&c(T),()=>s(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>s(m)&&c({id:m.id,assigneeId:null}),onStartTimer:f[1]||(f[1]=T=>p.$emit("startTimer",T))},{secondary:a.withCtx(()=>[s(m)&&m.active?(a.openBlock(),a.createBlock(he,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.archive"),onClick:a.withModifiers(()=>p.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),s(m)&&!m.active?(a.openBlock(),a.createBlock(he,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>p.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:a.withCtx(()=>[t.isLoading?(a.openBlock(),a.createElementBlock("div",bD,[a.createVNode(we,{name:"Loading"})])):t.hasMore?(a.openBlock(),a.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:i,class:"ao-list-kanban__end"},null,512)):(a.openBlock(),a.createElementBlock("div",vD,[t.noMoreLabel?(a.openBlock(),a.createElementBlock("span",yD,a.toDisplayString(t.noMoreLabel),1)):t.isEditable?(a.openBlock(),a.createElementBlock("span",_D)):a.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),p.$slots.footer||t.footerLabel?(a.openBlock(),a.createElementBlock("div",CD,[a.renderSlot(p.$slots,"footer",{},()=>[t.isEditable?(a.openBlock(),a.createBlock(Xn,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:f[4]||(f[4]=m=>p.$emit("add"))},null,8,["label"])):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]))}}),bge="",kD={class:"ao-field ao-search-field"},xD=["value","placeholder"],ED=a.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const d=l.target.value;o("update:modelValue",d,l)},i=cD(r,n.delay),s=l=>{o("clear",l)};return(l,c)=>(a.openBlock(),a.createElementBlock("div",kD,[a.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...d)=>a.unref(i)&&a.unref(i)(...d)),onKeypress:a.withKeys(r,["enter"])},null,40,xD),a.createVNode(we,{name:"SearchRounded",class:a.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),a.createVNode(he,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:a.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:s},null,8,["class"])]))}}),vge="",SD={class:"ao-feed"},TD={class:"ao-feed__filters"},AD={class:"ao-feed__body"},iu=a.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e;function i(U,te){r("toast",U,te)}const s=a.toRef(o,"activities"),l=a.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses),c=a.computed(()=>o.feedMode==="dev"?s.value.filter(U=>U.activityType==="dev"):s.value),d=async(U,te)=>{await r("selectActivity",U,te)},u=a.ref({}),p=a.ref(!1),f=a.ref(!1),m=a.computed(()=>o.project?"milestone":"project");a.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([U,te,Ie,le],[Ue,L])=>{const K=o.feedMode==="dev"?"devStatus":"status";u.value=Object.fromEntries(U.map(ue=>[ue.id,te.filter(Ee=>{const Me=Ee[K];return(Me==null?void 0:Me.id)===ue.id})])),Ie&&!p.value?(d(Ie,null),p.value=!0):le&&!p.value&&(d(null,le),p.value=!0),f.value&&On(te,L)},{immediate:!0});const h=a.computed(()=>{var U;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((U=o.selectedActivity.milestone.phase)==null?void 0:U.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=U=>{var ue;const te=o.feedMode==="dev"?o.activities.filter(Ee=>Ee.activityType==="dev"):o.activities,Ie=te==null?void 0:te.at(-1),le=Ie?Xe.LexoRank.parse(Ie.rank).genNext():Xe.LexoRank.middle(),Ue=((ue=o.activities)==null?void 0:ue.length)??0,L=o.feedMode==="dev",K={name:n("activity.defaultName",{idx:Ue+1}),rank:le.format(),...L?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};o.filters.assigneeId.length>0&&(K.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(K.projectId=o.filters.projectId[0]),f.value=!0,r("addActivity",K)},v=U=>{var ue,Ee;const te=o.feedMode==="dev"?"devStatus":"status",Ie=((ue=o.activities)==null?void 0:ue.filter(Me=>{const ve=Me[te];return(ve==null?void 0:ve.id)===U.id}))??[],le=fa(Ie),Ue=((Ee=o.activities)==null?void 0:Ee.length)??0,L=o.feedMode==="dev",K={name:n("activity.defaultName",{idx:Ue+1}),rank:le,...L?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};o.filters.assigneeId.length>0&&(K.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(K.projectId=o.filters.projectId[0]),f.value=!0,r("addActivity",K)},_=(U,te)=>{f.value=!1,r("update:filters",{...o.filters,[U]:te})},b=a.computed(()=>o.project?[o.project]:o.projects??[]),y=a.computed(()=>b.value.map(U=>({value:U.id,label:U.name}))),w=a.computed(()=>{var U;return(U=o.activityTypes)==null?void 0:U.map(te=>({value:te.id,label:te.name}))}),k=a.computed(()=>o.users.map(U=>({value:U.id,label:`${U.firstName} ${U.lastName}`,avatar:U.avatarUrl}))),C=U=>{o.selectedActivity&&r("update:activity",U)},x=U=>{r("update:activity",U)},T=U=>{r("archiveActivity",U)},S=U=>{r("unarchiveActivity",U)},N=U=>{var te;r("startTimer",U),(te=window.parent)==null||te.postMessage({type:"startTimer",data:U},"*")},O=U=>{f.value=!1,r("update:searchText",U)},A=U=>{f.value=!1,r("clear:searchText",U)},D=U=>{o.selectedActivity&&r("addSubtask",U)},B=U=>{o.selectedActivity&&r("updateSubtask",U)},I=U=>{o.selectedActivity&&r("deleteSubtask",U)},V=U=>{r("addFiles",U)},H=U=>{r("removeFile",U)},R=U=>{o.selectedActivity&&r("addComment",{...U,activityId:o.selectedActivity.id})},q=U=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",U)},P=U=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",U)},Q=mt.useRouter(),ee=mt.useRoute(),be=a.ref("feed");a.watch(()=>ee.name,U=>{U===rr.feed||U==="ActivityFeed"||U==="ActivityFeedWithActivity"?be.value="feed":U===rr.dev||U==="ActivityFeedDev"||U==="ActivityFeedDevWithActivity"?be.value="dev":U===Oe.feed?be.value="feed":U===Oe.dev?be.value="dev":U===Oe.project?be.value="overview":U===Oe.mapping&&(be.value="mapping")},{immediate:!0});const ie=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],se=a.computed(()=>z.value?ie.filter(U=>U.value==="feed"||U.value==="dev"):ie),z=a.computed(()=>!o.project&&ee.name&&(ee.name===rr.feed||ee.name===rr.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),re=a.computed(()=>z.value?rr.feed:Oe.feed),_e=a.computed(()=>z.value?rr.dev:Oe.dev),Be=a.computed(()=>Oe.project),rt=a.computed(()=>Oe.mapping);return a.watch(be,U=>{U==="feed"?Q.push({name:re.value}):U==="dev"?Q.push({name:_e.value}):U==="overview"?Q.push({name:Be.value}):U==="mapping"&&Q.push({name:rt.value})}),(U,te)=>{var Ie;return a.openBlock(),a.createElementBlock("div",SD,[a.createVNode(ma,null,{primary:a.withCtx(()=>[a.createElementVNode("div",TD,[a.createVNode(oi,{modelValue:be.value,"onUpdate:modelValue":te[0]||(te[0]=le=>be.value=le),tabs:se.value},null,8,["modelValue","tabs"]),a.createVNode(ED,{"model-value":t.searchText,placeholder:U.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":O,onClear:A},null,8,["model-value","placeholder"]),o.project?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(_t,{key:0,"model-value":t.filters[a.unref(xo).project],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:U.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>_(a.unref(xo).project,le))},null,8,["model-value","options","placeholder"])),w.value?(a.openBlock(),a.createBlock(_t,{key:1,"model-value":t.filters[a.unref(xo).type],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:U.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>_(a.unref(xo).type,le))},null,8,["model-value","options","placeholder"])):a.createCommentVNode("",!0),k.value.length?(a.openBlock(),a.createBlock(_t,{key:2,"model-value":t.filters[a.unref(xo).assignee],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:U.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>_(a.unref(xo).assignee,le))},{tag:a.withCtx(({option:le,handleTagRemove:Ue})=>[a.createVNode(Dn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:L=>Ue(le,L)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):a.createCommentVNode("",!0)]),a.createVNode(he,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:U.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>U.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),a.createVNode(he,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:U.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>U.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),a.createVNode(he,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:U.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>U.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),a.createElementVNode("div",AD,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,le=>(a.openBlock(),a.createBlock(wD,{key:le.id,status:le,list:u.value[le.id],title:le.name,"footer-label":U.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>v(le),onSelectActivity:d,onArchiveActivity:T,onUnarchiveActivity:S,onUpdateActivity:x,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[t.selectedActivity?(a.openBlock(),a.createBlock(Zd,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Ie=t.selectedActivity.milestone)==null?void 0:Ie.id,"template-activities":s.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:b.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,onClose:te[7]||(te[7]=()=>d(null,null)),"onUpdate:activity":C,onAddSubtask:D,onUpdateSubtask:B,onDeleteSubtask:I,onAddFiles:V,onRemoveFile:H,onAddComment:R,onUpdateComment:q,onRemoveComment:P,onToast:i},{default:a.withCtx(le=>[a.renderSlot(U.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview"])):a.createCommentVNode("",!0)]))])}}}),yge="",ND={class:"ao-project-mapping"},DD={class:"ao-project-mapping-mapping__body"},BD={class:"ao-project-mapping-mapping__phases"},MD={key:0,class:"ao-project-mapping-mapping__image-wrapper"},LD=["src","alt"],$D=a.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e,i=()=>{const{name:b,rank:y}=tr(o.phases,"phase",n);r("addPhase",{name:b,rank:y,projectId:o.project.id})},s=()=>{const b=n("template.defaultName.phase",{idx:1}),y=fa(o.phases);r("addPhase",{name:b,rank:y,projectId:o.project.id})},l=b=>{r("updatePhase",b)},c=b=>{r("archivePhase",b)},d=b=>{r("unarchivePhase",b)},u=b=>{r("copyPhaseToTemplate",b)},p=a.ref(!1),f=a.ref(!1),m=(b,y)=>{r("applyTemplate",{templateId:b,projectId:y}),p.value=!1},h=(b,y)=>{var C;const w=(C=o.templates)==null?void 0:C.at(-1),k=w?Xe.LexoRank.parse(w.rank).genNext():Xe.LexoRank.middle();r("saveTemplate",{templateName:b,rank:k.format(),phaseIds:y}),f.value=!1},g=mt.useRouter(),v=a.ref("mapping"),_=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(v,b=>{b==="feed"?(g.push({name:Oe.feed}),console.log("Navigating to feed...")):b==="dev"?(g.push({name:Oe.dev}),console.log("Navigating to dev...")):b==="overview"?(g.push({name:Oe.project}),console.log("Navigating to feed...")):b==="mapping"&&(g.push({name:Oe.mapping}),console.log("Navigating to feed..."))}),(b,y)=>{var w;return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-mapping-overview"},b.$attrs),[a.createElementVNode("div",ND,[a.createVNode(ma,null,{primary:a.withCtx(()=>[a.createVNode(oi,{modelValue:v.value,"onUpdate:modelValue":y[0]||(y[0]=k=>v.value=k),tabs:_},null,8,["modelValue"]),a.createVNode(he,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:y[1]||(y[1]=k=>b.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("project.phase.add"),onClick:s},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:1,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:b.$t("project.template.save.label"),onClick:y[2]||(y[2]=k=>f.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(he,{key:2,class:"ao-project-mapping-overview__add-template",color:"primary",label:b.$t("project.template.apply.label"),onClick:y[3]||(y[3]=k=>p.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",DD,[a.createElementVNode("div",BD,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(w=t.project)==null?void 0:w.estimationUnit,onAddPhase:i,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:d,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(a.openBlock(),a.createElementBlock("div",MD,[a.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:a.unref(n)("architectureImage.alt")},null,8,LD)])):a.createCommentVNode("",!0)])])],16),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[f.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:y[4]||(y[4]=k=>f.value=!1),onSave:h},null,8,["phases"])):a.createCommentVNode("",!0),p.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:y[5]||(y[5]=k=>p.value=!1),onApply:m},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),_ge="",or={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},OD=(t,e={})=>[{path:t,name:or.TEMPLATES,redirect:{name:or.TEMPLATES_LIST},...e,children:[{path:"",name:or.TEMPLATES_LIST,component:Dg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:or.TEMPLATE_DETAILS,component:Eg,props:!0}]}],Oe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},rr={feed:"ActivityFeed",dev:"ActivityFeedDev"},ID=(t,e={})=>[{path:t,...e,redirect:{name:Oe.project},children:[{path:"",name:Oe.project,component:gN,props:!0,children:[{path:":phaseId/:milestoneId",name:Oe.milestone,component:Ng,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Oe.activity,props:{default:!0,modal:!0},components:{default:Ng,modal:tD}}]},{path:"feed",name:Oe.feed,component:iu,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Oe.dev,component:iu,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Oe.mapping,component:$D,props:!0}]}],VD={class:"ao-templates"},Dg=a.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=hn(),o=t,r=e;a.watch(()=>o.templates,(d,u)=>{On(d,u)});const i=()=>{var m,h;const d=(m=o.templates)==null?void 0:m.at(-1),u=d?Xe.LexoRank.parse(d.rank).genNext():Xe.LexoRank.middle(),p=((h=o.templates)==null?void 0:h.length)??0,f={name:n("template.defaultName.template",{idx:p+1}),rank:u.format()};r("addTemplate",f)},s=(d,u)=>{r("updateItem",{itemType:Pe.TEMPLATES,id:d,templateId:d,data:{name:u}})},l=(d,u)=>{r("removeItem",{itemType:Pe.TEMPLATES,templateId:d,data:{id:d,...u?{name:u}:{}}})},c=d=>{if(d.moved){const u=pa(d,o.templates??[]);r("updateItem",{itemType:Pe.TEMPLATES,id:d.moved.element.id,templateId:d.moved.element.id,data:{rank:u}})}};return(d,u)=>(a.openBlock(),a.createElementBlock("div",VD,[a.createVNode(ma,null,{secondary:a.withCtx(()=>[a.createVNode(he,{label:d.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:i},null,8,["label"])]),_:1}),a.createVNode(a.unref(Yn),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:a.withCtx(({element:p})=>{var f;return[a.createVNode(M5,{id:p.id,title:p.name,phases:p.phases,milestones:(f=p.phases)!=null&&f.length?a.unref(n5)(p.phases):0,activities:p.phases?a.unref(o5)(p.phases):0,"updated-at":p.updatedAt,"updated-by":p.updatedBy,onUpdateTitle:m=>s(p.id,m),onClick:m=>d.$router.push({name:a.unref(or).TEMPLATE_DETAILS,params:{templateId:p.id}}),onDeleteItem:u[0]||(u[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}}),Cge="",PD={class:"ao-field__label"},Bg=a.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[a.createElementVNode("span",PD,a.toDisplayString(t.label),1),a.renderSlot(e.$slots,"default")],2))}}),RD=["type","value","disabled","readonly"],FD=a.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.modelModifiers.lazy?"change":"input"),i=s=>{n.modelModifiers.number&&(s=Number(s)),o("update:modelValue",s)};return(s,l)=>(a.openBlock(),a.createBlock(Bg,{label:t.label},{default:a.withCtx(()=>[a.createElementVNode("input",a.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[a.toHandlerKey(r.value)]:l[0]||(l[0]=c=>i(c.target.value))}),null,16,RD)]),_:1},8,["label"]))}}),zD={class:"ao-field"},qD={class:"ao-field__label"},jD=["checked","disabled"],UD=a.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("label",zD,[a.createElementVNode("span",qD,a.toDisplayString(t.label),1),a.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,jD)]))}});me.AoAvatar=Dn,me.AoCardFeed=ru,me.AoCheckboxField=UD,me.AoColorPicker=rl,me.AoFeed=iu,me.AoField=Bg,me.AoInputField=FD,me.AoMultiselect=_t,me.AoProjectPhases=ou,me.AoTabBar=oi,me.AoTemplateDetails=Eg,me.AoTemplates=Ug,me.AoTemplatesList=Dg,me.EstimationUnit=vu,me.TemplateItemTypeEnum=bu,me.activityFeedRoutes=rr,me.activityFeedStatus=g_,me.durationTypes=h_,me.feedFilterTypes=xo,me.getProjectOverviewRoutes=ID,me.getTemplateRoutes=OD,me.listUpdateTypes=b_,me.milestoneStatus=ea,me.projectOverviewRoutes=Oe,me.ruleComparators=mu,me.ruleDurationUnits=gu,me.ruleTriggerTypes=hu,me.templateItemType=Pe,me.templateRouteNames=or,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "module",
5
5
  "license": "CC-BY-NC-ND-4.0",
6
6
  "author": "26lights <dev@26lights.com> (https://www.26lights.com)",
7
- "version": "0.42.106",
7
+ "version": "0.42.107",
8
8
  "workspaces": [
9
9
  "packages/*"
10
10
  ],