@26lights/orcha 0.41.131 → 0.41.132

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
@@ -2,4 +2,4 @@
2
2
  * vue-color-kit v1.0.6
3
3
  * (c) 2023
4
4
  * @license MIT
5
- */function Qe(a){let t={r:0,g:0,b:0,a:1};/#/.test(a)?t=pf(a):/rgb/.test(a)?t=Xo(a):typeof a=="string"?t=Xo(`rgba(${a})`):Object.prototype.toString.call(a)==="[object Object]"&&(t=a);const{r:o,g:n,b:s,a:r}=t,{h:l,s:i,v:c}=mf(t);return{r:o,g:n,b:s,a:r===void 0?1:r,h:l,s:i,v:c}}function fo(a){const t=document.createElement("canvas"),o=t.getContext("2d"),n=a*2;return t.width=n,t.height=n,o.fillStyle="#ffffff",o.fillRect(0,0,n,n),o.fillStyle="#ccd5db",o.fillRect(0,0,a,a),o.fillRect(a,a,a,a),t}function Ka(a,t,o,n,s,r){const l=a==="l",i=t.createLinearGradient(0,0,l?o:0,l?0:n);i.addColorStop(.01,s),i.addColorStop(.99,r),t.fillStyle=i,t.fillRect(0,0,o,n)}function uf({r:a,g:t,b:o},n){const s=l=>("0"+Number(l).toString(16)).slice(-2),r=`#${s(a)}${s(t)}${s(o)}`;return n?r.toUpperCase():r}function pf(a){a=a.slice(1);const t=o=>parseInt(o,16)||0;return{r:t(a.slice(0,2)),g:t(a.slice(2,4)),b:t(a.slice(4,6))}}function Xo(a){return typeof a=="string"?(a=(/rgba?\((.*?)\)/.exec(a)||["","0,0,0,1"])[1].split(","),{r:Number(a[0])||0,g:Number(a[1])||0,b:Number(a[2])||0,a:Number(a[3]?a[3]:1)}):a}function mf({r:a,g:t,b:o}){a=a/255,t=t/255,o=o/255;const n=Math.max(a,t,o),s=Math.min(a,t,o),r=n-s;let l=0;n===s?l=0:n===a?t>=o?l=60*(t-o)/r:l=60*(t-o)/r+360:n===t?l=60*(o-a)/r+120:n===o&&(l=60*(a-t)/r+240),l=Math.floor(l);let i=parseFloat((n===0?0:1-s/n).toFixed(2)),c=parseFloat(n.toFixed(2));return{h:l,s:i,v:c}}var vo=e.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 a=this.$refs.canvasSaturation,t=this.size,o=a.getContext("2d");a.width=t,a.height=t,o.fillStyle=this.color,o.fillRect(0,0,t,t),Ka("l",o,t,t,"#FFFFFF","rgba(255,255,255,0)"),Ka("p",o,t,t,"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(a){const{top:t,left:o}=this.$el.getBoundingClientRect(),n=a.target.getContext("2d"),s=l=>{let i=l.clientX-o,c=l.clientY-t;i<0&&(i=0),c<0&&(c=0),i>this.size&&(i=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:i-5+"px",top:c-5+"px"};const p=n.getImageData(Math.min(i,this.size-1),Math.min(c,this.size-1),1,1),[d,u,m]=p.data;this.$emit("selectSaturation",{r:d,g:u,b:m})};s(a);const r=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}}});const ff={ref:"canvasSaturation"};function vf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",{class:"saturation",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectSaturation&&a.selectSaturation(...l),["prevent","stop"]))},[e.createVNode("canvas",ff,null,512),e.createVNode("div",{style:a.slideSaturationStyle,class:"slide"},null,4)],32)}vo.render=vf;vo.__file="src/color/Saturation.vue";var ho=e.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 a=this.$refs.canvasHue,t=this.width,o=this.height,n=a.getContext("2d");a.width=t,a.height=o;const s=n.createLinearGradient(0,0,0,o);s.addColorStop(0,"#FF0000"),s.addColorStop(.17*1,"#FF00FF"),s.addColorStop(.17*2,"#0000FF"),s.addColorStop(.17*3,"#00FFFF"),s.addColorStop(.17*4,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),n.fillStyle=s,n.fillRect(0,0,t,o)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(a){const{top:t}=this.$el.getBoundingClientRect(),o=a.target.getContext("2d"),n=r=>{let l=r.clientY-t;l<0&&(l=0),l>this.height&&(l=this.height),this.slideHueStyle={top:l-2+"px"};const i=o.getImageData(0,Math.min(l,this.height-1),1,1),[c,p,d]=i.data;this.$emit("selectHue",{r:c,g:p,b:d})};n(a);const s=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",s)}}});const hf={ref:"canvasHue"};function Cf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",{class:"hue",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectHue&&a.selectHue(...l),["prevent","stop"]))},[e.createVNode("canvas",hf,null,512),e.createVNode("div",{style:a.slideHueStyle,class:"slide"},null,4)],32)}ho.render=Cf;ho.__file="src/color/Hue.vue";var Co=e.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 a=this.$refs.canvasAlpha,t=this.width,o=this.height,n=this.alphaSize,s=fo(n),r=a.getContext("2d");a.width=t,a.height=o,r.fillStyle=r.createPattern(s,"repeat"),r.fillRect(0,0,t,o),Ka("p",r,t,o,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(a){const{top:t}=this.$el.getBoundingClientRect(),o=s=>{let r=s.clientY-t;r<0&&(r=0),r>this.height&&(r=this.height);let l=parseFloat((r/this.height).toFixed(2));this.$emit("selectAlpha",l)};o(a);const n=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",n)}}});const gf={ref:"canvasAlpha"};function _f(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",{class:"color-alpha",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectAlpha&&a.selectAlpha(...l),["prevent","stop"]))},[e.createVNode("canvas",gf,null,512),e.createVNode("div",{style:a.slideAlphaStyle,class:"slide"},null,4)],32)}Co.render=_f;Co.__file="src/color/Alpha.vue";var go=e.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 a=this.$el,t=this.width,o=this.height,n=this.alphaSize,s=fo(n),r=a.getContext("2d");a.width=t,a.height=o,r.fillStyle=r.createPattern(s,"repeat"),r.fillRect(0,0,t,o),r.fillStyle=this.color,r.fillRect(0,0,t,o)}}});function yf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("canvas")}go.render=yf;go.__file="src/color/Preview.vue";var _o=e.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(a){this.isSucking=!1,this.suckColor(a)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(a){a.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(a){const{clientX:t,clientY:o}=a,{top:n,left:s,width:r,height:l}=this.suckerCanvas.getBoundingClientRect(),i=t-s,c=o-n,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(i,r-1),Math.min(c,l-1),1,1);let[u,m,f,h]=d.data;h=parseFloat((h/255).toFixed(2));const y=this.suckerPreview.style;Object.assign(y,{position:"absolute",left:t+20+"px",top:o-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(${u}, ${m}, ${f}, ${h})`,zIndex:95}),this.suckerArea.length&&t>=this.suckerArea[0]&&o>=this.suckerArea[1]&&t<=this.suckerArea[2]&&o<=this.suckerArea[3]?y.display="":y.display="none"},suckColor(a){a&&a.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),a.addEventListener("click",t=>{const{clientX:o,clientY:n}=t,{top:s,left:r,width:l,height:i}=a.getBoundingClientRect(),c=o-r,p=n-s,u=a.getContext("2d").getImageData(Math.min(c,l-1),Math.min(p,i-1),1,1);let[m,f,h,y]=u.data;y=parseFloat((y/255).toFixed(2)),this.$emit("selectSucker",{r:m,g:f,b:h,a:y})}))}}});const bf=e.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),kf={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},wf=e.createVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[e.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),e.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[e.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function $f(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",null,[a.isSucking?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock("svg",{key:0,class:[{active:a.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:t[1]||(t[1]=(...l)=>a.openSucker&&a.openSucker(...l))},[bf],2)),a.isSucking?(e.openBlock(),e.createBlock("svg",kf,[wf])):e.createCommentVNode("v-if",!0)])}_o.render=$f;_o.__file="src/color/Sucker.vue";var yo=e.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(a,{emit:t}){return{modelColor:e.computed({get(){return a.color||""},set(r){t("inputColor",r)}}),handleFocus:r=>{t("inputFocus",r)},handleBlur:r=>{t("inputBlur",r)}}}});const Ef={class:"color-type"},Bf={class:"name"};function Vf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",Ef,[e.createVNode("span",Bf,e.toDisplayString(a.name),1),e.withDirectives(e.createVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=l=>a.modelColor=l),class:"value",onFocus:t[2]||(t[2]=(...l)=>a.handleFocus&&a.handleFocus(...l)),onBlur:t[3]||(t[3]=(...l)=>a.handleBlur&&a.handleBlur(...l))},null,544),[[e.vModelText,a.modelColor]])])}yo.render=Vf;yo.__file="src/color/Box.vue";var bo=e.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(a,{emit:t}){const o=e.ref(),n=e.ref([]),s=e.ref();a.colorsHistoryKey&&localStorage&&(n.value=JSON.parse(localStorage.getItem(a.colorsHistoryKey))||[]),s.value=fo(4).toDataURL(),e.onUnmounted(()=>{r(o.value)});function r(i){if(!i)return;const c=n.value||[],p=c.indexOf(i);p>=0&&c.splice(p,1),c.length>=8&&(c.length=7),c.unshift(i),n.value=c||[],localStorage&&a.colorsHistoryKey&&localStorage.setItem(a.colorsHistoryKey,JSON.stringify(c))}function l(i){t("selectColor",i)}return{setColorsHistory:r,colorsHistory:n,color:o,imgAlphaBase64:s,selectColor:l}}});const Sf={class:"colors"},Nf={key:0,class:"colors history"};function Mf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",null,[e.createVNode("ul",Sf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsDefault,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:i=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))]),a.colorsHistory.length?(e.openBlock(),e.createBlock("ul",Nf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsHistory,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:i=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))])):e.createCommentVNode("v-if",!0)])}bo.render=Mf;bo.__file="src/color/Colors.vue";var ut=e.defineComponent({components:{Saturation:vo,Hue:ho,Alpha:Co,Preview:go,Sucker:_o,Box:yo,Colors:bo},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 uf(this.rgba,!0)}},created(){Object.assign(this,Qe(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(a){const{r:t,g:o,b:n,h:s,s:r,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:r,v:l}),this.setText()},handleFocus(a){this.$emit("inputFocus",a)},handleBlur(a){this.$emit("inputBlur",a)},selectHue(a){const{r:t,g:o,b:n,h:s,s:r,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:r,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(a){this.a=a,this.setText()},inputHex(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.modelHex=a,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.modelHex=this.hexString,this.modelRgba=a,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(a){this.$emit("openSucker",a)},selectSucker(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Tf={class:"color-set"};function Af(a,t,o,n,s,r){const l=e.resolveComponent("Saturation"),i=e.resolveComponent("Hue"),c=e.resolveComponent("Alpha"),p=e.resolveComponent("Preview"),d=e.resolveComponent("Sucker"),u=e.resolveComponent("Box"),m=e.resolveComponent("Colors");return e.openBlock(),e.createBlock("div",{class:["hu-color-picker",{light:a.isLightTheme}],style:{width:a.totalWidth+"px"}},[e.createVNode("div",Tf,[e.createVNode(l,{ref:"saturation",color:a.rgbString,hsv:a.hsv,size:a.hueHeight,onSelectSaturation:a.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),e.createVNode(i,{ref:"hue",hsv:a.hsv,width:a.hueWidth,height:a.hueHeight,onSelectHue:a.selectHue},null,8,["hsv","width","height","onSelectHue"]),e.createVNode(c,{ref:"alpha",color:a.rgbString,rgba:a.rgba,width:a.hueWidth,height:a.hueHeight,onSelectAlpha:a.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),e.createVNode("div",{style:{height:a.previewHeight+"px"},class:"color-show"},[e.createVNode(p,{color:a.rgbaString,width:a.previewWidth,height:a.previewHeight},null,8,["color","width","height"]),a.suckerHide?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(d,{key:0,"sucker-canvas":a.suckerCanvas,"sucker-area":a.suckerArea,onOpenSucker:a.openSucker,onSelectSucker:a.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),e.createVNode(u,{name:"HEX",color:a.modelHex,onInputColor:a.inputHex,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(u,{name:"RGBA",color:a.modelRgba,onInputColor:a.inputRgba,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(m,{color:a.rgbaString,"colors-default":a.colorsDefault,"colors-history-key":a.colorsHistoryKey,onSelectColor:a.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),e.createCommentVNode(" custom options "),e.renderSlot(a.$slots,"default")],6)}ut.render=Af;ut.__file="src/color/ColorPicker.vue";ut.install=a=>{a.component(ut.name,ut)};const Of={class:"color-picker-wrapper"},ko=e.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(a,{emit:t}){const o=a,n=e.ref(!1),s=e.ref(null),r=e.ref(null),l=e.ref(0),i=e.ref(0),c=async f=>{r.value=f,n.value=!0,await e.nextTick();const h=f.getBoundingClientRect(),y=s.value,v=(y==null?void 0:y.offsetHeight)||300,b=window.innerHeight-h.bottom,_=h.top,g=b<v&&_>v;console.log("pickerHeight = "+v),l.value=g?h.top-v-8:h.bottom+8,i.value=h.left,setTimeout(()=>{window.addEventListener("click",d)},0)},p=e.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${i.value}px`,zIndex:1e3})),d=f=>{const h=f.target;s.value&&!s.value.contains(h)&&(n.value=!1,t("update:color",u.value),window.removeEventListener("click",d))};e.onBeforeUnmount(()=>{window.removeEventListener("click",d)}),e.watch(()=>o.color,f=>{n.value||(u.value=f)});const u=e.ref(o.color),m=f=>{const{r:h,g:y,b:v,a:b}=f.rgba;u.value=`rgba(${h}, ${y}, ${v}, ${b})`};return(f,h)=>(e.openBlock(),e.createElementBlock("div",Of,[e.renderSlot(f.$slots,"clickable",{openPicker:c,bgColor:f.color}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:e.normalizeStyle(p.value)},[e.createVNode(e.unref(ut),{class:"color-picker-box",theme:"light",color:f.color,onChangeColor:m},null,8,["color"])],4)):e.createCommentVNode("",!0)]))}});const If={class:"ao-card-project-phase__header"},Lf={class:"ao-card-project-item__title-line"},Df={key:0,class:"ao-card-project-item-phase__estimation"},Pf={class:"ao-card-project-phase__footer"},Hf={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},Rf={class:"ao-card-project-phase__subitem"},jf={class:"ao-card-project-phase__subitem"},Uf={key:0,class:"ao-card-project-phase__secondary"},Ff={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},zf=e.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(a,{emit:t}){const o=a,n=u=>{t("update:title",u)},s=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.reduce((m,f)=>{var h;return m+((h=f.activities)==null?void 0:h.reduce((y,v)=>y+(v.estimation||0),0))},0)}),r=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.length}),l=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.filter(m=>m.status===Ot.done).length}),i=e.computed(()=>(l.value||0)/(r.value||1)),c=e.computed({get:()=>o.deadline??"",set:u=>t("update:deadline",u!=null&&u.length?u:null)}),p=e.computed({get:()=>o.color,set:u=>{t("updatePhase",{id:o.id,color:u})}}),d=(u,m)=>{const f=u.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m(f)};return(u,m)=>(e.openBlock(),e.createBlock(ko,{color:p.value,"onUpdate:color":m[2]||(m[2]=f=>p.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:h})=>[e.createVNode(Va,{class:"ao-card-project-phase","is-clickable":u.isEditable,color:h,withLeftBorder:!0,onClick:y=>d(y,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Lf,[e.createVNode(ne,{id:u.id,class:"ao-card-project-phase__title",title:u.name||"",level:4,"is-editable":u.isEditable,"onUpdate:title":n},null,8,["id","title","is-editable"]),s.value?(e.openBlock(),e.createElementBlock("span",Df," ("+e.toDisplayString(s.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",Pf,[r.value?(e.openBlock(),e.createElementBlock("div",Hf,[e.createElementVNode("div",Rf,[e.createVNode(X,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",jf,e.toDisplayString(l.value)+" / "+e.toDisplayString(r.value),1)]),e.createVNode(Sa,{percentages:i.value,class:"ao-card-project-phase__progress",color:u.color},null,8,["percentages","color"]),u.$slots.secondary?(e.openBlock(),e.createElementBlock("div",Uf,[e.renderSlot(u.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-card-project-phase__footer-row",c.value?"":"ao-card-project-phase__no_deadline"])},[u.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=y=>c.value=y),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",Ff,e.toDisplayString(e.unref(_a)(u.deadline)),1)],2)])]),_:2},[u.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",If,[e.createVNode(K,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:u.active?u.$t("archive"):u.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>u.active?u.$emit("archivePhase",{id:u.id}):u.$emit("unarchivePhase",{id:u.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Zf=e.defineComponent({__name:"AoBadge",props:{color:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("span",{class:"aoBadge",style:e.normalizeStyle({backgroundColor:t.color})},null,4))}});const xf={class:"ao-card-project-milestone__default"},Wf={class:"ao-title-with-badge-wrapper"},qf={class:"ao-card-project-item__title-line"},Yf={key:0,class:"ao-card-project-item-milestone__estimation"},Kf={key:0,class:"ao-card-project-milestone__archive"},Gf={class:"ao-card-project-milestone__activities"},Xf={class:"ao-card-project-milestone__activities-row"},Qf={class:"ao-card-project-milestone__subitem"},Jf={class:"ao-card-project-milestone__subitem"},ev={key:1,class:"ao-card-project-milestone__secondary"},tv={class:"ao-card-project-milestone__footer"},av={key:1,class:"ao-field ao-card-project-milestone__deadline"},ov={class:"ao-field__label"},nv={key:2,class:"ao-card-project-milestone__assignee"},sv=e.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}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(a,{emit:t}){const o=a,n=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.reduce((p,d)=>p+(d.estimation||0),0)}),s=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.length}),r=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.filter(p=>Ja(p,o.closedStatus)).length}),l=e.computed(()=>(r.value||0)/(s.value||1)),i=c=>{t("updateMilestone",{id:o.id,name:c})};return(c,p)=>(e.openBlock(),e.createBlock(Va,{class:e.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!c.readonly,"tag-name":"li","is-selected":c.isSelected,color:c.phaseColor},{default:e.withCtx(()=>[e.createElementVNode("div",xf,[e.createElementVNode("div",Wf,[e.createVNode(Zf,{color:c.color||""},null,8,["color"]),e.createElementVNode("div",qf,[e.createVNode(ne,{id:c.id,title:c.name||"",level:5,"is-editable":!c.readonly&&c.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":i},null,8,["id","title","is-editable"]),n.value?(e.openBlock(),e.createElementBlock("span",Yf," ("+e.toDisplayString(n.value)+")",1)):e.createCommentVNode("",!0)])]),!c.readonly&&c.isEditable?(e.openBlock(),e.createElementBlock("div",Kf,[e.createVNode(K,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:c.active?c.$t("archive"):c.$t("unarchive"),onClick:p[0]||(p[0]=e.withModifiers(()=>c.active?c.$emit("archiveMilestone",{id:c.id}):c.$emit("unarchiveMilestone",{id:c.id}),["stop"]))},null,8,["label"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gf,[e.createElementVNode("div",Xf,[s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Qf,[e.createVNode(X,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",Jf,e.toDisplayString(r.value)+" / "+e.toDisplayString(s.value),1)]),e.createVNode(Sa,{percentages:l.value,color:c.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):e.createCommentVNode("",!0),c.$slots.secondary?(e.openBlock(),e.createElementBlock("div",ev,[e.renderSlot(c.$slots,"secondary")])):e.createCommentVNode("",!0)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",tv,[c.important?(e.openBlock(),e.createBlock(X,{key:0,name:"FlagRounded",class:e.normalizeClass(c.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):e.createCommentVNode("",!0),c.deadline?(e.openBlock(),e.createElementBlock("label",av,[e.createElementVNode("span",ov,e.toDisplayString(e.unref(_a)(c.deadline)),1)])):e.createCommentVNode("",!0),c.assignee?(e.openBlock(),e.createElementBlock("div",nv,[e.createVNode(ke,{"user-name":e.unref(bn)(c.assignee),"avatar-url":c.assignee.avatarUrl,color:c.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):e.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const lv={class:"ao-mapping-card-project-phase__header"},rv={class:"ao-card-project-item__title-line"},iv={key:0,class:"ao-card-project-item-phase__estimation"},cv={class:"ao-mapping-card-project-phase__footer"},dv={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},uv={class:"ao-mapping-card-project-phase__subitem"},pv={class:"ao-mapping-card-project-phase__subitem"},mv={key:0,class:"ao-mapping-card-project-phase__secondary"},fv={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},vv=e.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,n=u=>{t("update:title",u)},s=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.reduce((m,f)=>{var h;return m+((h=f.activities)==null?void 0:h.reduce((y,v)=>y+(v.estimation||0),0))},0)}),r=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.length}),l=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.filter(m=>m.status===Ot.done).length}),i=e.computed(()=>(l.value||0)/(r.value||1)),c=e.computed({get:()=>o.deadline??"",set:u=>t("update:deadline",u!=null&&u.length?u:null)}),p=e.computed({get:()=>o.color,set:u=>{t("updatePhase",{id:o.id,color:u})}}),d=(u,m)=>{const f=u.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m()};return(u,m)=>(e.openBlock(),e.createBlock(ko,{color:p.value,"onUpdate:color":m[2]||(m[2]=f=>p.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:h})=>[e.createVNode(Va,{class:"ao-mapping-card-project-phase","is-clickable":u.isEditable,color:h,withLeftBorder:!0,onClick:y=>d(y,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",rv,[e.createVNode(ne,{id:u.id,class:"ao-mapping-card-project-phase__title",title:u.name||"",level:4,"is-editable":u.isEditable,"onUpdate:title":n},null,8,["id","title","is-editable"]),s.value?(e.openBlock(),e.createElementBlock("span",iv," ("+e.toDisplayString(s.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",cv,[r.value?(e.openBlock(),e.createElementBlock("div",dv,[e.createElementVNode("div",uv,[e.createVNode(X,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",pv,e.toDisplayString(l.value)+" / "+e.toDisplayString(r.value),1)]),e.createVNode(Sa,{percentages:i.value,class:"ao-mapping-card-project-phase__progress",color:p.value},null,8,["percentages","color"]),u.$slots.secondary?(e.openBlock(),e.createElementBlock("div",mv,[e.renderSlot(u.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-mapping-card-project-phase__footer-row",c.value?"":"ao-mapping-card-project-phase__no_deadline"])},[u.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=y=>c.value=y),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",fv,e.toDisplayString(e.unref(_a)(u.deadline)),1)],2)])]),_:2},[u.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",lv,[e.createVNode(K,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:u.active?u.$t("archive"):u.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>u.active?u.$emit("archivePhase",{id:u.id}):u.$emit("unarchivePhase",{id:u.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const hv={class:"ao-project-phase"},Cv={key:0,class:"ao-project-phase__drag ao-card__drag"},gv={key:1,class:"ao-project-phase__col-phase"},_v={key:2,class:"ao-mapping-project-phase__col-phase"},yv={key:0,class:"ao-project-phase__col-milestones"},bv={class:"ao-project-phase__milestones-list-footer"},kv=e.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,{t:n}=Ye();e.watch(()=>o.phase.milestones,(_,g)=>{Me(_,g)});const s=_=>{t("updatePhase",{id:o.phase.id,name:_})},r=_=>{t("updatePhase",{id:o.phase.id,deadline:_})},l=_=>{t("updatePhase",_)},i=e.computed(()=>o.phase.milestones.map(_=>J0(_,o.closedStatus))),c=_=>{const{name:g,rank:C}=ot(i.value??[],"milestone",n);t("addMilestone",{name:g,rank:C,phaseId:_})},p=_=>{t("updateMilestone",_)},d=_=>{t("archiveMilestone",_)},u=_=>{t("unarchiveMilestone",_)},m=_=>{t("archivePhase",_)},f=_=>{t("unarchivePhase",_)},h=_=>{"added"in _?t("updateMilestone",{id:_.added.element.id,phaseId:o.phase.id,rank:pt(i.value,_.added.newIndex)}):"removed"in _||"moved"in _&&t("updateMilestone",{id:_.moved.element.id,rank:pt(i.value,_.moved.newIndex)})},y=Rt.useRoute(),v=e.computed(()=>y.path.includes("/mapping")),b=e.computed(()=>{var _;return o.phase.id!==((_=y.params)==null?void 0:_.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:t3(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(_,g)=>(e.openBlock(),e.createElementBlock("li",hv,[e.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:e.normalizeStyle(b.value)},[_.isEditable?(e.openBlock(),e.createElementBlock("div",Cv,[e.createVNode(X,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("div",_v,[e.createVNode(vv,{id:_.phase.id,milestones:i.value,name:_.phase.name,deadline:_.phase.deadline,active:_.phase.active,"is-editable":_.isEditable,color:_.phase.color,"onUpdate:deadline":r,"onUpdate:title":s,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color"])])):(e.openBlock(),e.createElementBlock("div",gv,[e.createVNode(zf,{id:_.phase.id,milestones:i.value,name:_.phase.name,deadline:_.phase.deadline,active:_.phase.active,"is-editable":_.isEditable,color:_.phase.color,"onUpdate:deadline":r,"onUpdate:title":s,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color"])]))],4),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yv,[e.createElementVNode("div",{class:"ao-project-phase__milestones",style:e.normalizeStyle(b.value)},[e.createVNode(e.unref(xe),e.mergeProps({class:"ao-project-phase__milestones-list",list:i.value,disabled:_.readonly||!_.isEditable,"item-key":"id",group:"kanban"},_.$attrs,{onChange:h}),{item:e.withCtx(({element:C})=>{var B;return[e.createVNode(sv,{id:C.id,name:C.name,color:C.color,"phase-color":_.phase.color,activities:C.activities,deadline:C.deadline,active:C.active,"is-editable":!_.readonly&&_.isEditable,"is-draggable":!_.readonly&&_.isEditable,"closed-status":_.closedStatus,"is-selected":C.id===((B=_.$route.params)==null?void 0:B.milestoneId),assignee:C.assignee,important:C.important,readonly:_.readonly,class:e.normalizeClass(["ao-project-phase__milestone"]),onClick:$=>!_.readonly&&_.$router.push({name:e.unref(oe).milestone,params:{phaseId:_.phase.id,milestoneId:C.id}}),onUpdateMilestone:p,onArchiveMilestone:d,onUnarchiveMilestone:u},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","onClick"])]}),_:1},16,["list","disabled"]),e.createElementVNode("div",bv,[_.isEditable?(e.openBlock(),e.createBlock(We,{key:0,label:_.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:g[0]||(g[0]=()=>c(_.phase.id))},null,8,["label"])):e.createCommentVNode("",!0)])],4)]))]))}});const wv={class:"ao-project__phases"},$v={key:0,class:"ao-project-phase__phases-list-footer"},Ev=e.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1),Bv={class:"ao-project-phase__col-phase"},Vv=e.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1),wo=e.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a;e.watch(()=>o.phases,(m,f)=>{Me(m,f)});const n=m=>{t("addMilestone",m)},s=m=>{t("updateMilestone",m)},r=m=>{t("archiveMilestone",m)},l=m=>{t("unarchiveMilestone",m)},i=m=>{t("archivePhase",m)},c=m=>{t("unarchivePhase",m)},p=m=>{if(m.moved){const f=zt(m,o.phases??[]);t("updatePhase",{id:m.moved.element.id,rank:f})}},d=m=>{t("updatePhase",m)},u=m=>{t("addPhase",m)};return(m,f)=>(e.openBlock(),e.createElementBlock("div",wv,[e.createVNode(e.unref(xe),{class:"ao-project-phase__phases-list","model-value":m.phases,"item-key":"id",handle:".ao-card__drag",onChange:p},{item:e.withCtx(({element:h})=>[e.createVNode(kv,{phase:h,"is-editable":!m.readonly&&m.isEditable,"closed-status":m.closedStatus,users:m.users,readonly:m.readonly,onAddMilestone:n,onUpdateMilestone:s,onArchiveMilestone:r,onUnarchiveMilestone:l,onUpdatePhase:d,onArchivePhase:i,onUnarchivePhase:c},null,8,["phase","is-editable","closed-status","users","readonly"])]),_:1},8,["model-value"]),m.isEditable?(e.openBlock(),e.createElementBlock("div",$v,[Ev,e.createElementVNode("div",Bv,[e.createVNode(We,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:u},null,8,["label"])]),Vv])):e.createCommentVNode("",!0)]))}});const Sv=["onSubmit"],Nv={class:"ao-add-template-modal__form-body"},Mv={class:"field__row"},Tv={class:"ao-add-template-modal__form-footer"},Un=e.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(a,{emit:t}){const o=a,n=e.computed(()=>o.templates.map(i=>({value:i.id,label:i.name}))),s=e.ref(null),r=i=>{s.value=i},l=()=>{s.value&&t("apply",s.value,o.projectId)};return(i,c)=>(e.openBlock(),e.createBlock(ya,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:i.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:e.withModifiers(l,["prevent"])},[e.createElementVNode("p",null,e.toDisplayString(i.$t("project.template.apply.notice")),1),e.createElementVNode("div",Nv,[e.createElementVNode("div",Mv,[e.createVNode(ie,{value:s.value,options:n.value,detached:!0,onChange:r},null,8,["value","options"])])]),e.createElementVNode("footer",Tv,[e.createVNode(K,{label:i.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],40,Sv)]),_:1}))}});const Av=["onSubmit"],Ov={class:"ao-save-template-modal__form-body"},Iv={class:"field__row"},Lv={class:"ao-field ao-field--inline"},Dv={class:"ao-field__label"},Pv={class:"ao-save-template-modal__phases"},Hv={class:"ao-field__label"},Rv={class:"ao-save-template-modal__phases-list"},jv=["value"],Uv={class:"ao-save-template-modal__form-footer"},Fn=e.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(a,{emit:t}){const o=a,n=e.ref(""),s=e.ref([]);e.onMounted(()=>{s.value=o.phases.map(l=>l.id)});const r=()=>{n.value&&t("save",n.value,s.value)};return(l,i)=>(e.openBlock(),e.createBlock(ya,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:e.withModifiers(r,["prevent"])},[e.createElementVNode("div",Ov,[e.createElementVNode("div",Iv,[e.createElementVNode("label",Lv,[e.createElementVNode("span",Dv,e.toDisplayString(l.$t("project.template.name.label"))+": ",1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=c=>n.value=c),type:"text"},null,512),[[e.vModelText,n.value]])])]),e.createElementVNode("div",Pv,[e.createElementVNode("div",Hv,e.toDisplayString(l.$t("project.template.phases.label")),1),e.createElementVNode("div",Rv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.phases,c=>(e.openBlock(),e.createElementBlock("label",{class:"ao-field ao-field--checkbox",key:c.id},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:c.id,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p)},null,8,jv),[[e.vModelCheckbox,s.value]]),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]))),128))])])]),e.createElementVNode("footer",Uv,[e.createVNode(K,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:r},null,8,["label"])])],40,Av)]),_:1}))}});const Fv=e.defineComponent({props:{modelValue:{type:[String,Number],required:!0},tabs:{type:Array,required:!0}},emits:["update:modelValue"],methods:{selectTab(a){this.$emit("update:modelValue",a)}}});const zv={class:"tabbar-wrapper"},Zv=["onClick"];function xv(a,t,o,n,s,r){return e.openBlock(),e.createElementBlock("div",zv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tabs,l=>(e.openBlock(),e.createElementBlock("button",{key:l.value,class:e.normalizeClass(["tab-button",{"tab-button--active":l.value===a.modelValue}]),type:"button",onClick:i=>a.selectTab(l.value)},e.toDisplayString(l.label),11,Zv))),128))])}const Na=H(Fv,[["render",xv],["__scopeId","data-v-ff4e3297"]]),Wv={class:"ao-project"},qv={class:"ao-project__body"},Yv=e.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}},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(a,{emit:t}){const o=a,{t:n}=Ye(),s=e.computed(()=>o.phases.flatMap(E=>E.milestones)),r=()=>{const{name:E,rank:P}=ot(o.phases,"phase",n);t("addPhase",{name:E,rank:P,projectId:o.project.id})},l=E=>{t("updatePhase",E)},i=E=>{t("archivePhase",E)},c=E=>{t("unarchivePhase",E)},p=E=>{t("copyPhaseToTemplate",E)},d=E=>{t("addMilestone",E)},u=E=>{t("updateMilestone",E)},m=E=>{t("archiveMilestone",E)},f=E=>{t("unarchiveMilestone",E)},h=E=>{t("addActivity",E)},y=E=>{t("update:activity",E)},v=E=>{t("archiveActivity",E)},b=E=>{t("unarchiveActivity",E)},_=E=>{t("addSubtask",E)},g=E=>{t("updateSubtask",E)},C=E=>{t("deleteSubtask",E)},B=e.computed(()=>s.value.flatMap(E=>E.activities)),$=E=>{t("addFiles",E)},N=E=>{t("removeFile",E)},O=E=>{t("addComment",E)},j=E=>{t("updateComment",E)},z=E=>{t("removeComment",E)},x=e.ref(!1),I=e.ref(!1),U=(E,P)=>{t("applyTemplate",{templateId:E,projectId:P}),x.value=!1},Y=(E,P)=>{var k;const V=(k=o.templates)==null?void 0:k.at(-1),A=V?se.LexoRank.parse(V.rank).genNext():se.LexoRank.middle();t("saveTemplate",{templateName:E,rank:A.format(),phaseIds:P}),I.value=!1},W=Rt.useRouter(),Z=e.ref("overview"),S=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(Z,E=>{E==="feed"?(W.push({name:oe.feed}),console.log("Navigating to feed...")):E==="overview"?(W.push({name:oe.project}),console.log("Navigating to feed...")):E==="mapping"&&(W.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(E,P)=>{const V=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-overview"},E.$attrs),[e.createElementVNode("div",Wv,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createVNode(Na,{tabs:S,modelValue:Z.value,"onUpdate:modelValue":P[0]||(P[0]=A=>Z.value=A)},null,8,["modelValue"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":E.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:E.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":E.showsArchived,onClick:P[1]||(P[1]=A=>E.$emit("update:showsArchived",!E.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:E.$t("project.template.save.label"),onClick:P[2]||(P[2]=A=>I.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:1,class:"ao-project-overview__add-template",color:"primary",label:E.$t("project.template.apply.label"),onClick:P[3]||(P[3]=A=>x.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",qv,[e.createVNode(wo,{phases:E.phases,"closed-status":E.closedStatus,"is-editable":E.isEditable===!0,users:E.users,onAddMilestone:d,onUpdateMilestone:u,onArchiveMilestone:m,onUnarchiveMilestone:f,onAddPhase:r,onUpdatePhase:l,onArchivePhase:i,onUnarchivePhase:c,onCopyPhaseToTemplate:p},null,8,["phases","closed-status","is-editable","users"])])]),e.createVNode(V,{class:"ao-project__sidebar",phases:E.phases,"project-id":E.project.id,"project-name":E.project.name,users:E.users,"is-editable":E.isEditable===!0,"closed-status":E.closedStatus,onClose:P[4]||(P[4]=A=>E.$router.push({name:e.unref(oe).project})),onUpdateMilestone:u,onAddActivity:h,onUpdateActivity:y,onArchiveActivity:v,onUnarchiveActivity:b},null,8,["phases","project-id","project-name","users","is-editable","closed-status"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(V,{name:"modal",activities:B.value,"is-task-checkable":E.isTaskCheckable,statuses:E.statuses,"activity-types":E.activityTypes,phases:E.phases,project:E.project,users:E.users,"user-id":E.userId,"is-editable":E.isEditable,"attachment-enabled":E.attachmentEnabled,"onUpdate:activity":y,onAddSubtask:_,onUpdateSubtask:g,onDeleteSubtask:C,onAddFiles:$,onRemoveFile:N,onAddComment:O,onUpdateComment:j,onRemoveComment:z},{default:e.withCtx(({Component:A})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(A),null,{default:e.withCtx(k=>[e.renderSlot(E.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(k)))]),_:2},1024))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled"])]))],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[I.value?(e.openBlock(),e.createBlock(Fn,{key:0,phases:E.phases,onClose:P[5]||(P[5]=A=>I.value=!1),onSave:Y},null,8,["phases"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createBlock(Un,{key:1,"project-id":E.project.id,templates:E.templates,onClose:P[6]||(P[6]=A=>x.value=!1),onApply:U},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64)}}});const Kv={class:"ao-card-feed__header"},Gv={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},Xv={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Qv={class:"ao-card-feed__body"},Jv={key:0,class:"ao-card-feed__breadcrumbs"},eh={class:e.normalizeClass(["ao-card-feed__title-group"])},th={class:"ao-card-feed__title-line"},ah={key:0,class:"ao-card-feed__slug"},oh={key:1,class:"ao-card-feed__deadline"},nh={class:"ao-card-feed__footer"},sh={class:"ao-card-feed__footer-row"},lh={class:"ao-assignees"},rh={key:0,class:"ao-assignee"},ih={key:0,class:"ao-card-feed__subitems"},ch={key:0,class:"ao-card-feed__subitem"},dh={class:"ao-card-feed__subitem"},uh={key:1,class:"ao-card-feed__subitem"},ph={class:"ao-card-feed__subitem"},mh={class:"ao-card-feed__footer-row"},fh={key:0,class:"ao-card-feed__progress-wrapper"},vh={class:"ao-card-feed__subitem"},hh={class:"ao-card-feed__subitem"},$o=e.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(a,{emit:t}){const o=a,n=e.computed(()=>o.tagType==="milestone"?o.milestoneName:o.projectName),s=e.computed(()=>o.tagType==="milestone"?o.milestoneColor:o.projectColor),r=h=>{t("updateActivity",{id:o.id,name:h})},l=e.computed(()=>o.tagType==="milestone"&&o.phaseName?`${o.phaseName}`:o.phaseName&&o.milestoneName?`${o.phaseName} / ${o.milestoneName}`:""),i=e.computed(()=>o.assignee?[o.assignee]:[]),c=e.computed(()=>_a(o.deadline)),p=h=>{t("removeAssignee",h)},d=()=>{t("startTimer",{activityId:o.id,name:o.name,project:o.projectName,projectId:o.projectId,slug:o.slug})},u=e.computed(()=>{var h;return(h=o.tasks)==null?void 0:h.length}),m=e.computed(()=>{var h;return(h=o.tasks)==null?void 0:h.filter(y=>y.isDone).length}),f=e.computed(()=>(m.value||0)/(u.value||1));return(h,y)=>(e.openBlock(),e.createBlock(Va,{class:e.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":h.isClosed}]),"is-clickable":!0},{header:e.withCtx(()=>[e.createElementVNode("div",Kv,[n.value?(e.openBlock(),e.createBlock(At,{key:0,label:n.value,class:"ao-card-feed__project",variant:"solid",color:h.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):e.createCommentVNode("",!0),h.isPrivate||h.important||h.isClosed?(e.openBlock(),e.createElementBlock("div",Gv,[h.isPrivate?(e.openBlock(),e.createBlock(X,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):e.createCommentVNode("",!0),h.important?(e.openBlock(),e.createBlock(X,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):e.createCommentVNode("",!0),h.isClosed?(e.openBlock(),e.createBlock(X,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),h.$slots.secondary?(e.openBlock(),e.createElementBlock("div",Xv,[e.createVNode(X,{name:"TimerOutline",class:"ao-card-feed__timer",size:"sm",onClick:e.withModifiers(d,["stop"])},null,8,["onClick"]),e.renderSlot(h.$slots,"secondary")])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createElementVNode("div",Qv,[l.value?(e.openBlock(),e.createElementBlock("span",Jv,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",eh,[e.createElementVNode("div",th,[h.slug?(e.openBlock(),e.createElementBlock("span",ah,e.toDisplayString(h.slug)+": ",1)):e.createCommentVNode("",!0),e.createVNode(ne,{id:h.id,title:h.name,level:5,"is-editable":h.isEditable,"onUpdate:title":r,class:"ao-card-feed__title-inline"},null,8,["id","title","is-editable"])])]),h.deadline?(e.openBlock(),e.createElementBlock("span",oh,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",nh,[e.createElementVNode("div",sh,[e.createElementVNode("ul",lh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,v=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:v.id},[v?(e.openBlock(),e.createElementBlock("li",rh,[e.createVNode(ke,{"user-name":e.unref(bn)(v),"avatar-url":v.avatarUrl,"is-closable":!0,onClose:()=>p(v.id)},null,8,["user-name","avatar-url","onClose"])])):e.createCommentVNode("",!0)],64))),128))]),h.comments||h.attachments?(e.openBlock(),e.createElementBlock("ul",ih,[h.comments?(e.openBlock(),e.createElementBlock("li",ch,[e.createVNode(X,{name:"ChatOutline",size:"sm"}),e.createElementVNode("span",dh,e.toDisplayString(h.comments),1)])):e.createCommentVNode("",!0),h.attachments?(e.openBlock(),e.createElementBlock("li",uh,[e.createVNode(X,{name:"AttachFileRounded",size:"sm"}),e.createElementVNode("span",ph,e.toDisplayString(h.attachments),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",mh,[h.tasks&&h.tasks.length?(e.openBlock(),e.createElementBlock("div",fh,[e.createElementVNode("div",vh,[e.createVNode(X,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",hh,e.toDisplayString(m.value)+" / "+e.toDisplayString(u.value),1)]),e.createVNode(Sa,{percentages:f.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):e.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const Ch={class:"ao-project-milestone"},gh={class:"ao-project-milestone__header"},_h={class:"ao-project-milestone__header_line"},yh={class:"ao-project-milestone__header_line"},bh={class:"ao-project-milestone__title"},kh={key:0,class:"ao-fieldset ao-milestone__fieldset"},wh={class:"ao-field__row ao-milestone__field-row"},$h={class:"ao-field ao-field--inline"},Eh={class:"ao-field__row ao-milestone__field-row"},Bh={class:"ao-field ao-milestone__field-multiselect"},Vh=["onClick"],Sh={class:"ao-project-milestone__body"},Nh={key:0,class:"ao-project-milestone__footer"},Qo=e.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(a,{emit:t}){const o=a,{t:n}=Ye(),s=C=>{var B;t("startTimer",C),(B=window.parent)==null||B.postMessage({type:"startTimer",data:C},"*")},r=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(B=>B.id===o.phaseId)}),l=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(B=>B.milestones)}),i=e.computed(()=>{var C;return(C=l.value)==null?void 0:C.find(B=>B.id===o.milestoneId)}),c=e.computed(()=>{var C;return(C=i.value)==null?void 0:C.activities});e.watch(c,(C,B)=>{Me(C,B)});const p=C=>{t("close",C)},d=()=>{const{name:C,rank:B}=ot(c.value??[],"activity",n);t("addActivity",{milestoneId:o.milestoneId,name:C,rank:B,projectId:o.projectId})},u=C=>{t("updateActivity",C)},m=C=>{c.value&&"moved"in C&&t("updateActivity",{id:C.moved.element.id,rank:pt(c.value,C.moved.newIndex)})},f=e.computed({get:()=>{var C;return(C=i.value)==null?void 0:C.color},set:C=>{i.value&&t("updateMilestone",{id:i.value.id,color:C})}}),h=e.computed({get:()=>{var C;return((C=i==null?void 0:i.value)==null?void 0:C.deadline)??""},set:C=>{i.value&&t("updateMilestone",{id:i.value.id,deadline:C!=null&&C.length?C:null})}}),y=C=>o.closedStatus?Ja(C,o.closedStatus):!1,v=e.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(B=>({label:`${B.firstName} ${B.lastName}`,value:B.id,avatar:B.avatarUrl})))||[]}),b=e.computed({get(){var C,B;return(B=(C=i.value)==null?void 0:C.assignee)!=null&&B.id?[i.value.assignee.id]:[]},set(C){t("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),_=e.computed({get(){var C;return((C=i.value)==null?void 0:C.important)??!1},set(C){t("updateMilestone",{id:o.milestoneId,important:C})}}),g=(C,B)=>{const $=C.currentTarget;$ instanceof HTMLElement&&B($)};return(C,B)=>{var $;return e.openBlock(),e.createElementBlock("div",Ch,[e.createElementVNode("header",gh,[e.createElementVNode("div",_h,[e.createVNode(K,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:p})]),e.createElementVNode("div",yh,[e.createElementVNode("div",bh,[e.createVNode(ne,{title:(($=i.value)==null?void 0:$.name)||C.milestoneId,level:5},null,8,["title"]),e.createVNode(Ya,{modelValue:_.value,"onUpdate:modelValue":B[0]||(B[0]=N=>_.value=N),modelModifiers:{lazy:!0},disabled:!C.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"])])]),i.value?(e.openBlock(),e.createElementBlock("div",kh,[e.createElementVNode("div",wh,[e.createElementVNode("label",$h,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[1]||(B[1]=N=>h.value=N),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[e.vModelText,h.value,void 0,{lazy:!0}]])])]),e.createElementVNode("div",Eh,[e.createElementVNode("label",Bh,[e.createVNode(ie,{modelValue:b.value,"onUpdate:modelValue":B[2]||(B[2]=N=>b.value=N),options:v.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:!C.isEditable,caret:C.isEditable},{tag:e.withCtx(({option:N,handleTagRemove:O})=>[e.createVNode(ke,{"user-name":N.label,"avatar-url":N.avatar,"is-closable":!0,onClose:j=>O(N,j)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),e.createVNode(ko,{color:f.value,"onUpdate:color":B[3]||(B[3]=N=>f.value=N)},{clickable:e.withCtx(({openPicker:N,bgColor:O})=>[e.createElementVNode("button",{style:e.normalizeStyle({background:O}),class:"color-button",onClick:j=>g(j,N)},null,12,Vh)]),_:1},8,["color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Sh,[e.createVNode(e.unref(xe),e.mergeProps({class:"ao-project-milestone__activities",list:c.value,disabled:!C.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:m}),{item:e.withCtx(({element:N})=>{var O,j,z,x,I;return[e.createVNode($o,{id:N.id,name:N.name||N.id,"project-id":C.projectId,"phase-name":(O=r.value)==null?void 0:O.name,"milestone-name":(j=i.value)==null?void 0:j.name,"milestone-color":(z=i.value)==null?void 0:z.color,deadline:N.deadline,important:N.important,users:C.users,assignee:N.assignee,slug:N.slug,comments:(x=N.comments)==null?void 0:x.length,attachments:(I=N.attachments)==null?void 0:I.length,tasks:N.tasks,"is-editable":C.isEditable,"is-private":N.private,"is-closed":y(N),onClick:U=>C.$router.push({name:e.unref(oe).activity,params:{milestoneId:C.milestoneId,activityId:N.id}}),onUpdateActivity:u,onRemoveAssignee:()=>u({id:N.id,assigneeId:null}),onStartTimer:s},e.createSlots({_:2},[C.isEditable?{name:"secondary",fn:e.withCtx(()=>[C.isEditable&&N.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:e.withModifiers(()=>C.$emit("archiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),C.isEditable&&!N.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>C.$emit("unarchiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.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"]),C.isEditable?(e.openBlock(),e.createElementBlock("div",Nh,[e.createVNode(We,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:d},null,8,["label"])])):e.createCommentVNode("",!0)])])}}});const Mh=e.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(a,{emit:t}){const o=a,n=e.computed(()=>{var v;return(v=o.phases)==null?void 0:v.find(b=>b.id===o.phaseId)}),s=e.computed(()=>{var v;return(v=o.phases)==null?void 0:v.flatMap(b=>b.milestones)}),r=e.computed(()=>{var v;return(v=s.value)==null?void 0:v.find(b=>b.id===o.milestoneId)}),l=e.computed(()=>{var v;return console.log("=== AoProjectOverviewActivityDetails debug ==="),console.log("props.timeTrackingData:",JSON.stringify(o.timeTrackingData,null,2)),console.log("props.activityId:",o.activityId),(v=o.activities)==null?void 0:v.find(b=>b.id===o.activityId)}),i=v=>{t("update:activity",v)},c=v=>{t("addSubtask",v)},p=v=>{t("updateSubtask",v)},d=v=>{t("deleteSubtask",v)},u=v=>{t("addFiles",v)},m=v=>{t("removeFile",v)},f=v=>{t("addComment",v)},h=v=>{t("updateComment",v)},y=v=>{t("removeComment",v)};return(v,b)=>{var _,g;return l.value?(e.openBlock(),e.createBlock(mo,{key:0,activity:l.value,"activity-types":v.activityTypes,"milestone-id":v.milestoneId,"template-activities":v.activities,"is-template":!1,users:v.users,"user-id":v.userId,"is-task-checkable":v.isTaskCheckable,statuses:v.statuses,breadcrumbs:`${(_=n.value)==null?void 0:_.name} / ${(g=r.value)==null?void 0:g.name}`,"is-editable":v.isEditable,"attachment-enabled":v.attachmentEnabled,projects:[v.project],"time-tracking-data":v.timeTrackingData,onClose:v.$router.back,"onUpdate:activity":i,onAddSubtask:c,onUpdateSubtask:p,onDeleteSubtask:d,onAddFiles:u,onRemoveFile:m,onAddComment:f,onUpdateComment:h,onRemoveComment:y},{default:e.withCtx(C=>[e.renderSlot(v.$slots,"default",e.normalizeProps(e.guardReactiveProps(C)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","onClose"])):e.createCommentVNode("",!0)}}}),Th={class:"ao-col-header"},Ah=e.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("header",Th,[e.createVNode(ne,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(e.openBlock(),e.createBlock(At,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):e.createCommentVNode("",!0)]))}});function Oh(a){return e.getCurrentScope()?(e.onScopeDispose(a),!0):!1}function ma(a){return typeof a=="function"?a():e.unref(a)}const Ih=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Lh=a=>a!=null,Tt=()=>{};function Dh(a,t){function o(...n){return new Promise((s,r)=>{Promise.resolve(a(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(s).catch(r)})}return o}function Ph(a,t={}){let o,n,s=Tt;const r=i=>{clearTimeout(i),s(),s=Tt};return i=>{const c=ma(a),p=ma(t.maxWait);return o&&r(o),c<=0||p!==void 0&&p<=0?(n&&(r(n),n=null),Promise.resolve(i())):new Promise((d,u)=>{s=t.rejectOnCancel?u:d,p&&!n&&(n=setTimeout(()=>{o&&r(o),n=null,d(i())},p)),o=setTimeout(()=>{n&&r(n),n=null,d(i())},c)})}}function Hh(a,t=200,o={}){return Dh(Ph(t,o),a)}function za(a){var t;const o=ma(a);return(t=o==null?void 0:o.$el)!=null?t:o}const Rh=Ih?window:void 0;function jh(){const a=e.ref(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{a.value=!0},t),a}function Uh(a){const t=jh();return e.computed(()=>(t.value,!!a()))}function Fh(a,t,o={}){const{root:n,rootMargin:s="0px",threshold:r=.1,window:l=Rh,immediate:i=!0}=o,c=Uh(()=>l&&"IntersectionObserver"in l),p=e.computed(()=>{const h=ma(a);return(Array.isArray(h)?h:[h]).map(za).filter(Lh)});let d=Tt;const u=e.ref(i),m=c.value?e.watch(()=>[p.value,za(n),u.value],([h,y])=>{if(d(),!u.value||!h.length)return;const v=new IntersectionObserver(t,{root:za(y),rootMargin:s,threshold:r});h.forEach(b=>b&&v.observe(b)),d=()=>{v.disconnect(),d=Tt}},{immediate:i,flush:"post"}):Tt,f=()=>{d(),m(),u.value=!1};return Oh(f),{isSupported:c,isActive:u,pause(){d(),u.value=!1},resume(){u.value=!0},stop:f}}const zh={class:e.normalizeClass(["ao-list-kanban"])},Zh={class:"ao-list-kanban__header"},xh={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Wh={key:1,class:"ao-list-kanban__end"},qh={key:0,class:"ao-list-kanban__no-more"},Yh={key:1,class:"ao-list-kanban__divider"},Kh={key:1,class:"ao-list-kanban__footer"},Gh=e.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{}},emits:["add","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(a,{emit:t}){const o=a,n=e.ref(!1),s=e.ref(null);Fh(s,([{isIntersecting:d}])=>{n.value=d}),e.watch(n,d=>{d&&o.hasMore&&!o.isLoading&&t("loadMore")});const r=d=>{var u;return o.isEditable===!0?!0:o.userId&&o.isEditable==="only-own"?o.userId===((u=d.assignee)==null?void 0:u.id):!1},l=d=>{t("selectActivity",d)},i=d=>{t("updateActivity",d)},c=d=>{"added"in d?t("updateActivity",{id:d.added.element.id,statusId:o.status.id,rank:pt(o.list,d.added.newIndex)}):"removed"in d||"moved"in d&&t("updateActivity",{id:d.moved.element.id,rank:pt(o.list,d.moved.newIndex)})},p=e.ref(!1);return(d,u)=>(e.openBlock(),e.createElementBlock("div",zh,[d.title||d.$slots.header?e.renderSlot(d.$slots,"header",{key:0},()=>{var m;return[e.createElementVNode("div",Zh,[d.title?(e.openBlock(),e.createBlock(Ah,{key:0,title:d.title,level:3,items:(m=d.list)==null?void 0:m.length},null,8,["title","items"])):e.createCommentVNode("",!0)])]}):e.createCommentVNode("",!0),e.createVNode(e.unref(xe),e.mergeProps({class:["ao-list-kanban__list",p.value?"ao-list-kanban__transition":void 0],list:d.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},d.$attrs,{draggable:".ao-list-draggable",disabled:!d.isEditable,onChange:c,onStart:u[1]||(u[1]=m=>p.value=!0),onEnd:u[2]||(u[2]=m=>p.value=!1),"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"}}),{item:e.withCtx(({element:m})=>{var f,h,y,v,b,_,g,C,B,$;return[e.createVNode($o,{class:e.normalizeClass(r(m)?"ao-list-draggable":""),id:m.id,name:m.name,"project-name":(f=m.project)==null?void 0:f.name,"project-id":(h=m.project)==null?void 0:h.id,"project-color":(y=m.project)==null?void 0:y.color,"phase-name":(b=(v=m.milestone)==null?void 0:v.phase)==null?void 0:b.name,"milestone-name":(_=m.milestone)==null?void 0:_.name,"milestone-color":(g=m.milestone)==null?void 0:g.color,deadline:m.deadline,rules:((C=m.rules)==null?void 0:C.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(B=m.comments)==null?void 0:B.length,attachments:($=m.attachments)==null?void 0:$.length,users:d.users,assignee:m.assignee,slug:m.slug,"is-editable":r(m),"is-private":m.private,"tag-type":d.tagType,onUpdateActivity:[N=>r(m)&&i(N),()=>r(m)&&i],onClick:()=>l(m.id),onRemoveAssignee:()=>r(m)&&i({id:m.id,assigneeId:null}),onStartTimer:u[0]||(u[0]=N=>d.$emit("startTimer",N))},{secondary:e.withCtx(()=>[r(m)&&m.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.archive"),onClick:e.withModifiers(()=>d.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),r(m)&&!m.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>d.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),_:2},1032,["class","id","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:e.withCtx(()=>[d.isLoading?(e.openBlock(),e.createElementBlock("div",xh,[e.createVNode(X,{name:"Loading"})])):d.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(e.openBlock(),e.createElementBlock("div",Wh,[d.noMoreLabel?(e.openBlock(),e.createElementBlock("span",qh,e.toDisplayString(d.noMoreLabel),1)):d.isEditable?(e.openBlock(),e.createElementBlock("span",Yh)):e.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),d.$slots.footer||d.footerLabel?(e.openBlock(),e.createElementBlock("div",Kh,[e.renderSlot(d.$slots,"footer",{},()=>[d.isEditable?(e.openBlock(),e.createBlock(We,{key:0,"icon-name":"AddBoxOutlineRounded",label:d.footerLabel,onClick:u[3]||(u[3]=m=>d.$emit("add"))},null,8,["label"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]))}});const Xh={class:"ao-field ao-search-field"},Qh=["value","placeholder","onKeypress"],Jh=e.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(a,{emit:t}){const o=a,n=async l=>{const c=l.target.value;t("update:modelValue",c,l)},s=Hh(n,o.delay),r=l=>{t("clear",l)};return(l,i)=>(e.openBlock(),e.createElementBlock("div",Xh,[e.createElementVNode("input",{value:l.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:l.placeholder,onInput:i[0]||(i[0]=(...c)=>e.unref(s)&&e.unref(s)(...c)),onKeypress:e.withKeys(n,["enter"])},null,40,Qh),e.createVNode(X,{name:"SearchRounded",class:e.normalizeClass(`ao-search-field__icon ao-search-field__action ${l.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),e.createVNode(K,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:e.normalizeClass(`ao-search-field__button ao-search-field__action ${l.modelValue?"ao-search-field__action--visible":""}`),onClick:r},null,8,["class"])]))}});const e9={class:"ao-feed"},t9={class:"ao-feed__filters"},a9={class:"ao-feed__body"},zn=e.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{}},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(a,{emit:t}){const o=a,{t:n}=Ye();function s(V,A){t("toast",V,A)}const r=e.toRef(o,"activities"),l=async(V,A)=>{await t("selectActivity",V,A)},i=e.ref({}),c=e.ref(!1),p=e.ref(!1),d=e.computed(()=>o.project?"milestone":"project");e.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([V,A,k,M],[F,R])=>{i.value=Object.fromEntries(V.map(T=>[T.id,A.filter(D=>{var J;return((J=D.status)==null?void 0:J.id)===T.id})])),k&&!c.value?(l(k,null),c.value=!0):M&&!c.value&&(l(null,M),c.value=!0),p.value&&Me(A,R)},{immediate:!0});const u=e.computed(()=>{var V;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((V=o.selectedActivity.milestone.phase)==null?void 0:V.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=V=>{var R,T;const A=(R=o.activities)==null?void 0:R.at(-1),k=A?se.LexoRank.parse(A.rank).genNext():se.LexoRank.middle(),M=((T=o.activities)==null?void 0:T.length)??0,F={name:n("activity.defaultName",{idx:M+1}),rank:k.format(),statusId:V.id};o.filters.assigneeId.length>0&&(F.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(F.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(F.typeId=o.filters.typeId[0]),p.value=!0,t("addActivity",F)},f=(V,A)=>{p.value=!1,t("update:filters",{...o.filters,[V]:A})},h=e.computed(()=>o.project?[o.project]:o.projects??[]),y=e.computed(()=>h.value.map(V=>({value:V.id,label:V.name}))),v=e.computed(()=>{var V;return(V=o.activityTypes)==null?void 0:V.map(A=>({value:A.id,label:A.name}))}),b=e.computed(()=>o.users.map(V=>({value:V.id,label:`${V.firstName} ${V.lastName}`,avatar:V.avatarUrl}))),_=V=>{o.selectedActivity&&t("update:activity",V)},g=V=>{t("update:activity",V)},C=V=>{t("archiveActivity",V)},B=V=>{t("unarchiveActivity",V)},$=V=>{var A;t("startTimer",V),(A=window.parent)==null||A.postMessage({type:"startTimer",data:V},"*")},N=V=>{p.value=!1,t("update:searchText",V)},O=V=>{p.value=!1,t("clear:searchText",V)},j=V=>{o.selectedActivity&&t("addSubtask",V)},z=V=>{o.selectedActivity&&t("updateSubtask",V)},x=V=>{o.selectedActivity&&t("deleteSubtask",V)},I=V=>{t("addFiles",V)},U=V=>{t("removeFile",V)},Y=V=>{o.selectedActivity&&t("addComment",{...V,activityId:o.selectedActivity.id})},W=V=>{const{id:A}=o.selectedActivity||{};A&&t("updateComment",V)},Z=V=>{const{id:A}=o.selectedActivity||{};A&&t("removeComment",V)},S=Rt.useRouter(),E=e.ref("feed"),P=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(E,V=>{V==="feed"?(S.push({name:oe.feed}),console.log("Navigating to feed...")):V==="overview"?(S.push({name:oe.project}),console.log("Navigating to feed...")):V==="mapping"&&(S.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(V,A)=>{var k;return e.openBlock(),e.createElementBlock("div",e9,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createElementVNode("div",t9,[e.createVNode(Na,{tabs:P,modelValue:E.value,"onUpdate:modelValue":A[0]||(A[0]=M=>E.value=M)},null,8,["modelValue"]),e.createVNode(Jh,{"model-value":V.searchText,placeholder:V.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":N,onClear:O},null,8,["model-value","placeholder"]),o.project?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie,{key:0,"model-value":V.filters[e.unref(Je).project],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:V.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":A[1]||(A[1]=M=>f(e.unref(Je).project,M))},null,8,["model-value","options","placeholder"])),v.value?(e.openBlock(),e.createBlock(ie,{key:1,"model-value":V.filters[e.unref(Je).type],mode:"tags",options:v.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:V.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":A[2]||(A[2]=M=>f(e.unref(Je).type,M))},null,8,["model-value","options","placeholder"])):e.createCommentVNode("",!0),b.value.length?(e.openBlock(),e.createBlock(ie,{key:2,"model-value":V.filters[e.unref(Je).assignee],mode:"tags",options:b.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:V.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":A[3]||(A[3]=M=>f(e.unref(Je).assignee,M))},{tag:e.withCtx(({option:M,handleTagRemove:F})=>[e.createVNode(ke,{"user-name":M.label,"avatar-url":M.avatar,"is-closable":!0,onClose:R=>F(M,R)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):e.createCommentVNode("",!0)]),e.createVNode(K,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":V.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":V.showsOnlyNonAssigned,onClick:A[4]||(A[4]=M=>V.$emit("update:showsOnlyNonAssigned",!V.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__only-important",size:"sm","icon-name":V.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":V.showsOnlyImportant,onClick:A[5]||(A[5]=M=>V.$emit("update:showsOnlyImportant",!V.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":V.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":V.showsArchivedActivities,onClick:A[6]||(A[6]=M=>V.$emit("update:showsArchivedActivities",!V.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),e.createElementVNode("div",a9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.statuses,M=>(e.openBlock(),e.createBlock(Gh,{key:M.id,status:M,list:i.value[M.id],title:M.name,"footer-label":V.$t("feed.activity.add"),users:V.users,"user-id":V.userId,"is-editable":V.isEditable,tagType:d.value,onAdd:()=>m(M),onSelectActivity:l,onArchiveActivity:C,onUnarchiveActivity:B,onUpdateActivity:g,onStartTimer:$},null,8,["status","list","title","footer-label","users","user-id","is-editable","tagType","onAdd"]))),128))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[V.selectedActivity?(e.openBlock(),e.createBlock(mo,{key:0,activity:V.selectedActivity,"activity-types":V.activityTypes,"milestone-id":(k=V.selectedActivity.milestone)==null?void 0:k.id,"template-activities":r.value,users:V.users,"user-id":V.userId,"is-task-checkable":V.isTaskCheckable,statuses:V.statuses,breadcrumbs:u.value,"is-editable":V.isEditable,"attachment-enabled":V.attachmentEnabled,projects:h.value,"time-tracking-data":V.timeTrackingData,onClose:A[7]||(A[7]=()=>l(null,null)),"onUpdate:activity":_,onAddSubtask:j,onUpdateSubtask:z,onDeleteSubtask:x,onAddFiles:I,onRemoveFile:U,onAddComment:Y,onUpdateComment:W,onRemoveComment:Z,onToast:s},{default:e.withCtx(M=>[e.renderSlot(V.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(M)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data"])):e.createCommentVNode("",!0)]))])}}});const o9={class:"ao-project-mapping"},n9={class:"ao-project-mapping-mapping__body"},s9={class:"ao-project-mapping-mapping__phases"},l9={key:0,class:"ao-project-mapping-mapping__image-wrapper"},r9=["src","alt"],i9=e.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(a,{emit:t}){const o=a,{t:n}=Ye(),s=()=>{const{name:v,rank:b}=ot(o.phases,"phase",n);t("addPhase",{name:v,rank:b,projectId:o.project.id})},r=v=>{t("updatePhase",v)},l=v=>{t("archivePhase",v)},i=v=>{t("unarchivePhase",v)},c=v=>{t("copyPhaseToTemplate",v)},p=e.ref(!1),d=e.ref(!1),u=(v,b)=>{t("applyTemplate",{templateId:v,projectId:b}),p.value=!1},m=(v,b)=>{var C;const _=(C=o.templates)==null?void 0:C.at(-1),g=_?se.LexoRank.parse(_.rank).genNext():se.LexoRank.middle();t("saveTemplate",{templateName:v,rank:g.format(),phaseIds:b}),d.value=!1},f=Rt.useRouter(),h=e.ref("mapping"),y=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(h,v=>{v==="feed"?(f.push({name:oe.feed}),console.log("Navigating to feed...")):v==="overview"?(f.push({name:oe.project}),console.log("Navigating to feed...")):v==="mapping"&&(f.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(v,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-mapping-overview"},v.$attrs),[e.createElementVNode("div",o9,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createVNode(Na,{modelValue:h.value,"onUpdate:modelValue":b[0]||(b[0]=_=>h.value=_),tabs:y},null,8,["modelValue"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":v.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":v.showsArchived,onClick:b[1]||(b[1]=_=>v.$emit("update:showsArchived",!v.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[v.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:0,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:v.$t("project.template.save.label"),onClick:b[2]||(b[2]=_=>d.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),v.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:1,class:"ao-project-mapping-overview__add-template",color:"primary",label:v.$t("project.template.apply.label"),onClick:b[3]||(b[3]=_=>p.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",n9,[e.createElementVNode("div",s9,[e.createVNode(wo,{phases:v.phases,"closed-status":v.closedStatus,"is-editable":v.isEditable===!0,users:v.users,onAddPhase:s,onUpdatePhase:r,onArchivePhase:l,onUnarchivePhase:i,onCopyPhaseToTemplate:c},null,8,["phases","closed-status","is-editable","users"])]),v.project.architectureImage?(e.openBlock(),e.createElementBlock("div",l9,[e.createElementVNode("img",{class:"architecture-image",src:v.project.architectureImage.url,alt:e.unref(n)("architectureImage.alt")},null,8,r9)])):e.createCommentVNode("",!0)])])],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?(e.openBlock(),e.createBlock(Fn,{key:0,phases:v.phases,onClose:b[4]||(b[4]=_=>d.value=!1),onSave:m},null,8,["phases"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(Un,{key:1,"project-id":v.project.id,templates:v.templates,onClose:b[5]||(b[5]=_=>p.value=!1),onApply:u},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64))}});const tt={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},c9=(a,t={})=>[{path:a,name:tt.TEMPLATES,redirect:{name:tt.TEMPLATES_LIST},...t,children:[{path:"",name:tt.TEMPLATES_LIST,component:Zn},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:tt.TEMPLATE_DETAILS,component:jn,props:!0}]}],oe={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},d9=(a,t={})=>[{path:a,...t,redirect:{name:oe.project},children:[{path:"",name:oe.project,component:Yv,props:!0,children:[{path:":phaseId/:milestoneId",name:oe.milestone,component:Qo,props:!0},{path:":phaseId/:milestoneId/:activityId",name:oe.activity,props:{default:!0,modal:!0},components:{default:Qo,modal:Mh}}]},{path:"feed",name:oe.feed,component:zn,props:!0},{path:"mapping",name:oe.mapping,component:i9,props:!0}]}],u9={class:"ao-templates"},Zn=e.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(a,{emit:t}){const o=a,{t:n}=Ye();e.watch(()=>o.templates,(c,p)=>{Me(c,p)});const s=()=>{var m,f;const c=(m=o.templates)==null?void 0:m.at(-1),p=c?se.LexoRank.parse(c.rank).genNext():se.LexoRank.middle(),d=((f=o.templates)==null?void 0:f.length)??0,u={name:n("template.defaultName.template",{idx:d+1}),rank:p.format()};t("addTemplate",u)},r=(c,p)=>{t("updateItem",{itemType:ee.TEMPLATES,id:c,templateId:c,data:{name:p}})},l=(c,p)=>{t("removeItem",{itemType:ee.TEMPLATES,templateId:c,data:{id:c,...p?{name:p}:{}}})},i=c=>{if(c.moved){const p=zt(c,o.templates??[]);t("updateItem",{itemType:ee.TEMPLATES,id:c.moved.element.id,templateId:c.moved.element.id,data:{rank:p}})}};return(c,p)=>(e.openBlock(),e.createElementBlock("div",u9,[e.createVNode(Zt,null,{secondary:e.withCtx(()=>[e.createVNode(K,{label:c.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),e.createVNode(e.unref(xe),{"model-value":c.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:i},{item:e.withCtx(({element:d})=>{var u;return[e.createVNode(B3,{id:d.id,title:d.name,phases:d.phases,milestones:(u=d.phases)!=null&&u.length?e.unref(K0)(d.phases):0,activities:d.phases?e.unref(G0)(d.phases):0,"updated-at":d.updatedAt,"updated-by":d.updatedBy,onUpdateTitle:m=>r(d.id,m),onClick:m=>c.$router.push({name:e.unref(tt).TEMPLATE_DETAILS,params:{templateId:d.id}}),onDeleteItem:p[0]||(p[0]=(m,f)=>l(m,f))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const p9={class:"ao-field__label"},xn=e.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[e.createElementVNode("span",p9,e.toDisplayString(t.label),1),e.renderSlot(t.$slots,"default")],2))}}),m9=["type","value","disabled","readonly"],f9=e.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(a,{emit:t}){const o=a,n=e.computed(()=>o.modelModifiers.lazy?"change":"input"),s=r=>{o.modelModifiers.number&&(r=Number(r)),t("update:modelValue",r)};return(r,l)=>(e.openBlock(),e.createBlock(xn,{label:r.label},{default:e.withCtx(()=>[e.createElementVNode("input",e.mergeProps({class:"ao-field__input",type:r.type,value:r.modelValue,disabled:r.isDisabled,readonly:r.isReadonly},{[e.toHandlerKey(n.value)]:l[0]||(l[0]=i=>s(i.target.value))}),null,16,m9)]),_:1},8,["label"]))}}),v9={class:"ao-field"},h9={class:"ao-field__label"},C9=["checked","disabled"],g9=e.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(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",v9,[e.createElementVNode("span",h9,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:o[0]||(o[0]=n=>{var s;return t.$emit("update:modelValue",((s=n.target)==null?void 0:s.checked)??!1)})},null,40,C9)]))}});exports.AoAvatar=ke;exports.AoCardFeed=$o;exports.AoCheckboxField=g9;exports.AoFeed=zn;exports.AoField=xn;exports.AoInputField=f9;exports.AoMultiselect=ie;exports.AoProjectPhases=wo;exports.AoTabBar=Na;exports.AoTemplateDetails=jn;exports.AoTemplates=cs;exports.AoTemplatesList=Zn;exports.TemplateItemTypeEnum=sn;exports.activityFeedStatus=d2;exports.durationTypes=c2;exports.feedFilterTypes=Je;exports.getProjectOverviewRoutes=d9;exports.getTemplateRoutes=c9;exports.listUpdateTypes=u2;exports.milestoneStatus=Ot;exports.projectOverviewRoutes=oe;exports.ruleComparators=an;exports.ruleDurationUnits=nn;exports.ruleTriggerTypes=on;exports.templateItemType=ee;exports.templateRouteNames=tt;
5
+ */function Qe(a){let t={r:0,g:0,b:0,a:1};/#/.test(a)?t=pf(a):/rgb/.test(a)?t=Xo(a):typeof a=="string"?t=Xo(`rgba(${a})`):Object.prototype.toString.call(a)==="[object Object]"&&(t=a);const{r:o,g:n,b:s,a:r}=t,{h:l,s:i,v:c}=mf(t);return{r:o,g:n,b:s,a:r===void 0?1:r,h:l,s:i,v:c}}function fo(a){const t=document.createElement("canvas"),o=t.getContext("2d"),n=a*2;return t.width=n,t.height=n,o.fillStyle="#ffffff",o.fillRect(0,0,n,n),o.fillStyle="#ccd5db",o.fillRect(0,0,a,a),o.fillRect(a,a,a,a),t}function Ka(a,t,o,n,s,r){const l=a==="l",i=t.createLinearGradient(0,0,l?o:0,l?0:n);i.addColorStop(.01,s),i.addColorStop(.99,r),t.fillStyle=i,t.fillRect(0,0,o,n)}function uf({r:a,g:t,b:o},n){const s=l=>("0"+Number(l).toString(16)).slice(-2),r=`#${s(a)}${s(t)}${s(o)}`;return n?r.toUpperCase():r}function pf(a){a=a.slice(1);const t=o=>parseInt(o,16)||0;return{r:t(a.slice(0,2)),g:t(a.slice(2,4)),b:t(a.slice(4,6))}}function Xo(a){return typeof a=="string"?(a=(/rgba?\((.*?)\)/.exec(a)||["","0,0,0,1"])[1].split(","),{r:Number(a[0])||0,g:Number(a[1])||0,b:Number(a[2])||0,a:Number(a[3]?a[3]:1)}):a}function mf({r:a,g:t,b:o}){a=a/255,t=t/255,o=o/255;const n=Math.max(a,t,o),s=Math.min(a,t,o),r=n-s;let l=0;n===s?l=0:n===a?t>=o?l=60*(t-o)/r:l=60*(t-o)/r+360:n===t?l=60*(o-a)/r+120:n===o&&(l=60*(a-t)/r+240),l=Math.floor(l);let i=parseFloat((n===0?0:1-s/n).toFixed(2)),c=parseFloat(n.toFixed(2));return{h:l,s:i,v:c}}var vo=e.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 a=this.$refs.canvasSaturation,t=this.size,o=a.getContext("2d");a.width=t,a.height=t,o.fillStyle=this.color,o.fillRect(0,0,t,t),Ka("l",o,t,t,"#FFFFFF","rgba(255,255,255,0)"),Ka("p",o,t,t,"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(a){const{top:t,left:o}=this.$el.getBoundingClientRect(),n=a.target.getContext("2d"),s=l=>{let i=l.clientX-o,c=l.clientY-t;i<0&&(i=0),c<0&&(c=0),i>this.size&&(i=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:i-5+"px",top:c-5+"px"};const p=n.getImageData(Math.min(i,this.size-1),Math.min(c,this.size-1),1,1),[d,u,m]=p.data;this.$emit("selectSaturation",{r:d,g:u,b:m})};s(a);const r=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}}});const ff={ref:"canvasSaturation"};function vf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",{class:"saturation",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectSaturation&&a.selectSaturation(...l),["prevent","stop"]))},[e.createVNode("canvas",ff,null,512),e.createVNode("div",{style:a.slideSaturationStyle,class:"slide"},null,4)],32)}vo.render=vf;vo.__file="src/color/Saturation.vue";var ho=e.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 a=this.$refs.canvasHue,t=this.width,o=this.height,n=a.getContext("2d");a.width=t,a.height=o;const s=n.createLinearGradient(0,0,0,o);s.addColorStop(0,"#FF0000"),s.addColorStop(.17*1,"#FF00FF"),s.addColorStop(.17*2,"#0000FF"),s.addColorStop(.17*3,"#00FFFF"),s.addColorStop(.17*4,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),n.fillStyle=s,n.fillRect(0,0,t,o)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(a){const{top:t}=this.$el.getBoundingClientRect(),o=a.target.getContext("2d"),n=r=>{let l=r.clientY-t;l<0&&(l=0),l>this.height&&(l=this.height),this.slideHueStyle={top:l-2+"px"};const i=o.getImageData(0,Math.min(l,this.height-1),1,1),[c,p,d]=i.data;this.$emit("selectHue",{r:c,g:p,b:d})};n(a);const s=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",s)}}});const hf={ref:"canvasHue"};function Cf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",{class:"hue",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectHue&&a.selectHue(...l),["prevent","stop"]))},[e.createVNode("canvas",hf,null,512),e.createVNode("div",{style:a.slideHueStyle,class:"slide"},null,4)],32)}ho.render=Cf;ho.__file="src/color/Hue.vue";var Co=e.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 a=this.$refs.canvasAlpha,t=this.width,o=this.height,n=this.alphaSize,s=fo(n),r=a.getContext("2d");a.width=t,a.height=o,r.fillStyle=r.createPattern(s,"repeat"),r.fillRect(0,0,t,o),Ka("p",r,t,o,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(a){const{top:t}=this.$el.getBoundingClientRect(),o=s=>{let r=s.clientY-t;r<0&&(r=0),r>this.height&&(r=this.height);let l=parseFloat((r/this.height).toFixed(2));this.$emit("selectAlpha",l)};o(a);const n=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",n)}}});const gf={ref:"canvasAlpha"};function _f(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",{class:"color-alpha",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectAlpha&&a.selectAlpha(...l),["prevent","stop"]))},[e.createVNode("canvas",gf,null,512),e.createVNode("div",{style:a.slideAlphaStyle,class:"slide"},null,4)],32)}Co.render=_f;Co.__file="src/color/Alpha.vue";var go=e.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 a=this.$el,t=this.width,o=this.height,n=this.alphaSize,s=fo(n),r=a.getContext("2d");a.width=t,a.height=o,r.fillStyle=r.createPattern(s,"repeat"),r.fillRect(0,0,t,o),r.fillStyle=this.color,r.fillRect(0,0,t,o)}}});function yf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("canvas")}go.render=yf;go.__file="src/color/Preview.vue";var _o=e.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(a){this.isSucking=!1,this.suckColor(a)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(a){a.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(a){const{clientX:t,clientY:o}=a,{top:n,left:s,width:r,height:l}=this.suckerCanvas.getBoundingClientRect(),i=t-s,c=o-n,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(i,r-1),Math.min(c,l-1),1,1);let[u,m,f,h]=d.data;h=parseFloat((h/255).toFixed(2));const y=this.suckerPreview.style;Object.assign(y,{position:"absolute",left:t+20+"px",top:o-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(${u}, ${m}, ${f}, ${h})`,zIndex:95}),this.suckerArea.length&&t>=this.suckerArea[0]&&o>=this.suckerArea[1]&&t<=this.suckerArea[2]&&o<=this.suckerArea[3]?y.display="":y.display="none"},suckColor(a){a&&a.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),a.addEventListener("click",t=>{const{clientX:o,clientY:n}=t,{top:s,left:r,width:l,height:i}=a.getBoundingClientRect(),c=o-r,p=n-s,u=a.getContext("2d").getImageData(Math.min(c,l-1),Math.min(p,i-1),1,1);let[m,f,h,y]=u.data;y=parseFloat((y/255).toFixed(2)),this.$emit("selectSucker",{r:m,g:f,b:h,a:y})}))}}});const bf=e.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),kf={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},wf=e.createVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[e.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),e.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[e.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function $f(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",null,[a.isSucking?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock("svg",{key:0,class:[{active:a.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:t[1]||(t[1]=(...l)=>a.openSucker&&a.openSucker(...l))},[bf],2)),a.isSucking?(e.openBlock(),e.createBlock("svg",kf,[wf])):e.createCommentVNode("v-if",!0)])}_o.render=$f;_o.__file="src/color/Sucker.vue";var yo=e.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(a,{emit:t}){return{modelColor:e.computed({get(){return a.color||""},set(r){t("inputColor",r)}}),handleFocus:r=>{t("inputFocus",r)},handleBlur:r=>{t("inputBlur",r)}}}});const Ef={class:"color-type"},Bf={class:"name"};function Vf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",Ef,[e.createVNode("span",Bf,e.toDisplayString(a.name),1),e.withDirectives(e.createVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=l=>a.modelColor=l),class:"value",onFocus:t[2]||(t[2]=(...l)=>a.handleFocus&&a.handleFocus(...l)),onBlur:t[3]||(t[3]=(...l)=>a.handleBlur&&a.handleBlur(...l))},null,544),[[e.vModelText,a.modelColor]])])}yo.render=Vf;yo.__file="src/color/Box.vue";var bo=e.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(a,{emit:t}){const o=e.ref(),n=e.ref([]),s=e.ref();a.colorsHistoryKey&&localStorage&&(n.value=JSON.parse(localStorage.getItem(a.colorsHistoryKey))||[]),s.value=fo(4).toDataURL(),e.onUnmounted(()=>{r(o.value)});function r(i){if(!i)return;const c=n.value||[],p=c.indexOf(i);p>=0&&c.splice(p,1),c.length>=8&&(c.length=7),c.unshift(i),n.value=c||[],localStorage&&a.colorsHistoryKey&&localStorage.setItem(a.colorsHistoryKey,JSON.stringify(c))}function l(i){t("selectColor",i)}return{setColorsHistory:r,colorsHistory:n,color:o,imgAlphaBase64:s,selectColor:l}}});const Sf={class:"colors"},Nf={key:0,class:"colors history"};function Mf(a,t,o,n,s,r){return e.openBlock(),e.createBlock("div",null,[e.createVNode("ul",Sf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsDefault,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:i=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))]),a.colorsHistory.length?(e.openBlock(),e.createBlock("ul",Nf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsHistory,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:i=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))])):e.createCommentVNode("v-if",!0)])}bo.render=Mf;bo.__file="src/color/Colors.vue";var ut=e.defineComponent({components:{Saturation:vo,Hue:ho,Alpha:Co,Preview:go,Sucker:_o,Box:yo,Colors:bo},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 uf(this.rgba,!0)}},created(){Object.assign(this,Qe(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(a){const{r:t,g:o,b:n,h:s,s:r,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:r,v:l}),this.setText()},handleFocus(a){this.$emit("inputFocus",a)},handleBlur(a){this.$emit("inputBlur",a)},selectHue(a){const{r:t,g:o,b:n,h:s,s:r,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:r,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(a){this.a=a,this.setText()},inputHex(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.modelHex=a,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.modelHex=this.hexString,this.modelRgba=a,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(a){this.$emit("openSucker",a)},selectSucker(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(a){const{r:t,g:o,b:n,a:s,h:r,s:l,v:i}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:r,s:l,v:i}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Tf={class:"color-set"};function Af(a,t,o,n,s,r){const l=e.resolveComponent("Saturation"),i=e.resolveComponent("Hue"),c=e.resolveComponent("Alpha"),p=e.resolveComponent("Preview"),d=e.resolveComponent("Sucker"),u=e.resolveComponent("Box"),m=e.resolveComponent("Colors");return e.openBlock(),e.createBlock("div",{class:["hu-color-picker",{light:a.isLightTheme}],style:{width:a.totalWidth+"px"}},[e.createVNode("div",Tf,[e.createVNode(l,{ref:"saturation",color:a.rgbString,hsv:a.hsv,size:a.hueHeight,onSelectSaturation:a.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),e.createVNode(i,{ref:"hue",hsv:a.hsv,width:a.hueWidth,height:a.hueHeight,onSelectHue:a.selectHue},null,8,["hsv","width","height","onSelectHue"]),e.createVNode(c,{ref:"alpha",color:a.rgbString,rgba:a.rgba,width:a.hueWidth,height:a.hueHeight,onSelectAlpha:a.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),e.createVNode("div",{style:{height:a.previewHeight+"px"},class:"color-show"},[e.createVNode(p,{color:a.rgbaString,width:a.previewWidth,height:a.previewHeight},null,8,["color","width","height"]),a.suckerHide?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(d,{key:0,"sucker-canvas":a.suckerCanvas,"sucker-area":a.suckerArea,onOpenSucker:a.openSucker,onSelectSucker:a.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),e.createVNode(u,{name:"HEX",color:a.modelHex,onInputColor:a.inputHex,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(u,{name:"RGBA",color:a.modelRgba,onInputColor:a.inputRgba,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(m,{color:a.rgbaString,"colors-default":a.colorsDefault,"colors-history-key":a.colorsHistoryKey,onSelectColor:a.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),e.createCommentVNode(" custom options "),e.renderSlot(a.$slots,"default")],6)}ut.render=Af;ut.__file="src/color/ColorPicker.vue";ut.install=a=>{a.component(ut.name,ut)};const Of={class:"color-picker-wrapper"},ko=e.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(a,{emit:t}){const o=a,n=e.ref(!1),s=e.ref(null),r=e.ref(null),l=e.ref(0),i=e.ref(0),c=async f=>{r.value=f,n.value=!0,await e.nextTick();const h=f.getBoundingClientRect(),y=s.value,v=(y==null?void 0:y.offsetHeight)||300,b=window.innerHeight-h.bottom,_=h.top,g=b<v&&_>v;console.log("pickerHeight = "+v),l.value=g?h.top-v-8:h.bottom+8,i.value=h.left,setTimeout(()=>{window.addEventListener("click",d)},0)},p=e.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${i.value}px`,zIndex:1e3})),d=f=>{const h=f.target;s.value&&!s.value.contains(h)&&(n.value=!1,t("update:color",u.value),window.removeEventListener("click",d))};e.onBeforeUnmount(()=>{window.removeEventListener("click",d)}),e.watch(()=>o.color,f=>{n.value||(u.value=f)});const u=e.ref(o.color),m=f=>{const{r:h,g:y,b:v,a:b}=f.rgba;u.value=`rgba(${h}, ${y}, ${v}, ${b})`};return(f,h)=>(e.openBlock(),e.createElementBlock("div",Of,[e.renderSlot(f.$slots,"clickable",{openPicker:c,bgColor:f.color}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:e.normalizeStyle(p.value)},[e.createVNode(e.unref(ut),{class:"color-picker-box",theme:"light",color:f.color,onChangeColor:m},null,8,["color"])],4)):e.createCommentVNode("",!0)]))}});const If={class:"ao-card-project-phase__header"},Lf={class:"ao-card-project-item__title-line"},Df={key:0,class:"ao-card-project-item-phase__estimation"},Pf={class:"ao-card-project-phase__footer"},Hf={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},Rf={class:"ao-card-project-phase__subitem"},jf={class:"ao-card-project-phase__subitem"},Uf={key:0,class:"ao-card-project-phase__secondary"},Ff={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},zf=e.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(a,{emit:t}){const o=a,n=u=>{t("update:title",u)},s=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.reduce((m,f)=>{var h;return m+((h=f.activities)==null?void 0:h.reduce((y,v)=>y+(v.estimation||0),0))},0)}),r=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.length}),l=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.filter(m=>m.status===Ot.done).length}),i=e.computed(()=>(l.value||0)/(r.value||1)),c=e.computed({get:()=>o.deadline??"",set:u=>t("update:deadline",u!=null&&u.length?u:null)}),p=e.computed({get:()=>o.color,set:u=>{t("updatePhase",{id:o.id,color:u})}}),d=(u,m)=>{const f=u.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m(f)};return(u,m)=>(e.openBlock(),e.createBlock(ko,{color:p.value,"onUpdate:color":m[2]||(m[2]=f=>p.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:h})=>[e.createVNode(Va,{class:"ao-card-project-phase","is-clickable":u.isEditable,color:h,withLeftBorder:!0,onClick:y=>d(y,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Lf,[e.createVNode(ne,{id:u.id,class:"ao-card-project-phase__title",title:u.name||"",level:4,"is-editable":u.isEditable,"onUpdate:title":n},null,8,["id","title","is-editable"]),s.value?(e.openBlock(),e.createElementBlock("span",Df," ("+e.toDisplayString(s.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",Pf,[r.value?(e.openBlock(),e.createElementBlock("div",Hf,[e.createElementVNode("div",Rf,[e.createVNode(X,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",jf,e.toDisplayString(l.value)+" / "+e.toDisplayString(r.value),1)]),e.createVNode(Sa,{percentages:i.value,class:"ao-card-project-phase__progress",color:u.color},null,8,["percentages","color"]),u.$slots.secondary?(e.openBlock(),e.createElementBlock("div",Uf,[e.renderSlot(u.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-card-project-phase__footer-row",c.value?"":"ao-card-project-phase__no_deadline"])},[u.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=y=>c.value=y),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",Ff,e.toDisplayString(e.unref(_a)(u.deadline)),1)],2)])]),_:2},[u.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",If,[e.createVNode(K,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:u.active?u.$t("archive"):u.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>u.active?u.$emit("archivePhase",{id:u.id}):u.$emit("unarchivePhase",{id:u.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Zf=e.defineComponent({__name:"AoBadge",props:{color:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("span",{class:"aoBadge",style:e.normalizeStyle({backgroundColor:t.color})},null,4))}});const xf={class:"ao-card-project-milestone__default"},Wf={class:"ao-title-with-badge-wrapper"},qf={class:"ao-card-project-item__title-line"},Yf={key:0,class:"ao-card-project-item-milestone__estimation"},Kf={key:0,class:"ao-card-project-milestone__archive"},Gf={class:"ao-card-project-milestone__activities"},Xf={class:"ao-card-project-milestone__activities-row"},Qf={class:"ao-card-project-milestone__subitem"},Jf={class:"ao-card-project-milestone__subitem"},ev={key:1,class:"ao-card-project-milestone__secondary"},tv={class:"ao-card-project-milestone__footer"},av={key:1,class:"ao-field ao-card-project-milestone__deadline"},ov={class:"ao-field__label"},nv={key:2,class:"ao-card-project-milestone__assignee"},sv=e.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}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(a,{emit:t}){const o=a,n=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.reduce((p,d)=>p+(d.estimation||0),0)}),s=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.length}),r=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.filter(p=>Ja(p,o.closedStatus)).length}),l=e.computed(()=>(r.value||0)/(s.value||1)),i=c=>{t("updateMilestone",{id:o.id,name:c})};return(c,p)=>(e.openBlock(),e.createBlock(Va,{class:e.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!c.readonly,"tag-name":"li","is-selected":c.isSelected,color:c.phaseColor},{default:e.withCtx(()=>[e.createElementVNode("div",xf,[e.createElementVNode("div",Wf,[e.createVNode(Zf,{color:c.color||""},null,8,["color"]),e.createElementVNode("div",qf,[e.createVNode(ne,{id:c.id,title:c.name||"",level:5,"is-editable":!c.readonly&&c.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":i},null,8,["id","title","is-editable"]),n.value?(e.openBlock(),e.createElementBlock("span",Yf," ("+e.toDisplayString(n.value)+")",1)):e.createCommentVNode("",!0)])]),!c.readonly&&c.isEditable?(e.openBlock(),e.createElementBlock("div",Kf,[e.createVNode(K,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:c.active?c.$t("archive"):c.$t("unarchive"),onClick:p[0]||(p[0]=e.withModifiers(()=>c.active?c.$emit("archiveMilestone",{id:c.id}):c.$emit("unarchiveMilestone",{id:c.id}),["stop"]))},null,8,["label"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gf,[e.createElementVNode("div",Xf,[s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Qf,[e.createVNode(X,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",Jf,e.toDisplayString(r.value)+" / "+e.toDisplayString(s.value),1)]),e.createVNode(Sa,{percentages:l.value,color:c.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):e.createCommentVNode("",!0),c.$slots.secondary?(e.openBlock(),e.createElementBlock("div",ev,[e.renderSlot(c.$slots,"secondary")])):e.createCommentVNode("",!0)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",tv,[c.important?(e.openBlock(),e.createBlock(X,{key:0,name:"FlagRounded",class:e.normalizeClass(c.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):e.createCommentVNode("",!0),c.deadline?(e.openBlock(),e.createElementBlock("label",av,[e.createElementVNode("span",ov,e.toDisplayString(e.unref(_a)(c.deadline)),1)])):e.createCommentVNode("",!0),c.assignee?(e.openBlock(),e.createElementBlock("div",nv,[e.createVNode(ke,{"user-name":e.unref(bn)(c.assignee),"avatar-url":c.assignee.avatarUrl,color:c.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):e.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const lv={class:"ao-mapping-card-project-phase__header"},rv={class:"ao-card-project-item__title-line"},iv={key:0,class:"ao-card-project-item-phase__estimation"},cv={class:"ao-mapping-card-project-phase__footer"},dv={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},uv={class:"ao-mapping-card-project-phase__subitem"},pv={class:"ao-mapping-card-project-phase__subitem"},mv={key:0,class:"ao-mapping-card-project-phase__secondary"},fv={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},vv=e.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,n=u=>{t("update:title",u)},s=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.reduce((m,f)=>{var h;return m+((h=f.activities)==null?void 0:h.reduce((y,v)=>y+(v.estimation||0),0))},0)}),r=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.length}),l=e.computed(()=>{var u;return(u=o.milestones)==null?void 0:u.filter(m=>m.status===Ot.done).length}),i=e.computed(()=>(l.value||0)/(r.value||1)),c=e.computed({get:()=>o.deadline??"",set:u=>t("update:deadline",u!=null&&u.length?u:null)}),p=e.computed({get:()=>o.color,set:u=>{t("updatePhase",{id:o.id,color:u})}}),d=(u,m)=>{const f=u.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m()};return(u,m)=>(e.openBlock(),e.createBlock(ko,{color:p.value,"onUpdate:color":m[2]||(m[2]=f=>p.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:h})=>[e.createVNode(Va,{class:"ao-mapping-card-project-phase","is-clickable":u.isEditable,color:h,withLeftBorder:!0,onClick:y=>d(y,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",rv,[e.createVNode(ne,{id:u.id,class:"ao-mapping-card-project-phase__title",title:u.name||"",level:4,"is-editable":u.isEditable,"onUpdate:title":n},null,8,["id","title","is-editable"]),s.value?(e.openBlock(),e.createElementBlock("span",iv," ("+e.toDisplayString(s.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",cv,[r.value?(e.openBlock(),e.createElementBlock("div",dv,[e.createElementVNode("div",uv,[e.createVNode(X,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",pv,e.toDisplayString(l.value)+" / "+e.toDisplayString(r.value),1)]),e.createVNode(Sa,{percentages:i.value,class:"ao-mapping-card-project-phase__progress",color:p.value},null,8,["percentages","color"]),u.$slots.secondary?(e.openBlock(),e.createElementBlock("div",mv,[e.renderSlot(u.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-mapping-card-project-phase__footer-row",c.value?"":"ao-mapping-card-project-phase__no_deadline"])},[u.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=y=>c.value=y),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",fv,e.toDisplayString(e.unref(_a)(u.deadline)),1)],2)])]),_:2},[u.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",lv,[e.createVNode(K,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:u.active?u.$t("archive"):u.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>u.active?u.$emit("archivePhase",{id:u.id}):u.$emit("unarchivePhase",{id:u.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const hv={class:"ao-project-phase"},Cv={key:0,class:"ao-project-phase__drag ao-card__drag"},gv={key:1,class:"ao-project-phase__col-phase"},_v={key:2,class:"ao-mapping-project-phase__col-phase"},yv={key:0,class:"ao-project-phase__col-milestones"},bv={class:"ao-project-phase__milestones-list-footer"},kv=e.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,{t:n}=Ye();e.watch(()=>o.phase.milestones,(_,g)=>{Me(_,g)});const s=_=>{t("updatePhase",{id:o.phase.id,name:_})},r=_=>{t("updatePhase",{id:o.phase.id,deadline:_})},l=_=>{t("updatePhase",_)},i=e.computed(()=>o.phase.milestones.map(_=>J0(_,o.closedStatus))),c=_=>{const{name:g,rank:C}=ot(i.value??[],"milestone",n);t("addMilestone",{name:g,rank:C,phaseId:_})},p=_=>{t("updateMilestone",_)},d=_=>{t("archiveMilestone",_)},u=_=>{t("unarchiveMilestone",_)},m=_=>{t("archivePhase",_)},f=_=>{t("unarchivePhase",_)},h=_=>{"added"in _?t("updateMilestone",{id:_.added.element.id,phaseId:o.phase.id,rank:pt(i.value,_.added.newIndex)}):"removed"in _||"moved"in _&&t("updateMilestone",{id:_.moved.element.id,rank:pt(i.value,_.moved.newIndex)})},y=Rt.useRoute(),v=e.computed(()=>y.path.includes("/mapping")),b=e.computed(()=>{var _;return o.phase.id!==((_=y.params)==null?void 0:_.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:t3(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(_,g)=>(e.openBlock(),e.createElementBlock("li",hv,[e.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:e.normalizeStyle(b.value)},[_.isEditable?(e.openBlock(),e.createElementBlock("div",Cv,[e.createVNode(X,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("div",_v,[e.createVNode(vv,{id:_.phase.id,milestones:i.value,name:_.phase.name,deadline:_.phase.deadline,active:_.phase.active,"is-editable":_.isEditable,color:_.phase.color,"onUpdate:deadline":r,"onUpdate:title":s,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color"])])):(e.openBlock(),e.createElementBlock("div",gv,[e.createVNode(zf,{id:_.phase.id,milestones:i.value,name:_.phase.name,deadline:_.phase.deadline,active:_.phase.active,"is-editable":_.isEditable,color:_.phase.color,"onUpdate:deadline":r,"onUpdate:title":s,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color"])]))],4),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yv,[e.createElementVNode("div",{class:"ao-project-phase__milestones",style:e.normalizeStyle(b.value)},[e.createVNode(e.unref(xe),e.mergeProps({class:"ao-project-phase__milestones-list",list:i.value,disabled:_.readonly||!_.isEditable,"item-key":"id",group:"kanban"},_.$attrs,{onChange:h}),{item:e.withCtx(({element:C})=>{var B;return[e.createVNode(sv,{id:C.id,name:C.name,color:C.color,"phase-color":_.phase.color,activities:C.activities,deadline:C.deadline,active:C.active,"is-editable":!_.readonly&&_.isEditable,"is-draggable":!_.readonly&&_.isEditable,"closed-status":_.closedStatus,"is-selected":C.id===((B=_.$route.params)==null?void 0:B.milestoneId),assignee:C.assignee,important:C.important,readonly:_.readonly,class:e.normalizeClass(["ao-project-phase__milestone"]),onClick:$=>!_.readonly&&_.$router.push({name:e.unref(oe).milestone,params:{phaseId:_.phase.id,milestoneId:C.id}}),onUpdateMilestone:p,onArchiveMilestone:d,onUnarchiveMilestone:u},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","onClick"])]}),_:1},16,["list","disabled"]),e.createElementVNode("div",bv,[_.isEditable?(e.openBlock(),e.createBlock(We,{key:0,label:_.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:g[0]||(g[0]=()=>c(_.phase.id))},null,8,["label"])):e.createCommentVNode("",!0)])],4)]))]))}});const wv={class:"ao-project__phases"},$v={key:0,class:"ao-project-phase__phases-list-footer"},Ev=e.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1),Bv={class:"ao-project-phase__col-phase"},Vv=e.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1),wo=e.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a;e.watch(()=>o.phases,(m,f)=>{Me(m,f)});const n=m=>{t("addMilestone",m)},s=m=>{t("updateMilestone",m)},r=m=>{t("archiveMilestone",m)},l=m=>{t("unarchiveMilestone",m)},i=m=>{t("archivePhase",m)},c=m=>{t("unarchivePhase",m)},p=m=>{if(m.moved){const f=zt(m,o.phases??[]);t("updatePhase",{id:m.moved.element.id,rank:f})}},d=m=>{t("updatePhase",m)},u=m=>{t("addPhase",m)};return(m,f)=>(e.openBlock(),e.createElementBlock("div",wv,[e.createVNode(e.unref(xe),{class:"ao-project-phase__phases-list","model-value":m.phases,"item-key":"id",handle:".ao-card__drag",onChange:p},{item:e.withCtx(({element:h})=>[e.createVNode(kv,{phase:h,"is-editable":!m.readonly&&m.isEditable,"closed-status":m.closedStatus,users:m.users,readonly:m.readonly,onAddMilestone:n,onUpdateMilestone:s,onArchiveMilestone:r,onUnarchiveMilestone:l,onUpdatePhase:d,onArchivePhase:i,onUnarchivePhase:c},null,8,["phase","is-editable","closed-status","users","readonly"])]),_:1},8,["model-value"]),m.isEditable?(e.openBlock(),e.createElementBlock("div",$v,[Ev,e.createElementVNode("div",Bv,[e.createVNode(We,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:u},null,8,["label"])]),Vv])):e.createCommentVNode("",!0)]))}});const Sv=["onSubmit"],Nv={class:"ao-add-template-modal__form-body"},Mv={class:"field__row"},Tv={class:"ao-add-template-modal__form-footer"},Un=e.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(a,{emit:t}){const o=a,n=e.computed(()=>o.templates.map(i=>({value:i.id,label:i.name}))),s=e.ref(null),r=i=>{s.value=i},l=()=>{s.value&&t("apply",s.value,o.projectId)};return(i,c)=>(e.openBlock(),e.createBlock(ya,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:i.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:e.withModifiers(l,["prevent"])},[e.createElementVNode("p",null,e.toDisplayString(i.$t("project.template.apply.notice")),1),e.createElementVNode("div",Nv,[e.createElementVNode("div",Mv,[e.createVNode(ie,{value:s.value,options:n.value,detached:!0,onChange:r},null,8,["value","options"])])]),e.createElementVNode("footer",Tv,[e.createVNode(K,{label:i.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],40,Sv)]),_:1}))}});const Av=["onSubmit"],Ov={class:"ao-save-template-modal__form-body"},Iv={class:"field__row"},Lv={class:"ao-field ao-field--inline"},Dv={class:"ao-field__label"},Pv={class:"ao-save-template-modal__phases"},Hv={class:"ao-field__label"},Rv={class:"ao-save-template-modal__phases-list"},jv=["value"],Uv={class:"ao-save-template-modal__form-footer"},Fn=e.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(a,{emit:t}){const o=a,n=e.ref(""),s=e.ref([]);e.onMounted(()=>{s.value=o.phases.map(l=>l.id)});const r=()=>{n.value&&t("save",n.value,s.value)};return(l,i)=>(e.openBlock(),e.createBlock(ya,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:e.withModifiers(r,["prevent"])},[e.createElementVNode("div",Ov,[e.createElementVNode("div",Iv,[e.createElementVNode("label",Lv,[e.createElementVNode("span",Dv,e.toDisplayString(l.$t("project.template.name.label"))+": ",1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=c=>n.value=c),type:"text"},null,512),[[e.vModelText,n.value]])])]),e.createElementVNode("div",Pv,[e.createElementVNode("div",Hv,e.toDisplayString(l.$t("project.template.phases.label")),1),e.createElementVNode("div",Rv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.phases,c=>(e.openBlock(),e.createElementBlock("label",{class:"ao-field ao-field--checkbox",key:c.id},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:c.id,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p)},null,8,jv),[[e.vModelCheckbox,s.value]]),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]))),128))])])]),e.createElementVNode("footer",Uv,[e.createVNode(K,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:r},null,8,["label"])])],40,Av)]),_:1}))}});const Fv=e.defineComponent({props:{modelValue:{type:[String,Number],required:!0},tabs:{type:Array,required:!0}},emits:["update:modelValue"],methods:{selectTab(a){this.$emit("update:modelValue",a)}}});const zv={class:"tabbar-wrapper"},Zv=["onClick"];function xv(a,t,o,n,s,r){return e.openBlock(),e.createElementBlock("div",zv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tabs,l=>(e.openBlock(),e.createElementBlock("button",{key:l.value,class:e.normalizeClass(["tab-button",{"tab-button--active":l.value===a.modelValue}]),type:"button",onClick:i=>a.selectTab(l.value)},e.toDisplayString(l.label),11,Zv))),128))])}const Na=H(Fv,[["render",xv],["__scopeId","data-v-ff4e3297"]]),Wv={class:"ao-project"},qv={class:"ao-project__body"},Yv=e.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}},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(a,{emit:t}){const o=a,{t:n}=Ye(),s=e.computed(()=>o.phases.flatMap(E=>E.milestones)),r=()=>{const{name:E,rank:P}=ot(o.phases,"phase",n);t("addPhase",{name:E,rank:P,projectId:o.project.id})},l=E=>{t("updatePhase",E)},i=E=>{t("archivePhase",E)},c=E=>{t("unarchivePhase",E)},p=E=>{t("copyPhaseToTemplate",E)},d=E=>{t("addMilestone",E)},u=E=>{t("updateMilestone",E)},m=E=>{t("archiveMilestone",E)},f=E=>{t("unarchiveMilestone",E)},h=E=>{t("addActivity",E)},y=E=>{t("update:activity",E)},v=E=>{t("archiveActivity",E)},b=E=>{t("unarchiveActivity",E)},_=E=>{t("addSubtask",E)},g=E=>{t("updateSubtask",E)},C=E=>{t("deleteSubtask",E)},B=e.computed(()=>s.value.flatMap(E=>E.activities)),$=E=>{t("addFiles",E)},N=E=>{t("removeFile",E)},O=E=>{t("addComment",E)},j=E=>{t("updateComment",E)},z=E=>{t("removeComment",E)},x=e.ref(!1),I=e.ref(!1),U=(E,P)=>{t("applyTemplate",{templateId:E,projectId:P}),x.value=!1},Y=(E,P)=>{var k;const V=(k=o.templates)==null?void 0:k.at(-1),A=V?se.LexoRank.parse(V.rank).genNext():se.LexoRank.middle();t("saveTemplate",{templateName:E,rank:A.format(),phaseIds:P}),I.value=!1},W=Rt.useRouter(),Z=e.ref("overview"),S=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(Z,E=>{E==="feed"?(W.push({name:oe.feed}),console.log("Navigating to feed...")):E==="overview"?(W.push({name:oe.project}),console.log("Navigating to feed...")):E==="mapping"&&(W.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(E,P)=>{const V=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-overview"},E.$attrs),[e.createElementVNode("div",Wv,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createVNode(Na,{tabs:S,modelValue:Z.value,"onUpdate:modelValue":P[0]||(P[0]=A=>Z.value=A)},null,8,["modelValue"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":E.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:E.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":E.showsArchived,onClick:P[1]||(P[1]=A=>E.$emit("update:showsArchived",!E.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:E.$t("project.template.save.label"),onClick:P[2]||(P[2]=A=>I.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:1,class:"ao-project-overview__add-template",color:"primary",label:E.$t("project.template.apply.label"),onClick:P[3]||(P[3]=A=>x.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",qv,[e.createVNode(wo,{phases:E.phases,"closed-status":E.closedStatus,"is-editable":E.isEditable===!0,users:E.users,onAddMilestone:d,onUpdateMilestone:u,onArchiveMilestone:m,onUnarchiveMilestone:f,onAddPhase:r,onUpdatePhase:l,onArchivePhase:i,onUnarchivePhase:c,onCopyPhaseToTemplate:p},null,8,["phases","closed-status","is-editable","users"])])]),e.createVNode(V,{class:"ao-project__sidebar",phases:E.phases,"project-id":E.project.id,"project-name":E.project.name,users:E.users,"is-editable":E.isEditable===!0,"closed-status":E.closedStatus,onClose:P[4]||(P[4]=A=>E.$router.push({name:e.unref(oe).project})),onUpdateMilestone:u,onAddActivity:h,onUpdateActivity:y,onArchiveActivity:v,onUnarchiveActivity:b},null,8,["phases","project-id","project-name","users","is-editable","closed-status"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(V,{name:"modal",activities:B.value,"is-task-checkable":E.isTaskCheckable,statuses:E.statuses,"activity-types":E.activityTypes,phases:E.phases,project:E.project,users:E.users,"user-id":E.userId,"is-editable":E.isEditable,"attachment-enabled":E.attachmentEnabled,"onUpdate:activity":y,onAddSubtask:_,onUpdateSubtask:g,onDeleteSubtask:C,onAddFiles:$,onRemoveFile:N,onAddComment:O,onUpdateComment:j,onRemoveComment:z},{default:e.withCtx(({Component:A})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(A),null,{default:e.withCtx(k=>[e.renderSlot(E.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(k)))]),_:2},1024))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled"])]))],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[I.value?(e.openBlock(),e.createBlock(Fn,{key:0,phases:E.phases,onClose:P[5]||(P[5]=A=>I.value=!1),onSave:Y},null,8,["phases"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createBlock(Un,{key:1,"project-id":E.project.id,templates:E.templates,onClose:P[6]||(P[6]=A=>x.value=!1),onApply:U},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64)}}});const Kv={class:"ao-card-feed__header"},Gv={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},Xv={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Qv={class:"ao-card-feed__body"},Jv={key:0,class:"ao-card-feed__breadcrumbs"},eh={class:e.normalizeClass(["ao-card-feed__title-group"])},th={class:"ao-card-feed__title-line"},ah={key:0,class:"ao-card-feed__slug"},oh={key:1,class:"ao-card-feed__deadline"},nh={class:"ao-card-feed__footer"},sh={class:"ao-card-feed__footer-row"},lh={class:"ao-assignees"},rh={key:0,class:"ao-assignee"},ih={key:0,class:"ao-card-feed__subitems"},ch={key:0,class:"ao-card-feed__subitem"},dh={class:"ao-card-feed__subitem"},uh={key:1,class:"ao-card-feed__subitem"},ph={class:"ao-card-feed__subitem"},mh={class:"ao-card-feed__footer-row"},fh={key:0,class:"ao-card-feed__progress-wrapper"},vh={class:"ao-card-feed__subitem"},hh={class:"ao-card-feed__subitem"},$o=e.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(a,{emit:t}){const o=a,n=e.computed(()=>o.tagType==="milestone"?o.milestoneName:o.projectName),s=e.computed(()=>o.tagType==="milestone"?o.milestoneColor:o.projectColor),r=h=>{t("updateActivity",{id:o.id,name:h})},l=e.computed(()=>o.tagType==="milestone"&&o.phaseName?`${o.phaseName}`:o.phaseName&&o.milestoneName?`${o.phaseName} / ${o.milestoneName}`:""),i=e.computed(()=>o.assignee?[o.assignee]:[]),c=e.computed(()=>_a(o.deadline)),p=h=>{t("removeAssignee",h)},d=()=>{t("startTimer",{activityId:o.id,name:o.name,project:o.projectName,projectId:o.projectId,slug:o.slug})},u=e.computed(()=>{var h;return(h=o.tasks)==null?void 0:h.length}),m=e.computed(()=>{var h;return(h=o.tasks)==null?void 0:h.filter(y=>y.isDone).length}),f=e.computed(()=>(m.value||0)/(u.value||1));return(h,y)=>(e.openBlock(),e.createBlock(Va,{class:e.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":h.isClosed}]),"is-clickable":!0},{header:e.withCtx(()=>[e.createElementVNode("div",Kv,[n.value?(e.openBlock(),e.createBlock(At,{key:0,label:n.value,class:"ao-card-feed__project",variant:"solid",color:h.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):e.createCommentVNode("",!0),h.isPrivate||h.important||h.isClosed?(e.openBlock(),e.createElementBlock("div",Gv,[h.isPrivate?(e.openBlock(),e.createBlock(X,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):e.createCommentVNode("",!0),h.important?(e.openBlock(),e.createBlock(X,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):e.createCommentVNode("",!0),h.isClosed?(e.openBlock(),e.createBlock(X,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),h.$slots.secondary?(e.openBlock(),e.createElementBlock("div",Xv,[e.createVNode(X,{name:"TimerOutline",class:"ao-card-feed__timer",size:"sm",onClick:e.withModifiers(d,["stop"])},null,8,["onClick"]),e.renderSlot(h.$slots,"secondary")])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createElementVNode("div",Qv,[l.value?(e.openBlock(),e.createElementBlock("span",Jv,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",eh,[e.createElementVNode("div",th,[h.slug?(e.openBlock(),e.createElementBlock("span",ah,e.toDisplayString(h.slug)+": ",1)):e.createCommentVNode("",!0),e.createVNode(ne,{id:h.id,title:h.name,level:5,"is-editable":h.isEditable,"onUpdate:title":r,class:"ao-card-feed__title-inline"},null,8,["id","title","is-editable"])])]),h.deadline?(e.openBlock(),e.createElementBlock("span",oh,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",nh,[e.createElementVNode("div",sh,[e.createElementVNode("ul",lh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,v=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:v.id},[v?(e.openBlock(),e.createElementBlock("li",rh,[e.createVNode(ke,{"user-name":e.unref(bn)(v),"avatar-url":v.avatarUrl,"is-closable":!0,onClose:()=>p(v.id)},null,8,["user-name","avatar-url","onClose"])])):e.createCommentVNode("",!0)],64))),128))]),h.comments||h.attachments?(e.openBlock(),e.createElementBlock("ul",ih,[h.comments?(e.openBlock(),e.createElementBlock("li",ch,[e.createVNode(X,{name:"ChatOutline",size:"sm"}),e.createElementVNode("span",dh,e.toDisplayString(h.comments),1)])):e.createCommentVNode("",!0),h.attachments?(e.openBlock(),e.createElementBlock("li",uh,[e.createVNode(X,{name:"AttachFileRounded",size:"sm"}),e.createElementVNode("span",ph,e.toDisplayString(h.attachments),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",mh,[h.tasks&&h.tasks.length?(e.openBlock(),e.createElementBlock("div",fh,[e.createElementVNode("div",vh,[e.createVNode(X,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",hh,e.toDisplayString(m.value)+" / "+e.toDisplayString(u.value),1)]),e.createVNode(Sa,{percentages:f.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):e.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const Ch={class:"ao-project-milestone"},gh={class:"ao-project-milestone__header"},_h={class:"ao-project-milestone__header_line"},yh={class:"ao-project-milestone__header_line"},bh={class:"ao-project-milestone__title"},kh={key:0,class:"ao-fieldset ao-milestone__fieldset"},wh={class:"ao-field__row ao-milestone__field-row"},$h={class:"ao-field ao-field--inline"},Eh={class:"ao-field__row ao-milestone__field-row"},Bh={class:"ao-field ao-milestone__field-multiselect"},Vh=["onClick"],Sh={class:"ao-project-milestone__body"},Nh={key:0,class:"ao-project-milestone__footer"},Qo=e.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(a,{emit:t}){const o=a,{t:n}=Ye(),s=C=>{var B;t("startTimer",C),(B=window.parent)==null||B.postMessage({type:"startTimer",data:C},"*")},r=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(B=>B.id===o.phaseId)}),l=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(B=>B.milestones)}),i=e.computed(()=>{var C;return(C=l.value)==null?void 0:C.find(B=>B.id===o.milestoneId)}),c=e.computed(()=>{var C;return(C=i.value)==null?void 0:C.activities});e.watch(c,(C,B)=>{Me(C,B)});const p=C=>{t("close",C)},d=()=>{const{name:C,rank:B}=ot(c.value??[],"activity",n);t("addActivity",{milestoneId:o.milestoneId,name:C,rank:B,projectId:o.projectId})},u=C=>{t("updateActivity",C)},m=C=>{c.value&&"moved"in C&&t("updateActivity",{id:C.moved.element.id,rank:pt(c.value,C.moved.newIndex)})},f=e.computed({get:()=>{var C;return(C=i.value)==null?void 0:C.color},set:C=>{i.value&&t("updateMilestone",{id:i.value.id,color:C})}}),h=e.computed({get:()=>{var C;return((C=i==null?void 0:i.value)==null?void 0:C.deadline)??""},set:C=>{i.value&&t("updateMilestone",{id:i.value.id,deadline:C!=null&&C.length?C:null})}}),y=C=>o.closedStatus?Ja(C,o.closedStatus):!1,v=e.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(B=>({label:`${B.firstName} ${B.lastName}`,value:B.id,avatar:B.avatarUrl})))||[]}),b=e.computed({get(){var C,B;return(B=(C=i.value)==null?void 0:C.assignee)!=null&&B.id?[i.value.assignee.id]:[]},set(C){t("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),_=e.computed({get(){var C;return((C=i.value)==null?void 0:C.important)??!1},set(C){t("updateMilestone",{id:o.milestoneId,important:C})}}),g=(C,B)=>{const $=C.currentTarget;$ instanceof HTMLElement&&B($)};return(C,B)=>{var $;return e.openBlock(),e.createElementBlock("div",Ch,[e.createElementVNode("header",gh,[e.createElementVNode("div",_h,[e.createVNode(K,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:p})]),e.createElementVNode("div",yh,[e.createElementVNode("div",bh,[e.createVNode(ne,{title:(($=i.value)==null?void 0:$.name)||C.milestoneId,level:5},null,8,["title"]),e.createVNode(Ya,{modelValue:_.value,"onUpdate:modelValue":B[0]||(B[0]=N=>_.value=N),modelModifiers:{lazy:!0},disabled:!C.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"])])]),i.value?(e.openBlock(),e.createElementBlock("div",kh,[e.createElementVNode("div",wh,[e.createElementVNode("label",$h,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[1]||(B[1]=N=>h.value=N),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[e.vModelText,h.value,void 0,{lazy:!0}]])])]),e.createElementVNode("div",Eh,[e.createElementVNode("label",Bh,[e.createVNode(ie,{modelValue:b.value,"onUpdate:modelValue":B[2]||(B[2]=N=>b.value=N),options:v.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:!C.isEditable,caret:C.isEditable},{tag:e.withCtx(({option:N,handleTagRemove:O})=>[e.createVNode(ke,{"user-name":N.label,"avatar-url":N.avatar,"is-closable":!0,onClose:j=>O(N,j)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),e.createVNode(ko,{color:f.value,"onUpdate:color":B[3]||(B[3]=N=>f.value=N)},{clickable:e.withCtx(({openPicker:N,bgColor:O})=>[e.createElementVNode("button",{style:e.normalizeStyle({background:O}),class:"color-button",onClick:j=>g(j,N)},null,12,Vh)]),_:1},8,["color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Sh,[e.createVNode(e.unref(xe),e.mergeProps({class:"ao-project-milestone__activities",list:c.value,disabled:!C.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:m}),{item:e.withCtx(({element:N})=>{var O,j,z,x,I;return[e.createVNode($o,{id:N.id,name:N.name||N.id,"project-id":C.projectId,"phase-name":(O=r.value)==null?void 0:O.name,"milestone-name":(j=i.value)==null?void 0:j.name,"milestone-color":(z=i.value)==null?void 0:z.color,deadline:N.deadline,important:N.important,users:C.users,assignee:N.assignee,slug:N.slug,comments:(x=N.comments)==null?void 0:x.length,attachments:(I=N.attachments)==null?void 0:I.length,tasks:N.tasks,"is-editable":C.isEditable,"is-private":N.private,"is-closed":y(N),onClick:U=>C.$router.push({name:e.unref(oe).activity,params:{milestoneId:C.milestoneId,activityId:N.id}}),onUpdateActivity:u,onRemoveAssignee:()=>u({id:N.id,assigneeId:null}),onStartTimer:s},e.createSlots({_:2},[C.isEditable?{name:"secondary",fn:e.withCtx(()=>[C.isEditable&&N.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:e.withModifiers(()=>C.$emit("archiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),C.isEditable&&!N.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>C.$emit("unarchiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.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"]),C.isEditable?(e.openBlock(),e.createElementBlock("div",Nh,[e.createVNode(We,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:d},null,8,["label"])])):e.createCommentVNode("",!0)])])}}});const Mh=e.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(a,{emit:t}){const o=a,n=e.computed(()=>{var v;return(v=o.phases)==null?void 0:v.find(b=>b.id===o.phaseId)}),s=e.computed(()=>{var v;return(v=o.phases)==null?void 0:v.flatMap(b=>b.milestones)}),r=e.computed(()=>{var v;return(v=s.value)==null?void 0:v.find(b=>b.id===o.milestoneId)}),l=e.computed(()=>{var v;return(v=o.activities)==null?void 0:v.find(b=>b.id===o.activityId)}),i=v=>{t("update:activity",v)},c=v=>{t("addSubtask",v)},p=v=>{t("updateSubtask",v)},d=v=>{t("deleteSubtask",v)},u=v=>{t("addFiles",v)},m=v=>{t("removeFile",v)},f=v=>{t("addComment",v)},h=v=>{t("updateComment",v)},y=v=>{t("removeComment",v)};return(v,b)=>{var _,g;return l.value?(e.openBlock(),e.createBlock(mo,{key:0,activity:l.value,"activity-types":v.activityTypes,"milestone-id":v.milestoneId,"template-activities":v.activities,"is-template":!1,users:v.users,"user-id":v.userId,"is-task-checkable":v.isTaskCheckable,statuses:v.statuses,breadcrumbs:`${(_=n.value)==null?void 0:_.name} / ${(g=r.value)==null?void 0:g.name}`,"is-editable":v.isEditable,"attachment-enabled":v.attachmentEnabled,projects:[v.project],"time-tracking-data":v.timeTrackingData,onClose:v.$router.back,"onUpdate:activity":i,onAddSubtask:c,onUpdateSubtask:p,onDeleteSubtask:d,onAddFiles:u,onRemoveFile:m,onAddComment:f,onUpdateComment:h,onRemoveComment:y},{default:e.withCtx(C=>[e.renderSlot(v.$slots,"default",e.normalizeProps(e.guardReactiveProps(C)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","onClose"])):e.createCommentVNode("",!0)}}}),Th={class:"ao-col-header"},Ah=e.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("header",Th,[e.createVNode(ne,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(e.openBlock(),e.createBlock(At,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):e.createCommentVNode("",!0)]))}});function Oh(a){return e.getCurrentScope()?(e.onScopeDispose(a),!0):!1}function ma(a){return typeof a=="function"?a():e.unref(a)}const Ih=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Lh=a=>a!=null,Tt=()=>{};function Dh(a,t){function o(...n){return new Promise((s,r)=>{Promise.resolve(a(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(s).catch(r)})}return o}function Ph(a,t={}){let o,n,s=Tt;const r=i=>{clearTimeout(i),s(),s=Tt};return i=>{const c=ma(a),p=ma(t.maxWait);return o&&r(o),c<=0||p!==void 0&&p<=0?(n&&(r(n),n=null),Promise.resolve(i())):new Promise((d,u)=>{s=t.rejectOnCancel?u:d,p&&!n&&(n=setTimeout(()=>{o&&r(o),n=null,d(i())},p)),o=setTimeout(()=>{n&&r(n),n=null,d(i())},c)})}}function Hh(a,t=200,o={}){return Dh(Ph(t,o),a)}function za(a){var t;const o=ma(a);return(t=o==null?void 0:o.$el)!=null?t:o}const Rh=Ih?window:void 0;function jh(){const a=e.ref(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{a.value=!0},t),a}function Uh(a){const t=jh();return e.computed(()=>(t.value,!!a()))}function Fh(a,t,o={}){const{root:n,rootMargin:s="0px",threshold:r=.1,window:l=Rh,immediate:i=!0}=o,c=Uh(()=>l&&"IntersectionObserver"in l),p=e.computed(()=>{const h=ma(a);return(Array.isArray(h)?h:[h]).map(za).filter(Lh)});let d=Tt;const u=e.ref(i),m=c.value?e.watch(()=>[p.value,za(n),u.value],([h,y])=>{if(d(),!u.value||!h.length)return;const v=new IntersectionObserver(t,{root:za(y),rootMargin:s,threshold:r});h.forEach(b=>b&&v.observe(b)),d=()=>{v.disconnect(),d=Tt}},{immediate:i,flush:"post"}):Tt,f=()=>{d(),m(),u.value=!1};return Oh(f),{isSupported:c,isActive:u,pause(){d(),u.value=!1},resume(){u.value=!0},stop:f}}const zh={class:e.normalizeClass(["ao-list-kanban"])},Zh={class:"ao-list-kanban__header"},xh={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Wh={key:1,class:"ao-list-kanban__end"},qh={key:0,class:"ao-list-kanban__no-more"},Yh={key:1,class:"ao-list-kanban__divider"},Kh={key:1,class:"ao-list-kanban__footer"},Gh=e.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{}},emits:["add","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(a,{emit:t}){const o=a,n=e.ref(!1),s=e.ref(null);Fh(s,([{isIntersecting:d}])=>{n.value=d}),e.watch(n,d=>{d&&o.hasMore&&!o.isLoading&&t("loadMore")});const r=d=>{var u;return o.isEditable===!0?!0:o.userId&&o.isEditable==="only-own"?o.userId===((u=d.assignee)==null?void 0:u.id):!1},l=d=>{t("selectActivity",d)},i=d=>{t("updateActivity",d)},c=d=>{"added"in d?t("updateActivity",{id:d.added.element.id,statusId:o.status.id,rank:pt(o.list,d.added.newIndex)}):"removed"in d||"moved"in d&&t("updateActivity",{id:d.moved.element.id,rank:pt(o.list,d.moved.newIndex)})},p=e.ref(!1);return(d,u)=>(e.openBlock(),e.createElementBlock("div",zh,[d.title||d.$slots.header?e.renderSlot(d.$slots,"header",{key:0},()=>{var m;return[e.createElementVNode("div",Zh,[d.title?(e.openBlock(),e.createBlock(Ah,{key:0,title:d.title,level:3,items:(m=d.list)==null?void 0:m.length},null,8,["title","items"])):e.createCommentVNode("",!0)])]}):e.createCommentVNode("",!0),e.createVNode(e.unref(xe),e.mergeProps({class:["ao-list-kanban__list",p.value?"ao-list-kanban__transition":void 0],list:d.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},d.$attrs,{draggable:".ao-list-draggable",disabled:!d.isEditable,onChange:c,onStart:u[1]||(u[1]=m=>p.value=!0),onEnd:u[2]||(u[2]=m=>p.value=!1),"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"}}),{item:e.withCtx(({element:m})=>{var f,h,y,v,b,_,g,C,B,$;return[e.createVNode($o,{class:e.normalizeClass(r(m)?"ao-list-draggable":""),id:m.id,name:m.name,"project-name":(f=m.project)==null?void 0:f.name,"project-id":(h=m.project)==null?void 0:h.id,"project-color":(y=m.project)==null?void 0:y.color,"phase-name":(b=(v=m.milestone)==null?void 0:v.phase)==null?void 0:b.name,"milestone-name":(_=m.milestone)==null?void 0:_.name,"milestone-color":(g=m.milestone)==null?void 0:g.color,deadline:m.deadline,rules:((C=m.rules)==null?void 0:C.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(B=m.comments)==null?void 0:B.length,attachments:($=m.attachments)==null?void 0:$.length,users:d.users,assignee:m.assignee,slug:m.slug,"is-editable":r(m),"is-private":m.private,"tag-type":d.tagType,onUpdateActivity:[N=>r(m)&&i(N),()=>r(m)&&i],onClick:()=>l(m.id),onRemoveAssignee:()=>r(m)&&i({id:m.id,assigneeId:null}),onStartTimer:u[0]||(u[0]=N=>d.$emit("startTimer",N))},{secondary:e.withCtx(()=>[r(m)&&m.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.archive"),onClick:e.withModifiers(()=>d.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),r(m)&&!m.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>d.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),_:2},1032,["class","id","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:e.withCtx(()=>[d.isLoading?(e.openBlock(),e.createElementBlock("div",xh,[e.createVNode(X,{name:"Loading"})])):d.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(e.openBlock(),e.createElementBlock("div",Wh,[d.noMoreLabel?(e.openBlock(),e.createElementBlock("span",qh,e.toDisplayString(d.noMoreLabel),1)):d.isEditable?(e.openBlock(),e.createElementBlock("span",Yh)):e.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),d.$slots.footer||d.footerLabel?(e.openBlock(),e.createElementBlock("div",Kh,[e.renderSlot(d.$slots,"footer",{},()=>[d.isEditable?(e.openBlock(),e.createBlock(We,{key:0,"icon-name":"AddBoxOutlineRounded",label:d.footerLabel,onClick:u[3]||(u[3]=m=>d.$emit("add"))},null,8,["label"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]))}});const Xh={class:"ao-field ao-search-field"},Qh=["value","placeholder","onKeypress"],Jh=e.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(a,{emit:t}){const o=a,n=async l=>{const c=l.target.value;t("update:modelValue",c,l)},s=Hh(n,o.delay),r=l=>{t("clear",l)};return(l,i)=>(e.openBlock(),e.createElementBlock("div",Xh,[e.createElementVNode("input",{value:l.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:l.placeholder,onInput:i[0]||(i[0]=(...c)=>e.unref(s)&&e.unref(s)(...c)),onKeypress:e.withKeys(n,["enter"])},null,40,Qh),e.createVNode(X,{name:"SearchRounded",class:e.normalizeClass(`ao-search-field__icon ao-search-field__action ${l.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),e.createVNode(K,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:e.normalizeClass(`ao-search-field__button ao-search-field__action ${l.modelValue?"ao-search-field__action--visible":""}`),onClick:r},null,8,["class"])]))}});const e9={class:"ao-feed"},t9={class:"ao-feed__filters"},a9={class:"ao-feed__body"},zn=e.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{}},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(a,{emit:t}){const o=a,{t:n}=Ye();function s(V,A){t("toast",V,A)}const r=e.toRef(o,"activities"),l=async(V,A)=>{await t("selectActivity",V,A)},i=e.ref({}),c=e.ref(!1),p=e.ref(!1),d=e.computed(()=>o.project?"milestone":"project");e.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([V,A,k,M],[F,R])=>{i.value=Object.fromEntries(V.map(T=>[T.id,A.filter(D=>{var J;return((J=D.status)==null?void 0:J.id)===T.id})])),k&&!c.value?(l(k,null),c.value=!0):M&&!c.value&&(l(null,M),c.value=!0),p.value&&Me(A,R)},{immediate:!0});const u=e.computed(()=>{var V;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((V=o.selectedActivity.milestone.phase)==null?void 0:V.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=V=>{var R,T;const A=(R=o.activities)==null?void 0:R.at(-1),k=A?se.LexoRank.parse(A.rank).genNext():se.LexoRank.middle(),M=((T=o.activities)==null?void 0:T.length)??0,F={name:n("activity.defaultName",{idx:M+1}),rank:k.format(),statusId:V.id};o.filters.assigneeId.length>0&&(F.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(F.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(F.typeId=o.filters.typeId[0]),p.value=!0,t("addActivity",F)},f=(V,A)=>{p.value=!1,t("update:filters",{...o.filters,[V]:A})},h=e.computed(()=>o.project?[o.project]:o.projects??[]),y=e.computed(()=>h.value.map(V=>({value:V.id,label:V.name}))),v=e.computed(()=>{var V;return(V=o.activityTypes)==null?void 0:V.map(A=>({value:A.id,label:A.name}))}),b=e.computed(()=>o.users.map(V=>({value:V.id,label:`${V.firstName} ${V.lastName}`,avatar:V.avatarUrl}))),_=V=>{o.selectedActivity&&t("update:activity",V)},g=V=>{t("update:activity",V)},C=V=>{t("archiveActivity",V)},B=V=>{t("unarchiveActivity",V)},$=V=>{var A;t("startTimer",V),(A=window.parent)==null||A.postMessage({type:"startTimer",data:V},"*")},N=V=>{p.value=!1,t("update:searchText",V)},O=V=>{p.value=!1,t("clear:searchText",V)},j=V=>{o.selectedActivity&&t("addSubtask",V)},z=V=>{o.selectedActivity&&t("updateSubtask",V)},x=V=>{o.selectedActivity&&t("deleteSubtask",V)},I=V=>{t("addFiles",V)},U=V=>{t("removeFile",V)},Y=V=>{o.selectedActivity&&t("addComment",{...V,activityId:o.selectedActivity.id})},W=V=>{const{id:A}=o.selectedActivity||{};A&&t("updateComment",V)},Z=V=>{const{id:A}=o.selectedActivity||{};A&&t("removeComment",V)},S=Rt.useRouter(),E=e.ref("feed"),P=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(E,V=>{V==="feed"?(S.push({name:oe.feed}),console.log("Navigating to feed...")):V==="overview"?(S.push({name:oe.project}),console.log("Navigating to feed...")):V==="mapping"&&(S.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(V,A)=>{var k;return e.openBlock(),e.createElementBlock("div",e9,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createElementVNode("div",t9,[e.createVNode(Na,{tabs:P,modelValue:E.value,"onUpdate:modelValue":A[0]||(A[0]=M=>E.value=M)},null,8,["modelValue"]),e.createVNode(Jh,{"model-value":V.searchText,placeholder:V.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":N,onClear:O},null,8,["model-value","placeholder"]),o.project?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie,{key:0,"model-value":V.filters[e.unref(Je).project],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:V.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":A[1]||(A[1]=M=>f(e.unref(Je).project,M))},null,8,["model-value","options","placeholder"])),v.value?(e.openBlock(),e.createBlock(ie,{key:1,"model-value":V.filters[e.unref(Je).type],mode:"tags",options:v.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:V.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":A[2]||(A[2]=M=>f(e.unref(Je).type,M))},null,8,["model-value","options","placeholder"])):e.createCommentVNode("",!0),b.value.length?(e.openBlock(),e.createBlock(ie,{key:2,"model-value":V.filters[e.unref(Je).assignee],mode:"tags",options:b.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:V.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":A[3]||(A[3]=M=>f(e.unref(Je).assignee,M))},{tag:e.withCtx(({option:M,handleTagRemove:F})=>[e.createVNode(ke,{"user-name":M.label,"avatar-url":M.avatar,"is-closable":!0,onClose:R=>F(M,R)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):e.createCommentVNode("",!0)]),e.createVNode(K,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":V.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":V.showsOnlyNonAssigned,onClick:A[4]||(A[4]=M=>V.$emit("update:showsOnlyNonAssigned",!V.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__only-important",size:"sm","icon-name":V.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":V.showsOnlyImportant,onClick:A[5]||(A[5]=M=>V.$emit("update:showsOnlyImportant",!V.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":V.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":V.showsArchivedActivities,onClick:A[6]||(A[6]=M=>V.$emit("update:showsArchivedActivities",!V.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),e.createElementVNode("div",a9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.statuses,M=>(e.openBlock(),e.createBlock(Gh,{key:M.id,status:M,list:i.value[M.id],title:M.name,"footer-label":V.$t("feed.activity.add"),users:V.users,"user-id":V.userId,"is-editable":V.isEditable,tagType:d.value,onAdd:()=>m(M),onSelectActivity:l,onArchiveActivity:C,onUnarchiveActivity:B,onUpdateActivity:g,onStartTimer:$},null,8,["status","list","title","footer-label","users","user-id","is-editable","tagType","onAdd"]))),128))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[V.selectedActivity?(e.openBlock(),e.createBlock(mo,{key:0,activity:V.selectedActivity,"activity-types":V.activityTypes,"milestone-id":(k=V.selectedActivity.milestone)==null?void 0:k.id,"template-activities":r.value,users:V.users,"user-id":V.userId,"is-task-checkable":V.isTaskCheckable,statuses:V.statuses,breadcrumbs:u.value,"is-editable":V.isEditable,"attachment-enabled":V.attachmentEnabled,projects:h.value,"time-tracking-data":V.timeTrackingData,onClose:A[7]||(A[7]=()=>l(null,null)),"onUpdate:activity":_,onAddSubtask:j,onUpdateSubtask:z,onDeleteSubtask:x,onAddFiles:I,onRemoveFile:U,onAddComment:Y,onUpdateComment:W,onRemoveComment:Z,onToast:s},{default:e.withCtx(M=>[e.renderSlot(V.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(M)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data"])):e.createCommentVNode("",!0)]))])}}});const o9={class:"ao-project-mapping"},n9={class:"ao-project-mapping-mapping__body"},s9={class:"ao-project-mapping-mapping__phases"},l9={key:0,class:"ao-project-mapping-mapping__image-wrapper"},r9=["src","alt"],i9=e.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(a,{emit:t}){const o=a,{t:n}=Ye(),s=()=>{const{name:v,rank:b}=ot(o.phases,"phase",n);t("addPhase",{name:v,rank:b,projectId:o.project.id})},r=v=>{t("updatePhase",v)},l=v=>{t("archivePhase",v)},i=v=>{t("unarchivePhase",v)},c=v=>{t("copyPhaseToTemplate",v)},p=e.ref(!1),d=e.ref(!1),u=(v,b)=>{t("applyTemplate",{templateId:v,projectId:b}),p.value=!1},m=(v,b)=>{var C;const _=(C=o.templates)==null?void 0:C.at(-1),g=_?se.LexoRank.parse(_.rank).genNext():se.LexoRank.middle();t("saveTemplate",{templateName:v,rank:g.format(),phaseIds:b}),d.value=!1},f=Rt.useRouter(),h=e.ref("mapping"),y=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(h,v=>{v==="feed"?(f.push({name:oe.feed}),console.log("Navigating to feed...")):v==="overview"?(f.push({name:oe.project}),console.log("Navigating to feed...")):v==="mapping"&&(f.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(v,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-mapping-overview"},v.$attrs),[e.createElementVNode("div",o9,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createVNode(Na,{modelValue:h.value,"onUpdate:modelValue":b[0]||(b[0]=_=>h.value=_),tabs:y},null,8,["modelValue"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":v.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":v.showsArchived,onClick:b[1]||(b[1]=_=>v.$emit("update:showsArchived",!v.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[v.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:0,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:v.$t("project.template.save.label"),onClick:b[2]||(b[2]=_=>d.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),v.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:1,class:"ao-project-mapping-overview__add-template",color:"primary",label:v.$t("project.template.apply.label"),onClick:b[3]||(b[3]=_=>p.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",n9,[e.createElementVNode("div",s9,[e.createVNode(wo,{phases:v.phases,"closed-status":v.closedStatus,"is-editable":v.isEditable===!0,users:v.users,onAddPhase:s,onUpdatePhase:r,onArchivePhase:l,onUnarchivePhase:i,onCopyPhaseToTemplate:c},null,8,["phases","closed-status","is-editable","users"])]),v.project.architectureImage?(e.openBlock(),e.createElementBlock("div",l9,[e.createElementVNode("img",{class:"architecture-image",src:v.project.architectureImage.url,alt:e.unref(n)("architectureImage.alt")},null,8,r9)])):e.createCommentVNode("",!0)])])],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?(e.openBlock(),e.createBlock(Fn,{key:0,phases:v.phases,onClose:b[4]||(b[4]=_=>d.value=!1),onSave:m},null,8,["phases"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(Un,{key:1,"project-id":v.project.id,templates:v.templates,onClose:b[5]||(b[5]=_=>p.value=!1),onApply:u},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64))}});const tt={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},c9=(a,t={})=>[{path:a,name:tt.TEMPLATES,redirect:{name:tt.TEMPLATES_LIST},...t,children:[{path:"",name:tt.TEMPLATES_LIST,component:Zn},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:tt.TEMPLATE_DETAILS,component:jn,props:!0}]}],oe={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},d9=(a,t={})=>[{path:a,...t,redirect:{name:oe.project},children:[{path:"",name:oe.project,component:Yv,props:!0,children:[{path:":phaseId/:milestoneId",name:oe.milestone,component:Qo,props:!0},{path:":phaseId/:milestoneId/:activityId",name:oe.activity,props:{default:!0,modal:!0},components:{default:Qo,modal:Mh}}]},{path:"feed",name:oe.feed,component:zn,props:!0},{path:"mapping",name:oe.mapping,component:i9,props:!0}]}],u9={class:"ao-templates"},Zn=e.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(a,{emit:t}){const o=a,{t:n}=Ye();e.watch(()=>o.templates,(c,p)=>{Me(c,p)});const s=()=>{var m,f;const c=(m=o.templates)==null?void 0:m.at(-1),p=c?se.LexoRank.parse(c.rank).genNext():se.LexoRank.middle(),d=((f=o.templates)==null?void 0:f.length)??0,u={name:n("template.defaultName.template",{idx:d+1}),rank:p.format()};t("addTemplate",u)},r=(c,p)=>{t("updateItem",{itemType:ee.TEMPLATES,id:c,templateId:c,data:{name:p}})},l=(c,p)=>{t("removeItem",{itemType:ee.TEMPLATES,templateId:c,data:{id:c,...p?{name:p}:{}}})},i=c=>{if(c.moved){const p=zt(c,o.templates??[]);t("updateItem",{itemType:ee.TEMPLATES,id:c.moved.element.id,templateId:c.moved.element.id,data:{rank:p}})}};return(c,p)=>(e.openBlock(),e.createElementBlock("div",u9,[e.createVNode(Zt,null,{secondary:e.withCtx(()=>[e.createVNode(K,{label:c.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),e.createVNode(e.unref(xe),{"model-value":c.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:i},{item:e.withCtx(({element:d})=>{var u;return[e.createVNode(B3,{id:d.id,title:d.name,phases:d.phases,milestones:(u=d.phases)!=null&&u.length?e.unref(K0)(d.phases):0,activities:d.phases?e.unref(G0)(d.phases):0,"updated-at":d.updatedAt,"updated-by":d.updatedBy,onUpdateTitle:m=>r(d.id,m),onClick:m=>c.$router.push({name:e.unref(tt).TEMPLATE_DETAILS,params:{templateId:d.id}}),onDeleteItem:p[0]||(p[0]=(m,f)=>l(m,f))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const p9={class:"ao-field__label"},xn=e.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[e.createElementVNode("span",p9,e.toDisplayString(t.label),1),e.renderSlot(t.$slots,"default")],2))}}),m9=["type","value","disabled","readonly"],f9=e.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(a,{emit:t}){const o=a,n=e.computed(()=>o.modelModifiers.lazy?"change":"input"),s=r=>{o.modelModifiers.number&&(r=Number(r)),t("update:modelValue",r)};return(r,l)=>(e.openBlock(),e.createBlock(xn,{label:r.label},{default:e.withCtx(()=>[e.createElementVNode("input",e.mergeProps({class:"ao-field__input",type:r.type,value:r.modelValue,disabled:r.isDisabled,readonly:r.isReadonly},{[e.toHandlerKey(n.value)]:l[0]||(l[0]=i=>s(i.target.value))}),null,16,m9)]),_:1},8,["label"]))}}),v9={class:"ao-field"},h9={class:"ao-field__label"},C9=["checked","disabled"],g9=e.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(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",v9,[e.createElementVNode("span",h9,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:o[0]||(o[0]=n=>{var s;return t.$emit("update:modelValue",((s=n.target)==null?void 0:s.checked)??!1)})},null,40,C9)]))}});exports.AoAvatar=ke;exports.AoCardFeed=$o;exports.AoCheckboxField=g9;exports.AoFeed=zn;exports.AoField=xn;exports.AoInputField=f9;exports.AoMultiselect=ie;exports.AoProjectPhases=wo;exports.AoTabBar=Na;exports.AoTemplateDetails=jn;exports.AoTemplates=cs;exports.AoTemplatesList=Zn;exports.TemplateItemTypeEnum=sn;exports.activityFeedStatus=d2;exports.durationTypes=c2;exports.feedFilterTypes=Je;exports.getProjectOverviewRoutes=d9;exports.getTemplateRoutes=c9;exports.listUpdateTypes=u2;exports.milestoneStatus=Ot;exports.projectOverviewRoutes=oe;exports.ruleComparators=an;exports.ruleDurationUnits=nn;exports.ruleTriggerTypes=on;exports.templateItemType=ee;exports.templateRouteNames=tt;
package/dist/orcha.es.js CHANGED
@@ -12184,7 +12184,7 @@ const g4 = /* @__PURE__ */ X({
12184
12184
  return (m = n.value) == null ? void 0 : m.find(($) => $.id === a.milestoneId);
12185
12185
  }), o = M(() => {
12186
12186
  var m;
12187
- return console.log("=== AoProjectOverviewActivityDetails debug ==="), console.log("props.timeTrackingData:", JSON.stringify(a.timeTrackingData, null, 2)), console.log("props.activityId:", a.activityId), (m = a.activities) == null ? void 0 : m.find(($) => $.id === a.activityId);
12187
+ return (m = a.activities) == null ? void 0 : m.find(($) => $.id === a.activityId);
12188
12188
  }), l = (m) => {
12189
12189
  e("update:activity", m);
12190
12190
  }, r = (m) => {
package/dist/orcha.umd.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * vue-color-kit v1.0.6
4
4
  * (c) 2023
5
5
  * @license MIT
6
- */function ot(a){let t={r:0,g:0,b:0,a:1};/#/.test(a)?t=xf(a):/rgb/.test(a)?t=Tr(a):typeof a=="string"?t=Tr(`rgba(${a})`):Object.prototype.toString.call(a)==="[object Object]"&&(t=a);const{r:o,g:r,b:n,a:s}=t,{h:i,s:l,v:c}=Mf(t);return{r:o,g:r,b:n,a:s===void 0?1:s,h:i,s:l,v:c}}function oo(a){const t=document.createElement("canvas"),o=t.getContext("2d"),r=a*2;return t.width=r,t.height=r,o.fillStyle="#ffffff",o.fillRect(0,0,r,r),o.fillStyle="#ccd5db",o.fillRect(0,0,a,a),o.fillRect(a,a,a,a),t}function ro(a,t,o,r,n,s){const i=a==="l",l=t.createLinearGradient(0,0,i?o:0,i?0:r);l.addColorStop(.01,n),l.addColorStop(.99,s),t.fillStyle=l,t.fillRect(0,0,o,r)}function Nf({r:a,g:t,b:o},r){const n=i=>("0"+Number(i).toString(16)).slice(-2),s=`#${n(a)}${n(t)}${n(o)}`;return r?s.toUpperCase():s}function xf(a){a=a.slice(1);const t=o=>parseInt(o,16)||0;return{r:t(a.slice(0,2)),g:t(a.slice(2,4)),b:t(a.slice(4,6))}}function Tr(a){return typeof a=="string"?(a=(/rgba?\((.*?)\)/.exec(a)||["","0,0,0,1"])[1].split(","),{r:Number(a[0])||0,g:Number(a[1])||0,b:Number(a[2])||0,a:Number(a[3]?a[3]:1)}):a}function Mf({r:a,g:t,b:o}){a=a/255,t=t/255,o=o/255;const r=Math.max(a,t,o),n=Math.min(a,t,o),s=r-n;let i=0;r===n?i=0:r===a?t>=o?i=60*(t-o)/s:i=60*(t-o)/s+360:r===t?i=60*(o-a)/s+120:r===o&&(i=60*(a-t)/s+240),i=Math.floor(i);let l=parseFloat((r===0?0:1-n/r).toFixed(2)),c=parseFloat(r.toFixed(2));return{h:i,s:l,v:c}}var no=e.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 a=this.$refs.canvasSaturation,t=this.size,o=a.getContext("2d");a.width=t,a.height=t,o.fillStyle=this.color,o.fillRect(0,0,t,t),ro("l",o,t,t,"#FFFFFF","rgba(255,255,255,0)"),ro("p",o,t,t,"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(a){const{top:t,left:o}=this.$el.getBoundingClientRect(),r=a.target.getContext("2d"),n=i=>{let l=i.clientX-o,c=i.clientY-t;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=r.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,p,m]=u.data;this.$emit("selectSaturation",{r:d,g:p,b:m})};n(a);const s=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",s)}}});const Tf={ref:"canvasSaturation"};function Af(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",{class:"saturation",onMousedown:t[1]||(t[1]=e.withModifiers((...i)=>a.selectSaturation&&a.selectSaturation(...i),["prevent","stop"]))},[e.createVNode("canvas",Tf,null,512),e.createVNode("div",{style:a.slideSaturationStyle,class:"slide"},null,4)],32)}no.render=Af,no.__file="src/color/Saturation.vue";var io=e.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 a=this.$refs.canvasHue,t=this.width,o=this.height,r=a.getContext("2d");a.width=t,a.height=o;const n=r.createLinearGradient(0,0,0,o);n.addColorStop(0,"#FF0000"),n.addColorStop(.17*1,"#FF00FF"),n.addColorStop(.17*2,"#0000FF"),n.addColorStop(.17*3,"#00FFFF"),n.addColorStop(.17*4,"#00FF00"),n.addColorStop(.17*5,"#FFFF00"),n.addColorStop(1,"#FF0000"),r.fillStyle=n,r.fillRect(0,0,t,o)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(a){const{top:t}=this.$el.getBoundingClientRect(),o=a.target.getContext("2d"),r=s=>{let i=s.clientY-t;i<0&&(i=0),i>this.height&&(i=this.height),this.slideHueStyle={top:i-2+"px"};const l=o.getImageData(0,Math.min(i,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};r(a);const n=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",n)}}});const Of={ref:"canvasHue"};function If(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",{class:"hue",onMousedown:t[1]||(t[1]=e.withModifiers((...i)=>a.selectHue&&a.selectHue(...i),["prevent","stop"]))},[e.createVNode("canvas",Of,null,512),e.createVNode("div",{style:a.slideHueStyle,class:"slide"},null,4)],32)}io.render=If,io.__file="src/color/Hue.vue";var so=e.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 a=this.$refs.canvasAlpha,t=this.width,o=this.height,r=this.alphaSize,n=oo(r),s=a.getContext("2d");a.width=t,a.height=o,s.fillStyle=s.createPattern(n,"repeat"),s.fillRect(0,0,t,o),ro("p",s,t,o,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(a){const{top:t}=this.$el.getBoundingClientRect(),o=n=>{let s=n.clientY-t;s<0&&(s=0),s>this.height&&(s=this.height);let i=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",i)};o(a);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const Lf={ref:"canvasAlpha"};function jf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",{class:"color-alpha",onMousedown:t[1]||(t[1]=e.withModifiers((...i)=>a.selectAlpha&&a.selectAlpha(...i),["prevent","stop"]))},[e.createVNode("canvas",Lf,null,512),e.createVNode("div",{style:a.slideAlphaStyle,class:"slide"},null,4)],32)}so.render=jf,so.__file="src/color/Alpha.vue";var lo=e.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 a=this.$el,t=this.width,o=this.height,r=this.alphaSize,n=oo(r),s=a.getContext("2d");a.width=t,a.height=o,s.fillStyle=s.createPattern(n,"repeat"),s.fillRect(0,0,t,o),s.fillStyle=this.color,s.fillRect(0,0,t,o)}}});function Df(a,t,o,r,n,s){return e.openBlock(),e.createBlock("canvas")}lo.render=Df,lo.__file="src/color/Preview.vue";var co=e.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(a){this.isSucking=!1,this.suckColor(a)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(a){a.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(a){const{clientX:t,clientY:o}=a,{top:r,left:n,width:s,height:i}=this.suckerCanvas.getBoundingClientRect(),l=t-n,c=o-r,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,i-1),1,1);let[p,m,f,g]=d.data;g=parseFloat((g/255).toFixed(2));const b=this.suckerPreview.style;Object.assign(b,{position:"absolute",left:t+20+"px",top:o-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}, ${m}, ${f}, ${g})`,zIndex:95}),this.suckerArea.length&&t>=this.suckerArea[0]&&o>=this.suckerArea[1]&&t<=this.suckerArea[2]&&o<=this.suckerArea[3]?b.display="":b.display="none"},suckColor(a){a&&a.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),a.addEventListener("click",t=>{const{clientX:o,clientY:r}=t,{top:n,left:s,width:i,height:l}=a.getBoundingClientRect(),c=o-s,u=r-n,p=a.getContext("2d").getImageData(Math.min(c,i-1),Math.min(u,l-1),1,1);let[m,f,g,b]=p.data;b=parseFloat((b/255).toFixed(2)),this.$emit("selectSucker",{r:m,g:f,b:g,a:b})}))}}});const Pf=e.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),zf={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},Hf=e.createVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[e.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),e.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[e.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function Rf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",null,[a.isSucking?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock("svg",{key:0,class:[{active:a.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:t[1]||(t[1]=(...i)=>a.openSucker&&a.openSucker(...i))},[Pf],2)),a.isSucking?(e.openBlock(),e.createBlock("svg",zf,[Hf])):e.createCommentVNode("v-if",!0)])}co.render=Rf,co.__file="src/color/Sucker.vue";var po=e.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(a,{emit:t}){return{modelColor:e.computed({get(){return a.color||""},set(s){t("inputColor",s)}}),handleFocus:s=>{t("inputFocus",s)},handleBlur:s=>{t("inputBlur",s)}}}});const Uf={class:"color-type"},Ff={class:"name"};function Zf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",Uf,[e.createVNode("span",Ff,e.toDisplayString(a.name),1),e.withDirectives(e.createVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=i=>a.modelColor=i),class:"value",onFocus:t[2]||(t[2]=(...i)=>a.handleFocus&&a.handleFocus(...i)),onBlur:t[3]||(t[3]=(...i)=>a.handleBlur&&a.handleBlur(...i))},null,544),[[e.vModelText,a.modelColor]])])}po.render=Zf,po.__file="src/color/Box.vue";var uo=e.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(a,{emit:t}){const o=e.ref(),r=e.ref([]),n=e.ref();a.colorsHistoryKey&&localStorage&&(r.value=JSON.parse(localStorage.getItem(a.colorsHistoryKey))||[]),n.value=oo(4).toDataURL(),e.onUnmounted(()=>{s(o.value)});function s(l){if(!l)return;const c=r.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),r.value=c||[],localStorage&&a.colorsHistoryKey&&localStorage.setItem(a.colorsHistoryKey,JSON.stringify(c))}function i(l){t("selectColor",l)}return{setColorsHistory:s,colorsHistory:r,color:o,imgAlphaBase64:n,selectColor:i}}});const Wf={class:"colors"},qf={key:0,class:"colors history"};function Yf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",null,[e.createVNode("ul",Wf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsDefault,i=>(e.openBlock(),e.createBlock("li",{key:i,class:"item",onClick:l=>a.selectColor(i)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:i},class:"color"},null,4)],8,["onClick"]))),128))]),a.colorsHistory.length?(e.openBlock(),e.createBlock("ul",qf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsHistory,i=>(e.openBlock(),e.createBlock("li",{key:i,class:"item",onClick:l=>a.selectColor(i)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:i},class:"color"},null,4)],8,["onClick"]))),128))])):e.createCommentVNode("v-if",!0)])}uo.render=Yf,uo.__file="src/color/Colors.vue";var vt=e.defineComponent({components:{Saturation:no,Hue:io,Alpha:so,Preview:lo,Sucker:co,Box:po,Colors:uo},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 Nf(this.rgba,!0)}},created(){Object.assign(this,ot(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(a){const{r:t,g:o,b:r,h:n,s,v:i}=ot(a);Object.assign(this,{r:t,g:o,b:r,h:n,s,v:i}),this.setText()},handleFocus(a){this.$emit("inputFocus",a)},handleBlur(a){this.$emit("inputBlur",a)},selectHue(a){const{r:t,g:o,b:r,h:n,s,v:i}=ot(a);Object.assign(this,{r:t,g:o,b:r,h:n,s,v:i}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(a){this.a=a,this.setText()},inputHex(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.modelHex=a,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.modelHex=this.hexString,this.modelRgba=a,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(a){this.$emit("openSucker",a)},selectSucker(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Kf={class:"color-set"};function Gf(a,t,o,r,n,s){const i=e.resolveComponent("Saturation"),l=e.resolveComponent("Hue"),c=e.resolveComponent("Alpha"),u=e.resolveComponent("Preview"),d=e.resolveComponent("Sucker"),p=e.resolveComponent("Box"),m=e.resolveComponent("Colors");return e.openBlock(),e.createBlock("div",{class:["hu-color-picker",{light:a.isLightTheme}],style:{width:a.totalWidth+"px"}},[e.createVNode("div",Kf,[e.createVNode(i,{ref:"saturation",color:a.rgbString,hsv:a.hsv,size:a.hueHeight,onSelectSaturation:a.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),e.createVNode(l,{ref:"hue",hsv:a.hsv,width:a.hueWidth,height:a.hueHeight,onSelectHue:a.selectHue},null,8,["hsv","width","height","onSelectHue"]),e.createVNode(c,{ref:"alpha",color:a.rgbString,rgba:a.rgba,width:a.hueWidth,height:a.hueHeight,onSelectAlpha:a.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),e.createVNode("div",{style:{height:a.previewHeight+"px"},class:"color-show"},[e.createVNode(u,{color:a.rgbaString,width:a.previewWidth,height:a.previewHeight},null,8,["color","width","height"]),a.suckerHide?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(d,{key:0,"sucker-canvas":a.suckerCanvas,"sucker-area":a.suckerArea,onOpenSucker:a.openSucker,onSelectSucker:a.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),e.createVNode(p,{name:"HEX",color:a.modelHex,onInputColor:a.inputHex,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(p,{name:"RGBA",color:a.modelRgba,onInputColor:a.inputRgba,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(m,{color:a.rgbaString,"colors-default":a.colorsDefault,"colors-history-key":a.colorsHistoryKey,onSelectColor:a.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),e.createCommentVNode(" custom options "),e.renderSlot(a.$slots,"default")],6)}vt.render=Gf,vt.__file="src/color/ColorPicker.vue",vt.install=a=>{a.component(vt.name,vt)};const W4="",Xf={class:"color-picker-wrapper"},mo=e.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(a,{emit:t}){const o=a,r=e.ref(!1),n=e.ref(null),s=e.ref(null),i=e.ref(0),l=e.ref(0),c=async f=>{s.value=f,r.value=!0,await e.nextTick();const g=f.getBoundingClientRect(),b=n.value,h=(b==null?void 0:b.offsetHeight)||300,y=window.innerHeight-g.bottom,C=g.top,v=y<h&&C>h;console.log("pickerHeight = "+h),i.value=v?g.top-h-8:g.bottom+8,l.value=g.left,setTimeout(()=>{window.addEventListener("click",d)},0)},u=e.computed(()=>({position:"fixed",top:`${i.value}px`,left:`${l.value}px`,zIndex:1e3})),d=f=>{const g=f.target;n.value&&!n.value.contains(g)&&(r.value=!1,t("update:color",p.value),window.removeEventListener("click",d))};e.onBeforeUnmount(()=>{window.removeEventListener("click",d)}),e.watch(()=>o.color,f=>{r.value||(p.value=f)});const p=e.ref(o.color),m=f=>{const{r:g,g:b,b:h,a:y}=f.rgba;p.value=`rgba(${g}, ${b}, ${h}, ${y})`};return(f,g)=>(e.openBlock(),e.createElementBlock("div",Xf,[e.renderSlot(f.$slots,"clickable",{openPicker:c,bgColor:f.color}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:n,class:"color-picker",style:e.normalizeStyle(u.value)},[e.createVNode(e.unref(vt),{class:"color-picker-box",theme:"light",color:f.color,onChangeColor:m},null,8,["color"])],4)):e.createCommentVNode("",!0)]))}}),q4="",Qf={class:"ao-card-project-phase__header"},Jf={class:"ao-card-project-item__title-line"},eh={key:0,class:"ao-card-project-item-phase__estimation"},th={class:"ao-card-project-phase__footer"},ah={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},oh={class:"ao-card-project-phase__subitem"},rh={class:"ao-card-project-phase__subitem"},nh={key:0,class:"ao-card-project-phase__secondary"},ih={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},sh=e.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(a,{emit:t}){const o=a,r=p=>{t("update:title",p)},n=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.reduce((m,f)=>{var g;return m+((g=f.activities)==null?void 0:g.reduce((b,h)=>b+(h.estimation||0),0))},0)}),s=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.length}),i=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.filter(m=>m.status===kt.done).length}),l=e.computed(()=>(i.value||0)/(s.value||1)),c=e.computed({get:()=>o.deadline??"",set:p=>t("update:deadline",p!=null&&p.length?p:null)}),u=e.computed({get:()=>o.color,set:p=>{t("updatePhase",{id:o.id,color:p})}}),d=(p,m)=>{const f=p.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m(f)};return(p,m)=>(e.openBlock(),e.createBlock(mo,{color:u.value,"onUpdate:color":m[2]||(m[2]=f=>u.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:g})=>[e.createVNode(ba,{class:"ao-card-project-phase","is-clickable":p.isEditable,color:g,withLeftBorder:!0,onClick:b=>d(b,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Jf,[e.createVNode(ne,{id:p.id,class:"ao-card-project-phase__title",title:p.name||"",level:4,"is-editable":p.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),n.value?(e.openBlock(),e.createElementBlock("span",eh," ("+e.toDisplayString(n.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",th,[s.value?(e.openBlock(),e.createElementBlock("div",ah,[e.createElementVNode("div",oh,[e.createVNode(Q,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",rh,e.toDisplayString(i.value)+" / "+e.toDisplayString(s.value),1)]),e.createVNode(ya,{percentages:l.value,class:"ao-card-project-phase__progress",color:p.color},null,8,["percentages","color"]),p.$slots.secondary?(e.openBlock(),e.createElementBlock("div",nh,[e.renderSlot(p.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-card-project-phase__footer-row",c.value?"":"ao-card-project-phase__no_deadline"])},[p.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=b=>c.value=b),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",ih,e.toDisplayString(e.unref(ra)(p.deadline)),1)],2)])]),_:2},[p.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",Qf,[e.createVNode(Y,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>p.active?p.$emit("archivePhase",{id:p.id}):p.$emit("unarchivePhase",{id:p.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),Y4="",lh=e.defineComponent({__name:"AoBadge",props:{color:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("span",{class:"aoBadge",style:e.normalizeStyle({backgroundColor:t.color})},null,4))}}),K4="",ch={class:"ao-card-project-milestone__default"},dh={class:"ao-title-with-badge-wrapper"},ph={class:"ao-card-project-item__title-line"},uh={key:0,class:"ao-card-project-item-milestone__estimation"},mh={key:0,class:"ao-card-project-milestone__archive"},fh={class:"ao-card-project-milestone__activities"},hh={class:"ao-card-project-milestone__activities-row"},gh={class:"ao-card-project-milestone__subitem"},_h={class:"ao-card-project-milestone__subitem"},vh={key:1,class:"ao-card-project-milestone__secondary"},Ch={class:"ao-card-project-milestone__footer"},bh={key:1,class:"ao-field ao-card-project-milestone__deadline"},yh={class:"ao-field__label"},wh={key:2,class:"ao-card-project-milestone__assignee"},kh=e.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}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(a,{emit:t}){const o=a,r=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.reduce((u,d)=>u+(d.estimation||0),0)}),n=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.length}),s=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.filter(u=>ja(u,o.closedStatus)).length}),i=e.computed(()=>(s.value||0)/(n.value||1)),l=c=>{t("updateMilestone",{id:o.id,name:c})};return(c,u)=>(e.openBlock(),e.createBlock(ba,{class:e.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!c.readonly,"tag-name":"li","is-selected":c.isSelected,color:c.phaseColor},{default:e.withCtx(()=>[e.createElementVNode("div",ch,[e.createElementVNode("div",dh,[e.createVNode(lh,{color:c.color||""},null,8,["color"]),e.createElementVNode("div",ph,[e.createVNode(ne,{id:c.id,title:c.name||"",level:5,"is-editable":!c.readonly&&c.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":l},null,8,["id","title","is-editable"]),r.value?(e.openBlock(),e.createElementBlock("span",uh," ("+e.toDisplayString(r.value)+")",1)):e.createCommentVNode("",!0)])]),!c.readonly&&c.isEditable?(e.openBlock(),e.createElementBlock("div",mh,[e.createVNode(Y,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:c.active?c.$t("archive"):c.$t("unarchive"),onClick:u[0]||(u[0]=e.withModifiers(()=>c.active?c.$emit("archiveMilestone",{id:c.id}):c.$emit("unarchiveMilestone",{id:c.id}),["stop"]))},null,8,["label"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",fh,[e.createElementVNode("div",hh,[n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",gh,[e.createVNode(Q,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",_h,e.toDisplayString(s.value)+" / "+e.toDisplayString(n.value),1)]),e.createVNode(ya,{percentages:i.value,color:c.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):e.createCommentVNode("",!0),c.$slots.secondary?(e.openBlock(),e.createElementBlock("div",vh,[e.renderSlot(c.$slots,"secondary")])):e.createCommentVNode("",!0)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",Ch,[c.important?(e.openBlock(),e.createBlock(Q,{key:0,name:"FlagRounded",class:e.normalizeClass(c.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):e.createCommentVNode("",!0),c.deadline?(e.openBlock(),e.createElementBlock("label",bh,[e.createElementVNode("span",yh,e.toDisplayString(e.unref(ra)(c.deadline)),1)])):e.createCommentVNode("",!0),c.assignee?(e.openBlock(),e.createElementBlock("div",wh,[e.createVNode(ye,{"user-name":e.unref(er)(c.assignee),"avatar-url":c.assignee.avatarUrl,color:c.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):e.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}}),G4="",$h={class:"ao-mapping-card-project-phase__header"},Eh={class:"ao-card-project-item__title-line"},Bh={key:0,class:"ao-card-project-item-phase__estimation"},Vh={class:"ao-mapping-card-project-phase__footer"},Sh={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},Nh={class:"ao-mapping-card-project-phase__subitem"},xh={class:"ao-mapping-card-project-phase__subitem"},Mh={key:0,class:"ao-mapping-card-project-phase__secondary"},Th={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},Ah=e.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,r=p=>{t("update:title",p)},n=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.reduce((m,f)=>{var g;return m+((g=f.activities)==null?void 0:g.reduce((b,h)=>b+(h.estimation||0),0))},0)}),s=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.length}),i=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.filter(m=>m.status===kt.done).length}),l=e.computed(()=>(i.value||0)/(s.value||1)),c=e.computed({get:()=>o.deadline??"",set:p=>t("update:deadline",p!=null&&p.length?p:null)}),u=e.computed({get:()=>o.color,set:p=>{t("updatePhase",{id:o.id,color:p})}}),d=(p,m)=>{const f=p.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m()};return(p,m)=>(e.openBlock(),e.createBlock(mo,{color:u.value,"onUpdate:color":m[2]||(m[2]=f=>u.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:g})=>[e.createVNode(ba,{class:"ao-mapping-card-project-phase","is-clickable":p.isEditable,color:g,withLeftBorder:!0,onClick:b=>d(b,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Eh,[e.createVNode(ne,{id:p.id,class:"ao-mapping-card-project-phase__title",title:p.name||"",level:4,"is-editable":p.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),n.value?(e.openBlock(),e.createElementBlock("span",Bh," ("+e.toDisplayString(n.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",Vh,[s.value?(e.openBlock(),e.createElementBlock("div",Sh,[e.createElementVNode("div",Nh,[e.createVNode(Q,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",xh,e.toDisplayString(i.value)+" / "+e.toDisplayString(s.value),1)]),e.createVNode(ya,{percentages:l.value,class:"ao-mapping-card-project-phase__progress",color:u.value},null,8,["percentages","color"]),p.$slots.secondary?(e.openBlock(),e.createElementBlock("div",Mh,[e.renderSlot(p.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-mapping-card-project-phase__footer-row",c.value?"":"ao-mapping-card-project-phase__no_deadline"])},[p.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=b=>c.value=b),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",Th,e.toDisplayString(e.unref(ra)(p.deadline)),1)],2)])]),_:2},[p.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",$h,[e.createVNode(Y,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>p.active?p.$emit("archivePhase",{id:p.id}):p.$emit("unarchivePhase",{id:p.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),X4="",Oh={class:"ao-project-phase"},Ih={key:0,class:"ao-project-phase__drag ao-card__drag"},Lh={key:1,class:"ao-project-phase__col-phase"},jh={key:2,class:"ao-mapping-project-phase__col-phase"},Dh={key:0,class:"ao-project-phase__col-milestones"},Ph={class:"ao-project-phase__milestones-list-footer"},zh=e.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,{t:r}=We();e.watch(()=>o.phase.milestones,(C,v)=>{Te(C,v)});const n=C=>{t("updatePhase",{id:o.phase.id,name:C})},s=C=>{t("updatePhase",{id:o.phase.id,deadline:C})},i=C=>{t("updatePhase",C)},l=e.computed(()=>o.phase.milestones.map(C=>_2(C,o.closedStatus))),c=C=>{const{name:v,rank:_}=at(l.value??[],"milestone",r);t("addMilestone",{name:v,rank:_,phaseId:C})},u=C=>{t("updateMilestone",C)},d=C=>{t("archiveMilestone",C)},p=C=>{t("unarchiveMilestone",C)},m=C=>{t("archivePhase",C)},f=C=>{t("unarchivePhase",C)},g=C=>{"added"in C?t("updateMilestone",{id:C.added.element.id,phaseId:o.phase.id,rank:dt(l.value,C.added.newIndex)}):"removed"in C||"moved"in C&&t("updateMilestone",{id:C.moved.element.id,rank:dt(l.value,C.moved.newIndex)})},b=Le.useRoute(),h=e.computed(()=>b.path.includes("/mapping")),y=e.computed(()=>{var C;return o.phase.id!==((C=b.params)==null?void 0:C.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:C2(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(C,v)=>(e.openBlock(),e.createElementBlock("li",Oh,[e.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:e.normalizeStyle(y.value)},[C.isEditable?(e.openBlock(),e.createElementBlock("div",Ih,[e.createVNode(Q,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("div",jh,[e.createVNode(Ah,{id:C.phase.id,milestones:l.value,name:C.phase.name,deadline:C.phase.deadline,active:C.phase.active,"is-editable":C.isEditable,color:C.phase.color,"onUpdate:deadline":s,"onUpdate:title":n,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:i},null,8,["id","milestones","name","deadline","active","is-editable","color"])])):(e.openBlock(),e.createElementBlock("div",Lh,[e.createVNode(sh,{id:C.phase.id,milestones:l.value,name:C.phase.name,deadline:C.phase.deadline,active:C.phase.active,"is-editable":C.isEditable,color:C.phase.color,"onUpdate:deadline":s,"onUpdate:title":n,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:i},null,8,["id","milestones","name","deadline","active","is-editable","color"])]))],4),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Dh,[e.createElementVNode("div",{class:"ao-project-phase__milestones",style:e.normalizeStyle(y.value)},[e.createVNode(e.unref(je),e.mergeProps({class:"ao-project-phase__milestones-list",list:l.value,disabled:C.readonly||!C.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:g}),{item:e.withCtx(({element:_})=>{var B;return[e.createVNode(kh,{id:_.id,name:_.name,color:_.color,"phase-color":C.phase.color,activities:_.activities,deadline:_.deadline,active:_.active,"is-editable":!C.readonly&&C.isEditable,"is-draggable":!C.readonly&&C.isEditable,"closed-status":C.closedStatus,"is-selected":_.id===((B=C.$route.params)==null?void 0:B.milestoneId),assignee:_.assignee,important:_.important,readonly:C.readonly,class:e.normalizeClass(["ao-project-phase__milestone"]),onClick:$=>!C.readonly&&C.$router.push({name:e.unref(re).milestone,params:{phaseId:C.phase.id,milestoneId:_.id}}),onUpdateMilestone:u,onArchiveMilestone:d,onUnarchiveMilestone:p},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","onClick"])]}),_:1},16,["list","disabled"]),e.createElementVNode("div",Ph,[C.isEditable?(e.openBlock(),e.createBlock(Pe,{key:0,label:C.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:v[0]||(v[0]=()=>c(C.phase.id))},null,8,["label"])):e.createCommentVNode("",!0)])],4)]))]))}}),Q4="",Hh={class:"ao-project__phases"},Rh={key:0,class:"ao-project-phase__phases-list-footer"},Uh=e.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1),Fh={class:"ao-project-phase__col-phase"},Zh=e.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1),fo=e.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a;e.watch(()=>o.phases,(m,f)=>{Te(m,f)});const r=m=>{t("addMilestone",m)},n=m=>{t("updateMilestone",m)},s=m=>{t("archiveMilestone",m)},i=m=>{t("unarchiveMilestone",m)},l=m=>{t("archivePhase",m)},c=m=>{t("unarchivePhase",m)},u=m=>{if(m.moved){const f=Ot(m,o.phases??[]);t("updatePhase",{id:m.moved.element.id,rank:f})}},d=m=>{t("updatePhase",m)},p=m=>{t("addPhase",m)};return(m,f)=>(e.openBlock(),e.createElementBlock("div",Hh,[e.createVNode(e.unref(je),{class:"ao-project-phase__phases-list","model-value":m.phases,"item-key":"id",handle:".ao-card__drag",onChange:u},{item:e.withCtx(({element:g})=>[e.createVNode(zh,{phase:g,"is-editable":!m.readonly&&m.isEditable,"closed-status":m.closedStatus,users:m.users,readonly:m.readonly,onAddMilestone:r,onUpdateMilestone:n,onArchiveMilestone:s,onUnarchiveMilestone:i,onUpdatePhase:d,onArchivePhase:l,onUnarchivePhase:c},null,8,["phase","is-editable","closed-status","users","readonly"])]),_:1},8,["model-value"]),m.isEditable?(e.openBlock(),e.createElementBlock("div",Rh,[Uh,e.createElementVNode("div",Fh,[e.createVNode(Pe,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),Zh])):e.createCommentVNode("",!0)]))}}),J4="",Wh=["onSubmit"],qh={class:"ao-add-template-modal__form-body"},Yh={class:"field__row"},Kh={class:"ao-add-template-modal__form-footer"},Ar=e.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(a,{emit:t}){const o=a,r=e.computed(()=>o.templates.map(l=>({value:l.id,label:l.name}))),n=e.ref(null),s=l=>{n.value=l},i=()=>{n.value&&t("apply",n.value,o.projectId)};return(l,c)=>(e.openBlock(),e.createBlock(na,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:l.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:e.withModifiers(i,["prevent"])},[e.createElementVNode("p",null,e.toDisplayString(l.$t("project.template.apply.notice")),1),e.createElementVNode("div",qh,[e.createElementVNode("div",Yh,[e.createVNode(ce,{value:n.value,options:r.value,detached:!0,onChange:s},null,8,["value","options"])])]),e.createElementVNode("footer",Kh,[e.createVNode(Y,{label:l.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:i},null,8,["label"])])],40,Wh)]),_:1}))}}),e9="",Gh=["onSubmit"],Xh={class:"ao-save-template-modal__form-body"},Qh={class:"field__row"},Jh={class:"ao-field ao-field--inline"},e5={class:"ao-field__label"},t5={class:"ao-save-template-modal__phases"},a5={class:"ao-field__label"},o5={class:"ao-save-template-modal__phases-list"},r5=["value"],n5={class:"ao-save-template-modal__form-footer"},Or=e.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(a,{emit:t}){const o=a,r=e.ref(""),n=e.ref([]);e.onMounted(()=>{n.value=o.phases.map(i=>i.id)});const s=()=>{r.value&&t("save",r.value,n.value)};return(i,l)=>(e.openBlock(),e.createBlock(na,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:i.$t("project.template.save.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:e.withModifiers(s,["prevent"])},[e.createElementVNode("div",Xh,[e.createElementVNode("div",Qh,[e.createElementVNode("label",Jh,[e.createElementVNode("span",e5,e.toDisplayString(i.$t("project.template.name.label"))+": ",1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),type:"text"},null,512),[[e.vModelText,r.value]])])]),e.createElementVNode("div",t5,[e.createElementVNode("div",a5,e.toDisplayString(i.$t("project.template.phases.label")),1),e.createElementVNode("div",o5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.phases,c=>(e.openBlock(),e.createElementBlock("label",{class:"ao-field ao-field--checkbox",key:c.id},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:c.id,"onUpdate:modelValue":l[1]||(l[1]=u=>n.value=u)},null,8,r5),[[e.vModelCheckbox,n.value]]),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]))),128))])])]),e.createElementVNode("footer",n5,[e.createVNode(Y,{label:i.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:s},null,8,["label"])])],40,Gh)]),_:1}))}}),t9="",i5=e.defineComponent({props:{modelValue:{type:[String,Number],required:!0},tabs:{type:Array,required:!0}},emits:["update:modelValue"],methods:{selectTab(a){this.$emit("update:modelValue",a)}}}),a9="",s5={class:"tabbar-wrapper"},l5=["onClick"];function c5(a,t,o,r,n,s){return e.openBlock(),e.createElementBlock("div",s5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tabs,i=>(e.openBlock(),e.createElementBlock("button",{key:i.value,class:e.normalizeClass(["tab-button",{"tab-button--active":i.value===a.modelValue}]),type:"button",onClick:l=>a.selectTab(i.value)},e.toDisplayString(i.label),11,l5))),128))])}const wa=D(i5,[["render",c5],["__scopeId","data-v-ff4e3297"]]),d5={class:"ao-project"},p5={class:"ao-project__body"},u5=e.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}},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(a,{emit:t}){const o=a,{t:r}=We(),n=e.computed(()=>o.phases.flatMap(E=>E.milestones)),s=()=>{const{name:E,rank:j}=at(o.phases,"phase",r);t("addPhase",{name:E,rank:j,projectId:o.project.id})},i=E=>{t("updatePhase",E)},l=E=>{t("archivePhase",E)},c=E=>{t("unarchivePhase",E)},u=E=>{t("copyPhaseToTemplate",E)},d=E=>{t("addMilestone",E)},p=E=>{t("updateMilestone",E)},m=E=>{t("archiveMilestone",E)},f=E=>{t("unarchiveMilestone",E)},g=E=>{t("addActivity",E)},b=E=>{t("update:activity",E)},h=E=>{t("archiveActivity",E)},y=E=>{t("unarchiveActivity",E)},C=E=>{t("addSubtask",E)},v=E=>{t("updateSubtask",E)},_=E=>{t("deleteSubtask",E)},B=e.computed(()=>n.value.flatMap(E=>E.activities)),$=E=>{t("addFiles",E)},N=E=>{t("removeFile",E)},A=E=>{t("addComment",E)},z=E=>{t("updateComment",E)},U=E=>{t("removeComment",E)},Z=e.ref(!1),O=e.ref(!1),H=(E,j)=>{t("applyTemplate",{templateId:E,projectId:j}),Z.value=!1},K=(E,j)=>{var w;const V=(w=o.templates)==null?void 0:w.at(-1),T=V?ie.LexoRank.parse(V.rank).genNext():ie.LexoRank.middle();t("saveTemplate",{templateName:E,rank:T.format(),phaseIds:j}),O.value=!1},W=Le.useRouter(),F=e.ref("overview"),S=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(F,E=>{E==="feed"?(W.push({name:re.feed}),console.log("Navigating to feed...")):E==="overview"?(W.push({name:re.project}),console.log("Navigating to feed...")):E==="mapping"&&(W.push({name:re.mapping}),console.log("Navigating to feed..."))}),(E,j)=>{const V=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-overview"},E.$attrs),[e.createElementVNode("div",d5,[e.createVNode(It,null,{primary:e.withCtx(()=>[e.createVNode(wa,{tabs:S,modelValue:F.value,"onUpdate:modelValue":j[0]||(j[0]=T=>F.value=T)},null,8,["modelValue"]),e.createVNode(Y,{class:"ao-feed__show-archived",size:"sm","icon-name":E.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:E.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":E.showsArchived,onClick:j[1]||(j[1]=T=>E.$emit("update:showsArchived",!E.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[E.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:E.$t("project.template.save.label"),onClick:j[2]||(j[2]=T=>O.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),E.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:1,class:"ao-project-overview__add-template",color:"primary",label:E.$t("project.template.apply.label"),onClick:j[3]||(j[3]=T=>Z.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",p5,[e.createVNode(fo,{phases:E.phases,"closed-status":E.closedStatus,"is-editable":E.isEditable===!0,users:E.users,onAddMilestone:d,onUpdateMilestone:p,onArchiveMilestone:m,onUnarchiveMilestone:f,onAddPhase:s,onUpdatePhase:i,onArchivePhase:l,onUnarchivePhase:c,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users"])])]),e.createVNode(V,{class:"ao-project__sidebar",phases:E.phases,"project-id":E.project.id,"project-name":E.project.name,users:E.users,"is-editable":E.isEditable===!0,"closed-status":E.closedStatus,onClose:j[4]||(j[4]=T=>E.$router.push({name:e.unref(re).project})),onUpdateMilestone:p,onAddActivity:g,onUpdateActivity:b,onArchiveActivity:h,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(V,{name:"modal",activities:B.value,"is-task-checkable":E.isTaskCheckable,statuses:E.statuses,"activity-types":E.activityTypes,phases:E.phases,project:E.project,users:E.users,"user-id":E.userId,"is-editable":E.isEditable,"attachment-enabled":E.attachmentEnabled,"onUpdate:activity":b,onAddSubtask:C,onUpdateSubtask:v,onDeleteSubtask:_,onAddFiles:$,onRemoveFile:N,onAddComment:A,onUpdateComment:z,onRemoveComment:U},{default:e.withCtx(({Component:T})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(T),null,{default:e.withCtx(w=>[e.renderSlot(E.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(w)))]),_:2},1024))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled"])]))],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[O.value?(e.openBlock(),e.createBlock(Or,{key:0,phases:E.phases,onClose:j[5]||(j[5]=T=>O.value=!1),onSave:K},null,8,["phases"])):e.createCommentVNode("",!0),Z.value?(e.openBlock(),e.createBlock(Ar,{key:1,"project-id":E.project.id,templates:E.templates,onClose:j[6]||(j[6]=T=>Z.value=!1),onApply:H},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64)}}}),o9="",m5={class:"ao-card-feed__header"},f5={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},h5={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},g5={class:"ao-card-feed__body"},_5={key:0,class:"ao-card-feed__breadcrumbs"},v5={class:e.normalizeClass(["ao-card-feed__title-group"])},C5={class:"ao-card-feed__title-line"},b5={key:0,class:"ao-card-feed__slug"},y5={key:1,class:"ao-card-feed__deadline"},w5={class:"ao-card-feed__footer"},k5={class:"ao-card-feed__footer-row"},$5={class:"ao-assignees"},E5={key:0,class:"ao-assignee"},B5={key:0,class:"ao-card-feed__subitems"},V5={key:0,class:"ao-card-feed__subitem"},S5={class:"ao-card-feed__subitem"},N5={key:1,class:"ao-card-feed__subitem"},x5={class:"ao-card-feed__subitem"},M5={class:"ao-card-feed__footer-row"},T5={key:0,class:"ao-card-feed__progress-wrapper"},A5={class:"ao-card-feed__subitem"},O5={class:"ao-card-feed__subitem"},ho=e.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(a,{emit:t}){const o=a,r=e.computed(()=>o.tagType==="milestone"?o.milestoneName:o.projectName),n=e.computed(()=>o.tagType==="milestone"?o.milestoneColor:o.projectColor),s=g=>{t("updateActivity",{id:o.id,name:g})},i=e.computed(()=>o.tagType==="milestone"&&o.phaseName?`${o.phaseName}`:o.phaseName&&o.milestoneName?`${o.phaseName} / ${o.milestoneName}`:""),l=e.computed(()=>o.assignee?[o.assignee]:[]),c=e.computed(()=>ra(o.deadline)),u=g=>{t("removeAssignee",g)},d=()=>{t("startTimer",{activityId:o.id,name:o.name,project:o.projectName,projectId:o.projectId,slug:o.slug})},p=e.computed(()=>{var g;return(g=o.tasks)==null?void 0:g.length}),m=e.computed(()=>{var g;return(g=o.tasks)==null?void 0:g.filter(b=>b.isDone).length}),f=e.computed(()=>(m.value||0)/(p.value||1));return(g,b)=>(e.openBlock(),e.createBlock(ba,{class:e.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":g.isClosed}]),"is-clickable":!0},{header:e.withCtx(()=>[e.createElementVNode("div",m5,[r.value?(e.openBlock(),e.createBlock(wt,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:g.projectColor?void 0:"primary","raw-color":n.value},null,8,["label","color","raw-color"])):e.createCommentVNode("",!0),g.isPrivate||g.important||g.isClosed?(e.openBlock(),e.createElementBlock("div",f5,[g.isPrivate?(e.openBlock(),e.createBlock(Q,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):e.createCommentVNode("",!0),g.important?(e.openBlock(),e.createBlock(Q,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):e.createCommentVNode("",!0),g.isClosed?(e.openBlock(),e.createBlock(Q,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),g.$slots.secondary?(e.openBlock(),e.createElementBlock("div",h5,[e.createVNode(Q,{name:"TimerOutline",class:"ao-card-feed__timer",size:"sm",onClick:e.withModifiers(d,["stop"])},null,8,["onClick"]),e.renderSlot(g.$slots,"secondary")])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createElementVNode("div",g5,[i.value?(e.openBlock(),e.createElementBlock("span",_5,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",v5,[e.createElementVNode("div",C5,[g.slug?(e.openBlock(),e.createElementBlock("span",b5,e.toDisplayString(g.slug)+": ",1)):e.createCommentVNode("",!0),e.createVNode(ne,{id:g.id,title:g.name,level:5,"is-editable":g.isEditable,"onUpdate:title":s,class:"ao-card-feed__title-inline"},null,8,["id","title","is-editable"])])]),g.deadline?(e.openBlock(),e.createElementBlock("span",y5,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",w5,[e.createElementVNode("div",k5,[e.createElementVNode("ul",$5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:h.id},[h?(e.openBlock(),e.createElementBlock("li",E5,[e.createVNode(ye,{"user-name":e.unref(er)(h),"avatar-url":h.avatarUrl,"is-closable":!0,onClose:()=>u(h.id)},null,8,["user-name","avatar-url","onClose"])])):e.createCommentVNode("",!0)],64))),128))]),g.comments||g.attachments?(e.openBlock(),e.createElementBlock("ul",B5,[g.comments?(e.openBlock(),e.createElementBlock("li",V5,[e.createVNode(Q,{name:"ChatOutline",size:"sm"}),e.createElementVNode("span",S5,e.toDisplayString(g.comments),1)])):e.createCommentVNode("",!0),g.attachments?(e.openBlock(),e.createElementBlock("li",N5,[e.createVNode(Q,{name:"AttachFileRounded",size:"sm"}),e.createElementVNode("span",x5,e.toDisplayString(g.attachments),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",M5,[g.tasks&&g.tasks.length?(e.openBlock(),e.createElementBlock("div",T5,[e.createElementVNode("div",A5,[e.createVNode(Q,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",O5,e.toDisplayString(m.value)+" / "+e.toDisplayString(p.value),1)]),e.createVNode(ya,{percentages:f.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):e.createCommentVNode("",!0)])])]),_:3},8,["class"]))}}),r9="",I5={class:"ao-project-milestone"},L5={class:"ao-project-milestone__header"},j5={class:"ao-project-milestone__header_line"},D5={class:"ao-project-milestone__header_line"},P5={class:"ao-project-milestone__title"},z5={key:0,class:"ao-fieldset ao-milestone__fieldset"},H5={class:"ao-field__row ao-milestone__field-row"},R5={class:"ao-field ao-field--inline"},U5={class:"ao-field__row ao-milestone__field-row"},F5={class:"ao-field ao-milestone__field-multiselect"},Z5=["onClick"],W5={class:"ao-project-milestone__body"},q5={key:0,class:"ao-project-milestone__footer"},Ir=e.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(a,{emit:t}){const o=a,{t:r}=We(),n=_=>{var B;t("startTimer",_),(B=window.parent)==null||B.postMessage({type:"startTimer",data:_},"*")},s=e.computed(()=>{var _;return(_=o.phases)==null?void 0:_.find(B=>B.id===o.phaseId)}),i=e.computed(()=>{var _;return(_=o.phases)==null?void 0:_.flatMap(B=>B.milestones)}),l=e.computed(()=>{var _;return(_=i.value)==null?void 0:_.find(B=>B.id===o.milestoneId)}),c=e.computed(()=>{var _;return(_=l.value)==null?void 0:_.activities});e.watch(c,(_,B)=>{Te(_,B)});const u=_=>{t("close",_)},d=()=>{const{name:_,rank:B}=at(c.value??[],"activity",r);t("addActivity",{milestoneId:o.milestoneId,name:_,rank:B,projectId:o.projectId})},p=_=>{t("updateActivity",_)},m=_=>{c.value&&"moved"in _&&t("updateActivity",{id:_.moved.element.id,rank:dt(c.value,_.moved.newIndex)})},f=e.computed({get:()=>{var _;return(_=l.value)==null?void 0:_.color},set:_=>{l.value&&t("updateMilestone",{id:l.value.id,color:_})}}),g=e.computed({get:()=>{var _;return((_=l==null?void 0:l.value)==null?void 0:_.deadline)??""},set:_=>{l.value&&t("updateMilestone",{id:l.value.id,deadline:_!=null&&_.length?_:null})}}),b=_=>o.closedStatus?ja(_,o.closedStatus):!1,h=e.computed(()=>{var _;return((_=o.users)==null?void 0:_.map(B=>({label:`${B.firstName} ${B.lastName}`,value:B.id,avatar:B.avatarUrl})))||[]}),y=e.computed({get(){var _,B;return(B=(_=l.value)==null?void 0:_.assignee)!=null&&B.id?[l.value.assignee.id]:[]},set(_){t("updateMilestone",{id:o.milestoneId,assigneeId:_[0]??null})}}),C=e.computed({get(){var _;return((_=l.value)==null?void 0:_.important)??!1},set(_){t("updateMilestone",{id:o.milestoneId,important:_})}}),v=(_,B)=>{const $=_.currentTarget;$ instanceof HTMLElement&&B($)};return(_,B)=>{var $;return e.openBlock(),e.createElementBlock("div",I5,[e.createElementVNode("header",L5,[e.createElementVNode("div",j5,[e.createVNode(Y,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:u})]),e.createElementVNode("div",D5,[e.createElementVNode("div",P5,[e.createVNode(ne,{title:(($=l.value)==null?void 0:$.name)||_.milestoneId,level:5},null,8,["title"]),e.createVNode(to,{modelValue:C.value,"onUpdate:modelValue":B[0]||(B[0]=N=>C.value=N),modelModifiers:{lazy:!0},disabled:!_.isEditable,class:"ao-milestone__important",color:"danger",label:_.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),l.value?(e.openBlock(),e.createElementBlock("div",z5,[e.createElementVNode("div",H5,[e.createElementVNode("label",R5,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[1]||(B[1]=N=>g.value=N),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[e.vModelText,g.value,void 0,{lazy:!0}]])])]),e.createElementVNode("div",U5,[e.createElementVNode("label",F5,[e.createVNode(ce,{modelValue:y.value,"onUpdate:modelValue":B[2]||(B[2]=N=>y.value=N),options:h.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:_.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!_.isEditable,caret:_.isEditable},{tag:e.withCtx(({option:N,handleTagRemove:A})=>[e.createVNode(ye,{"user-name":N.label,"avatar-url":N.avatar,"is-closable":!0,onClose:z=>A(N,z)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),e.createVNode(mo,{color:f.value,"onUpdate:color":B[3]||(B[3]=N=>f.value=N)},{clickable:e.withCtx(({openPicker:N,bgColor:A})=>[e.createElementVNode("button",{style:e.normalizeStyle({background:A}),class:"color-button",onClick:z=>v(z,N)},null,12,Z5)]),_:1},8,["color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",W5,[e.createVNode(e.unref(je),e.mergeProps({class:"ao-project-milestone__activities",list:c.value,disabled:!_.isEditable,"item-key":"id",group:"kanban"},_.$attrs,{onChange:m}),{item:e.withCtx(({element:N})=>{var A,z,U,Z,O;return[e.createVNode(ho,{id:N.id,name:N.name||N.id,"project-id":_.projectId,"phase-name":(A=s.value)==null?void 0:A.name,"milestone-name":(z=l.value)==null?void 0:z.name,"milestone-color":(U=l.value)==null?void 0:U.color,deadline:N.deadline,important:N.important,users:_.users,assignee:N.assignee,slug:N.slug,comments:(Z=N.comments)==null?void 0:Z.length,attachments:(O=N.attachments)==null?void 0:O.length,tasks:N.tasks,"is-editable":_.isEditable,"is-private":N.private,"is-closed":b(N),onClick:H=>_.$router.push({name:e.unref(re).activity,params:{milestoneId:_.milestoneId,activityId:N.id}}),onUpdateActivity:p,onRemoveAssignee:()=>p({id:N.id,assigneeId:null}),onStartTimer:n},e.createSlots({_:2},[_.isEditable?{name:"secondary",fn:e.withCtx(()=>[_.isEditable&&N.active?(e.openBlock(),e.createBlock(Y,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:_.$t("archive"),onClick:e.withModifiers(()=>_.$emit("archiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),_.isEditable&&!N.active?(e.openBlock(),e.createBlock(Y,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:_.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>_.$emit("unarchiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.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"]),_.isEditable?(e.openBlock(),e.createElementBlock("div",q5,[e.createVNode(Pe,{"icon-name":"Add",label:_.$t("project.activity.add"),onClick:d},null,8,["label"])])):e.createCommentVNode("",!0)])])}}}),n9="",Y5=e.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(a,{emit:t}){const o=a,r=e.computed(()=>{var h;return(h=o.phases)==null?void 0:h.find(y=>y.id===o.phaseId)}),n=e.computed(()=>{var h;return(h=o.phases)==null?void 0:h.flatMap(y=>y.milestones)}),s=e.computed(()=>{var h;return(h=n.value)==null?void 0:h.find(y=>y.id===o.milestoneId)}),i=e.computed(()=>{var h;return console.log("=== AoProjectOverviewActivityDetails debug ==="),console.log("props.timeTrackingData:",JSON.stringify(o.timeTrackingData,null,2)),console.log("props.activityId:",o.activityId),(h=o.activities)==null?void 0:h.find(y=>y.id===o.activityId)}),l=h=>{t("update:activity",h)},c=h=>{t("addSubtask",h)},u=h=>{t("updateSubtask",h)},d=h=>{t("deleteSubtask",h)},p=h=>{t("addFiles",h)},m=h=>{t("removeFile",h)},f=h=>{t("addComment",h)},g=h=>{t("updateComment",h)},b=h=>{t("removeComment",h)};return(h,y)=>{var C,v;return i.value?(e.openBlock(),e.createBlock(ao,{key:0,activity:i.value,"activity-types":h.activityTypes,"milestone-id":h.milestoneId,"template-activities":h.activities,"is-template":!1,users:h.users,"user-id":h.userId,"is-task-checkable":h.isTaskCheckable,statuses:h.statuses,breadcrumbs:`${(C=r.value)==null?void 0:C.name} / ${(v=s.value)==null?void 0:v.name}`,"is-editable":h.isEditable,"attachment-enabled":h.attachmentEnabled,projects:[h.project],"time-tracking-data":h.timeTrackingData,onClose:h.$router.back,"onUpdate:activity":l,onAddSubtask:c,onUpdateSubtask:u,onDeleteSubtask:d,onAddFiles:p,onRemoveFile:m,onAddComment:f,onUpdateComment:g,onRemoveComment:b},{default:e.withCtx(_=>[e.renderSlot(h.$slots,"default",e.normalizeProps(e.guardReactiveProps(_)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","onClose"])):e.createCommentVNode("",!0)}}}),K5={class:"ao-col-header"},G5=e.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("header",K5,[e.createVNode(ne,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(e.openBlock(),e.createBlock(wt,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):e.createCommentVNode("",!0)]))}}),i9="";function X5(a){return e.getCurrentScope()?(e.onScopeDispose(a),!0):!1}function ka(a){return typeof a=="function"?a():e.unref(a)}const Q5=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const J5=a=>a!=null,Rt=()=>{};function e7(a,t){function o(...r){return new Promise((n,s)=>{Promise.resolve(a(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(n).catch(s)})}return o}function t7(a,t={}){let o,r,n=Rt;const s=l=>{clearTimeout(l),n(),n=Rt};return l=>{const c=ka(a),u=ka(t.maxWait);return o&&s(o),c<=0||u!==void 0&&u<=0?(r&&(s(r),r=null),Promise.resolve(l())):new Promise((d,p)=>{n=t.rejectOnCancel?p:d,u&&!r&&(r=setTimeout(()=>{o&&s(o),r=null,d(l())},u)),o=setTimeout(()=>{r&&s(r),r=null,d(l())},c)})}}function a7(a,t=200,o={}){return e7(t7(t,o),a)}function go(a){var t;const o=ka(a);return(t=o==null?void 0:o.$el)!=null?t:o}const o7=Q5?window:void 0;function r7(){const a=e.ref(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{a.value=!0},t),a}function n7(a){const t=r7();return e.computed(()=>(t.value,!!a()))}function i7(a,t,o={}){const{root:r,rootMargin:n="0px",threshold:s=.1,window:i=o7,immediate:l=!0}=o,c=n7(()=>i&&"IntersectionObserver"in i),u=e.computed(()=>{const g=ka(a);return(Array.isArray(g)?g:[g]).map(go).filter(J5)});let d=Rt;const p=e.ref(l),m=c.value?e.watch(()=>[u.value,go(r),p.value],([g,b])=>{if(d(),!p.value||!g.length)return;const h=new IntersectionObserver(t,{root:go(b),rootMargin:n,threshold:s});g.forEach(y=>y&&h.observe(y)),d=()=>{h.disconnect(),d=Rt}},{immediate:l,flush:"post"}):Rt,f=()=>{d(),m(),p.value=!1};return X5(f),{isSupported:c,isActive:p,pause(){d(),p.value=!1},resume(){p.value=!0},stop:f}}const s7={class:e.normalizeClass(["ao-list-kanban"])},l7={class:"ao-list-kanban__header"},c7={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},d7={key:1,class:"ao-list-kanban__end"},p7={key:0,class:"ao-list-kanban__no-more"},u7={key:1,class:"ao-list-kanban__divider"},m7={key:1,class:"ao-list-kanban__footer"},f7=e.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{}},emits:["add","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(a,{emit:t}){const o=a,r=e.ref(!1),n=e.ref(null);i7(n,([{isIntersecting:d}])=>{r.value=d}),e.watch(r,d=>{d&&o.hasMore&&!o.isLoading&&t("loadMore")});const s=d=>{var p;return o.isEditable===!0?!0:o.userId&&o.isEditable==="only-own"?o.userId===((p=d.assignee)==null?void 0:p.id):!1},i=d=>{t("selectActivity",d)},l=d=>{t("updateActivity",d)},c=d=>{"added"in d?t("updateActivity",{id:d.added.element.id,statusId:o.status.id,rank:dt(o.list,d.added.newIndex)}):"removed"in d||"moved"in d&&t("updateActivity",{id:d.moved.element.id,rank:dt(o.list,d.moved.newIndex)})},u=e.ref(!1);return(d,p)=>(e.openBlock(),e.createElementBlock("div",s7,[d.title||d.$slots.header?e.renderSlot(d.$slots,"header",{key:0},()=>{var m;return[e.createElementVNode("div",l7,[d.title?(e.openBlock(),e.createBlock(G5,{key:0,title:d.title,level:3,items:(m=d.list)==null?void 0:m.length},null,8,["title","items"])):e.createCommentVNode("",!0)])]}):e.createCommentVNode("",!0),e.createVNode(e.unref(je),e.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:d.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},d.$attrs,{draggable:".ao-list-draggable",disabled:!d.isEditable,onChange:c,onStart:p[1]||(p[1]=m=>u.value=!0),onEnd:p[2]||(p[2]=m=>u.value=!1),"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"}}),{item:e.withCtx(({element:m})=>{var f,g,b,h,y,C,v,_,B,$;return[e.createVNode(ho,{class:e.normalizeClass(s(m)?"ao-list-draggable":""),id:m.id,name:m.name,"project-name":(f=m.project)==null?void 0:f.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(b=m.project)==null?void 0:b.color,"phase-name":(y=(h=m.milestone)==null?void 0:h.phase)==null?void 0:y.name,"milestone-name":(C=m.milestone)==null?void 0:C.name,"milestone-color":(v=m.milestone)==null?void 0:v.color,deadline:m.deadline,rules:((_=m.rules)==null?void 0:_.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(B=m.comments)==null?void 0:B.length,attachments:($=m.attachments)==null?void 0:$.length,users:d.users,assignee:m.assignee,slug:m.slug,"is-editable":s(m),"is-private":m.private,"tag-type":d.tagType,onUpdateActivity:[N=>s(m)&&l(N),()=>s(m)&&l],onClick:()=>i(m.id),onRemoveAssignee:()=>s(m)&&l({id:m.id,assigneeId:null}),onStartTimer:p[0]||(p[0]=N=>d.$emit("startTimer",N))},{secondary:e.withCtx(()=>[s(m)&&m.active?(e.openBlock(),e.createBlock(Y,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.archive"),onClick:e.withModifiers(()=>d.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),s(m)&&!m.active?(e.openBlock(),e.createBlock(Y,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>d.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),_:2},1032,["class","id","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:e.withCtx(()=>[d.isLoading?(e.openBlock(),e.createElementBlock("div",c7,[e.createVNode(Q,{name:"Loading"})])):d.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:n,class:"ao-list-kanban__end"},null,512)):(e.openBlock(),e.createElementBlock("div",d7,[d.noMoreLabel?(e.openBlock(),e.createElementBlock("span",p7,e.toDisplayString(d.noMoreLabel),1)):d.isEditable?(e.openBlock(),e.createElementBlock("span",u7)):e.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),d.$slots.footer||d.footerLabel?(e.openBlock(),e.createElementBlock("div",m7,[e.renderSlot(d.$slots,"footer",{},()=>[d.isEditable?(e.openBlock(),e.createBlock(Pe,{key:0,"icon-name":"AddBoxOutlineRounded",label:d.footerLabel,onClick:p[3]||(p[3]=m=>d.$emit("add"))},null,8,["label"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]))}}),s9="",h7={class:"ao-field ao-search-field"},g7=["value","placeholder","onKeypress"],_7=e.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(a,{emit:t}){const o=a,r=async i=>{const c=i.target.value;t("update:modelValue",c,i)},n=a7(r,o.delay),s=i=>{t("clear",i)};return(i,l)=>(e.openBlock(),e.createElementBlock("div",h7,[e.createElementVNode("input",{value:i.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:i.placeholder,onInput:l[0]||(l[0]=(...c)=>e.unref(n)&&e.unref(n)(...c)),onKeypress:e.withKeys(r,["enter"])},null,40,g7),e.createVNode(Q,{name:"SearchRounded",class:e.normalizeClass(`ao-search-field__icon ao-search-field__action ${i.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),e.createVNode(Y,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:e.normalizeClass(`ao-search-field__button ao-search-field__action ${i.modelValue?"ao-search-field__action--visible":""}`),onClick:s},null,8,["class"])]))}}),l9="",v7={class:"ao-feed"},C7={class:"ao-feed__filters"},b7={class:"ao-feed__body"},Lr=e.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{}},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(a,{emit:t}){const o=a,{t:r}=We();function n(V,T){t("toast",V,T)}const s=e.toRef(o,"activities"),i=async(V,T)=>{await t("selectActivity",V,T)},l=e.ref({}),c=e.ref(!1),u=e.ref(!1),d=e.computed(()=>o.project?"milestone":"project");e.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([V,T,w,x],[R,P])=>{l.value=Object.fromEntries(V.map(M=>[M.id,T.filter(L=>{var ee;return((ee=L.status)==null?void 0:ee.id)===M.id})])),w&&!c.value?(i(w,null),c.value=!0):x&&!c.value&&(i(null,x),c.value=!0),u.value&&Te(T,P)},{immediate:!0});const p=e.computed(()=>{var V;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((V=o.selectedActivity.milestone.phase)==null?void 0:V.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=V=>{var P,M;const T=(P=o.activities)==null?void 0:P.at(-1),w=T?ie.LexoRank.parse(T.rank).genNext():ie.LexoRank.middle(),x=((M=o.activities)==null?void 0:M.length)??0,R={name:r("activity.defaultName",{idx:x+1}),rank:w.format(),statusId:V.id};o.filters.assigneeId.length>0&&(R.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(R.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(R.typeId=o.filters.typeId[0]),u.value=!0,t("addActivity",R)},f=(V,T)=>{u.value=!1,t("update:filters",{...o.filters,[V]:T})},g=e.computed(()=>o.project?[o.project]:o.projects??[]),b=e.computed(()=>g.value.map(V=>({value:V.id,label:V.name}))),h=e.computed(()=>{var V;return(V=o.activityTypes)==null?void 0:V.map(T=>({value:T.id,label:T.name}))}),y=e.computed(()=>o.users.map(V=>({value:V.id,label:`${V.firstName} ${V.lastName}`,avatar:V.avatarUrl}))),C=V=>{o.selectedActivity&&t("update:activity",V)},v=V=>{t("update:activity",V)},_=V=>{t("archiveActivity",V)},B=V=>{t("unarchiveActivity",V)},$=V=>{var T;t("startTimer",V),(T=window.parent)==null||T.postMessage({type:"startTimer",data:V},"*")},N=V=>{u.value=!1,t("update:searchText",V)},A=V=>{u.value=!1,t("clear:searchText",V)},z=V=>{o.selectedActivity&&t("addSubtask",V)},U=V=>{o.selectedActivity&&t("updateSubtask",V)},Z=V=>{o.selectedActivity&&t("deleteSubtask",V)},O=V=>{t("addFiles",V)},H=V=>{t("removeFile",V)},K=V=>{o.selectedActivity&&t("addComment",{...V,activityId:o.selectedActivity.id})},W=V=>{const{id:T}=o.selectedActivity||{};T&&t("updateComment",V)},F=V=>{const{id:T}=o.selectedActivity||{};T&&t("removeComment",V)},S=Le.useRouter(),E=e.ref("feed"),j=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(E,V=>{V==="feed"?(S.push({name:re.feed}),console.log("Navigating to feed...")):V==="overview"?(S.push({name:re.project}),console.log("Navigating to feed...")):V==="mapping"&&(S.push({name:re.mapping}),console.log("Navigating to feed..."))}),(V,T)=>{var w;return e.openBlock(),e.createElementBlock("div",v7,[e.createVNode(It,null,{primary:e.withCtx(()=>[e.createElementVNode("div",C7,[e.createVNode(wa,{tabs:j,modelValue:E.value,"onUpdate:modelValue":T[0]||(T[0]=x=>E.value=x)},null,8,["modelValue"]),e.createVNode(_7,{"model-value":V.searchText,placeholder:V.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":N,onClear:A},null,8,["model-value","placeholder"]),o.project?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ce,{key:0,"model-value":V.filters[e.unref(Xe).project],mode:"tags",options:b.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:V.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":T[1]||(T[1]=x=>f(e.unref(Xe).project,x))},null,8,["model-value","options","placeholder"])),h.value?(e.openBlock(),e.createBlock(ce,{key:1,"model-value":V.filters[e.unref(Xe).type],mode:"tags",options:h.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:V.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":T[2]||(T[2]=x=>f(e.unref(Xe).type,x))},null,8,["model-value","options","placeholder"])):e.createCommentVNode("",!0),y.value.length?(e.openBlock(),e.createBlock(ce,{key:2,"model-value":V.filters[e.unref(Xe).assignee],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:V.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":T[3]||(T[3]=x=>f(e.unref(Xe).assignee,x))},{tag:e.withCtx(({option:x,handleTagRemove:R})=>[e.createVNode(ye,{"user-name":x.label,"avatar-url":x.avatar,"is-closable":!0,onClose:P=>R(x,P)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):e.createCommentVNode("",!0)]),e.createVNode(Y,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":V.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":V.showsOnlyNonAssigned,onClick:T[4]||(T[4]=x=>V.$emit("update:showsOnlyNonAssigned",!V.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),e.createVNode(Y,{class:"ao-feed__only-important",size:"sm","icon-name":V.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":V.showsOnlyImportant,onClick:T[5]||(T[5]=x=>V.$emit("update:showsOnlyImportant",!V.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),e.createVNode(Y,{class:"ao-feed__show-archived",size:"sm","icon-name":V.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":V.showsArchivedActivities,onClick:T[6]||(T[6]=x=>V.$emit("update:showsArchivedActivities",!V.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),e.createElementVNode("div",b7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.statuses,x=>(e.openBlock(),e.createBlock(f7,{key:x.id,status:x,list:l.value[x.id],title:x.name,"footer-label":V.$t("feed.activity.add"),users:V.users,"user-id":V.userId,"is-editable":V.isEditable,tagType:d.value,onAdd:()=>m(x),onSelectActivity:i,onArchiveActivity:_,onUnarchiveActivity:B,onUpdateActivity:v,onStartTimer:$},null,8,["status","list","title","footer-label","users","user-id","is-editable","tagType","onAdd"]))),128))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[V.selectedActivity?(e.openBlock(),e.createBlock(ao,{key:0,activity:V.selectedActivity,"activity-types":V.activityTypes,"milestone-id":(w=V.selectedActivity.milestone)==null?void 0:w.id,"template-activities":s.value,users:V.users,"user-id":V.userId,"is-task-checkable":V.isTaskCheckable,statuses:V.statuses,breadcrumbs:p.value,"is-editable":V.isEditable,"attachment-enabled":V.attachmentEnabled,projects:g.value,"time-tracking-data":V.timeTrackingData,onClose:T[7]||(T[7]=()=>i(null,null)),"onUpdate:activity":C,onAddSubtask:z,onUpdateSubtask:U,onDeleteSubtask:Z,onAddFiles:O,onRemoveFile:H,onAddComment:K,onUpdateComment:W,onRemoveComment:F,onToast:n},{default:e.withCtx(x=>[e.renderSlot(V.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(x)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data"])):e.createCommentVNode("",!0)]))])}}}),c9="",y7={class:"ao-project-mapping"},w7={class:"ao-project-mapping-mapping__body"},k7={class:"ao-project-mapping-mapping__phases"},$7={key:0,class:"ao-project-mapping-mapping__image-wrapper"},E7=["src","alt"],B7=e.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(a,{emit:t}){const o=a,{t:r}=We(),n=()=>{const{name:h,rank:y}=at(o.phases,"phase",r);t("addPhase",{name:h,rank:y,projectId:o.project.id})},s=h=>{t("updatePhase",h)},i=h=>{t("archivePhase",h)},l=h=>{t("unarchivePhase",h)},c=h=>{t("copyPhaseToTemplate",h)},u=e.ref(!1),d=e.ref(!1),p=(h,y)=>{t("applyTemplate",{templateId:h,projectId:y}),u.value=!1},m=(h,y)=>{var _;const C=(_=o.templates)==null?void 0:_.at(-1),v=C?ie.LexoRank.parse(C.rank).genNext():ie.LexoRank.middle();t("saveTemplate",{templateName:h,rank:v.format(),phaseIds:y}),d.value=!1},f=Le.useRouter(),g=e.ref("mapping"),b=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(g,h=>{h==="feed"?(f.push({name:re.feed}),console.log("Navigating to feed...")):h==="overview"?(f.push({name:re.project}),console.log("Navigating to feed...")):h==="mapping"&&(f.push({name:re.mapping}),console.log("Navigating to feed..."))}),(h,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-mapping-overview"},h.$attrs),[e.createElementVNode("div",y7,[e.createVNode(It,null,{primary:e.withCtx(()=>[e.createVNode(wa,{modelValue:g.value,"onUpdate:modelValue":y[0]||(y[0]=C=>g.value=C),tabs:b},null,8,["modelValue"]),e.createVNode(Y,{class:"ao-feed__show-archived",size:"sm","icon-name":h.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:h.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":h.showsArchived,onClick:y[1]||(y[1]=C=>h.$emit("update:showsArchived",!h.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[h.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:0,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:h.$t("project.template.save.label"),onClick:y[2]||(y[2]=C=>d.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),h.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:1,class:"ao-project-mapping-overview__add-template",color:"primary",label:h.$t("project.template.apply.label"),onClick:y[3]||(y[3]=C=>u.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",w7,[e.createElementVNode("div",k7,[e.createVNode(fo,{phases:h.phases,"closed-status":h.closedStatus,"is-editable":h.isEditable===!0,users:h.users,onAddPhase:n,onUpdatePhase:s,onArchivePhase:i,onUnarchivePhase:l,onCopyPhaseToTemplate:c},null,8,["phases","closed-status","is-editable","users"])]),h.project.architectureImage?(e.openBlock(),e.createElementBlock("div",$7,[e.createElementVNode("img",{class:"architecture-image",src:h.project.architectureImage.url,alt:e.unref(r)("architectureImage.alt")},null,8,E7)])):e.createCommentVNode("",!0)])])],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?(e.openBlock(),e.createBlock(Or,{key:0,phases:h.phases,onClose:y[4]||(y[4]=C=>d.value=!1),onSave:m},null,8,["phases"])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createBlock(Ar,{key:1,"project-id":h.project.id,templates:h.templates,onClose:y[5]||(y[5]=C=>u.value=!1),onApply:p},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64))}}),d9="",rt={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},V7=(a,t={})=>[{path:a,name:rt.TEMPLATES,redirect:{name:rt.TEMPLATES_LIST},...t,children:[{path:"",name:rt.TEMPLATES_LIST,component:jr},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:rt.TEMPLATE_DETAILS,component:Mr,props:!0}]}],re={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},S7=(a,t={})=>[{path:a,...t,redirect:{name:re.project},children:[{path:"",name:re.project,component:u5,props:!0,children:[{path:":phaseId/:milestoneId",name:re.milestone,component:Ir,props:!0},{path:":phaseId/:milestoneId/:activityId",name:re.activity,props:{default:!0,modal:!0},components:{default:Ir,modal:Y5}}]},{path:"feed",name:re.feed,component:Lr,props:!0},{path:"mapping",name:re.mapping,component:B7,props:!0}]}],N7={class:"ao-templates"},jr=e.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(a,{emit:t}){const o=a,{t:r}=We();e.watch(()=>o.templates,(c,u)=>{Te(c,u)});const n=()=>{var m,f;const c=(m=o.templates)==null?void 0:m.at(-1),u=c?ie.LexoRank.parse(c.rank).genNext():ie.LexoRank.middle(),d=((f=o.templates)==null?void 0:f.length)??0,p={name:r("template.defaultName.template",{idx:d+1}),rank:u.format()};t("addTemplate",p)},s=(c,u)=>{t("updateItem",{itemType:te.TEMPLATES,id:c,templateId:c,data:{name:u}})},i=(c,u)=>{t("removeItem",{itemType:te.TEMPLATES,templateId:c,data:{id:c,...u?{name:u}:{}}})},l=c=>{if(c.moved){const u=Ot(c,o.templates??[]);t("updateItem",{itemType:te.TEMPLATES,id:c.moved.element.id,templateId:c.moved.element.id,data:{rank:u}})}};return(c,u)=>(e.openBlock(),e.createElementBlock("div",N7,[e.createVNode(It,null,{secondary:e.withCtx(()=>[e.createVNode(Y,{label:c.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:n},null,8,["label"])]),_:1}),e.createVNode(e.unref(je),{"model-value":c.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:l},{item:e.withCtx(({element:d})=>{var p;return[e.createVNode(F2,{id:d.id,title:d.name,phases:d.phases,milestones:(p=d.phases)!=null&&p.length?e.unref(m2)(d.phases):0,activities:d.phases?e.unref(f2)(d.phases):0,"updated-at":d.updatedAt,"updated-by":d.updatedBy,onUpdateTitle:m=>s(d.id,m),onClick:m=>c.$router.push({name:e.unref(rt).TEMPLATE_DETAILS,params:{templateId:d.id}}),onDeleteItem:u[0]||(u[0]=(m,f)=>i(m,f))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}}),p9="",x7={class:"ao-field__label"},Dr=e.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[e.createElementVNode("span",x7,e.toDisplayString(t.label),1),e.renderSlot(t.$slots,"default")],2))}}),M7=["type","value","disabled","readonly"],T7=e.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(a,{emit:t}){const o=a,r=e.computed(()=>o.modelModifiers.lazy?"change":"input"),n=s=>{o.modelModifiers.number&&(s=Number(s)),t("update:modelValue",s)};return(s,i)=>(e.openBlock(),e.createBlock(Dr,{label:s.label},{default:e.withCtx(()=>[e.createElementVNode("input",e.mergeProps({class:"ao-field__input",type:s.type,value:s.modelValue,disabled:s.isDisabled,readonly:s.isReadonly},{[e.toHandlerKey(r.value)]:i[0]||(i[0]=l=>n(l.target.value))}),null,16,M7)]),_:1},8,["label"]))}}),A7={class:"ao-field"},O7={class:"ao-field__label"},I7=["checked","disabled"],L7=e.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(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",A7,[e.createElementVNode("span",O7,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:o[0]||(o[0]=r=>{var n;return t.$emit("update:modelValue",((n=r.target)==null?void 0:n.checked)??!1)})},null,40,I7)]))}});X.AoAvatar=ye,X.AoCardFeed=ho,X.AoCheckboxField=L7,X.AoFeed=Lr,X.AoField=Dr,X.AoInputField=T7,X.AoMultiselect=ce,X.AoProjectPhases=fo,X.AoTabBar=wa,X.AoTemplateDetails=Mr,X.AoTemplates=Wr,X.AoTemplatesList=jr,X.TemplateItemTypeEnum=To,X.activityFeedStatus=Nd,X.durationTypes=Sd,X.feedFilterTypes=Xe,X.getProjectOverviewRoutes=S7,X.getTemplateRoutes=V7,X.listUpdateTypes=xd,X.milestoneStatus=kt,X.projectOverviewRoutes=re,X.ruleComparators=No,X.ruleDurationUnits=Mo,X.ruleTriggerTypes=xo,X.templateItemType=te,X.templateRouteNames=rt,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
6
+ */function ot(a){let t={r:0,g:0,b:0,a:1};/#/.test(a)?t=xf(a):/rgb/.test(a)?t=Tr(a):typeof a=="string"?t=Tr(`rgba(${a})`):Object.prototype.toString.call(a)==="[object Object]"&&(t=a);const{r:o,g:r,b:n,a:s}=t,{h:i,s:l,v:c}=Mf(t);return{r:o,g:r,b:n,a:s===void 0?1:s,h:i,s:l,v:c}}function oo(a){const t=document.createElement("canvas"),o=t.getContext("2d"),r=a*2;return t.width=r,t.height=r,o.fillStyle="#ffffff",o.fillRect(0,0,r,r),o.fillStyle="#ccd5db",o.fillRect(0,0,a,a),o.fillRect(a,a,a,a),t}function ro(a,t,o,r,n,s){const i=a==="l",l=t.createLinearGradient(0,0,i?o:0,i?0:r);l.addColorStop(.01,n),l.addColorStop(.99,s),t.fillStyle=l,t.fillRect(0,0,o,r)}function Nf({r:a,g:t,b:o},r){const n=i=>("0"+Number(i).toString(16)).slice(-2),s=`#${n(a)}${n(t)}${n(o)}`;return r?s.toUpperCase():s}function xf(a){a=a.slice(1);const t=o=>parseInt(o,16)||0;return{r:t(a.slice(0,2)),g:t(a.slice(2,4)),b:t(a.slice(4,6))}}function Tr(a){return typeof a=="string"?(a=(/rgba?\((.*?)\)/.exec(a)||["","0,0,0,1"])[1].split(","),{r:Number(a[0])||0,g:Number(a[1])||0,b:Number(a[2])||0,a:Number(a[3]?a[3]:1)}):a}function Mf({r:a,g:t,b:o}){a=a/255,t=t/255,o=o/255;const r=Math.max(a,t,o),n=Math.min(a,t,o),s=r-n;let i=0;r===n?i=0:r===a?t>=o?i=60*(t-o)/s:i=60*(t-o)/s+360:r===t?i=60*(o-a)/s+120:r===o&&(i=60*(a-t)/s+240),i=Math.floor(i);let l=parseFloat((r===0?0:1-n/r).toFixed(2)),c=parseFloat(r.toFixed(2));return{h:i,s:l,v:c}}var no=e.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 a=this.$refs.canvasSaturation,t=this.size,o=a.getContext("2d");a.width=t,a.height=t,o.fillStyle=this.color,o.fillRect(0,0,t,t),ro("l",o,t,t,"#FFFFFF","rgba(255,255,255,0)"),ro("p",o,t,t,"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(a){const{top:t,left:o}=this.$el.getBoundingClientRect(),r=a.target.getContext("2d"),n=i=>{let l=i.clientX-o,c=i.clientY-t;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=r.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,p,m]=u.data;this.$emit("selectSaturation",{r:d,g:p,b:m})};n(a);const s=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",s)}}});const Tf={ref:"canvasSaturation"};function Af(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",{class:"saturation",onMousedown:t[1]||(t[1]=e.withModifiers((...i)=>a.selectSaturation&&a.selectSaturation(...i),["prevent","stop"]))},[e.createVNode("canvas",Tf,null,512),e.createVNode("div",{style:a.slideSaturationStyle,class:"slide"},null,4)],32)}no.render=Af,no.__file="src/color/Saturation.vue";var io=e.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 a=this.$refs.canvasHue,t=this.width,o=this.height,r=a.getContext("2d");a.width=t,a.height=o;const n=r.createLinearGradient(0,0,0,o);n.addColorStop(0,"#FF0000"),n.addColorStop(.17*1,"#FF00FF"),n.addColorStop(.17*2,"#0000FF"),n.addColorStop(.17*3,"#00FFFF"),n.addColorStop(.17*4,"#00FF00"),n.addColorStop(.17*5,"#FFFF00"),n.addColorStop(1,"#FF0000"),r.fillStyle=n,r.fillRect(0,0,t,o)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(a){const{top:t}=this.$el.getBoundingClientRect(),o=a.target.getContext("2d"),r=s=>{let i=s.clientY-t;i<0&&(i=0),i>this.height&&(i=this.height),this.slideHueStyle={top:i-2+"px"};const l=o.getImageData(0,Math.min(i,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};r(a);const n=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",n)}}});const Of={ref:"canvasHue"};function If(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",{class:"hue",onMousedown:t[1]||(t[1]=e.withModifiers((...i)=>a.selectHue&&a.selectHue(...i),["prevent","stop"]))},[e.createVNode("canvas",Of,null,512),e.createVNode("div",{style:a.slideHueStyle,class:"slide"},null,4)],32)}io.render=If,io.__file="src/color/Hue.vue";var so=e.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 a=this.$refs.canvasAlpha,t=this.width,o=this.height,r=this.alphaSize,n=oo(r),s=a.getContext("2d");a.width=t,a.height=o,s.fillStyle=s.createPattern(n,"repeat"),s.fillRect(0,0,t,o),ro("p",s,t,o,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(a){const{top:t}=this.$el.getBoundingClientRect(),o=n=>{let s=n.clientY-t;s<0&&(s=0),s>this.height&&(s=this.height);let i=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",i)};o(a);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const Lf={ref:"canvasAlpha"};function jf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",{class:"color-alpha",onMousedown:t[1]||(t[1]=e.withModifiers((...i)=>a.selectAlpha&&a.selectAlpha(...i),["prevent","stop"]))},[e.createVNode("canvas",Lf,null,512),e.createVNode("div",{style:a.slideAlphaStyle,class:"slide"},null,4)],32)}so.render=jf,so.__file="src/color/Alpha.vue";var lo=e.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 a=this.$el,t=this.width,o=this.height,r=this.alphaSize,n=oo(r),s=a.getContext("2d");a.width=t,a.height=o,s.fillStyle=s.createPattern(n,"repeat"),s.fillRect(0,0,t,o),s.fillStyle=this.color,s.fillRect(0,0,t,o)}}});function Df(a,t,o,r,n,s){return e.openBlock(),e.createBlock("canvas")}lo.render=Df,lo.__file="src/color/Preview.vue";var co=e.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(a){this.isSucking=!1,this.suckColor(a)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(a){a.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(a){const{clientX:t,clientY:o}=a,{top:r,left:n,width:s,height:i}=this.suckerCanvas.getBoundingClientRect(),l=t-n,c=o-r,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,i-1),1,1);let[p,m,f,g]=d.data;g=parseFloat((g/255).toFixed(2));const b=this.suckerPreview.style;Object.assign(b,{position:"absolute",left:t+20+"px",top:o-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}, ${m}, ${f}, ${g})`,zIndex:95}),this.suckerArea.length&&t>=this.suckerArea[0]&&o>=this.suckerArea[1]&&t<=this.suckerArea[2]&&o<=this.suckerArea[3]?b.display="":b.display="none"},suckColor(a){a&&a.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),a.addEventListener("click",t=>{const{clientX:o,clientY:r}=t,{top:n,left:s,width:i,height:l}=a.getBoundingClientRect(),c=o-s,u=r-n,p=a.getContext("2d").getImageData(Math.min(c,i-1),Math.min(u,l-1),1,1);let[m,f,g,b]=p.data;b=parseFloat((b/255).toFixed(2)),this.$emit("selectSucker",{r:m,g:f,b:g,a:b})}))}}});const Pf=e.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),zf={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},Hf=e.createVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[e.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),e.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[e.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function Rf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",null,[a.isSucking?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock("svg",{key:0,class:[{active:a.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:t[1]||(t[1]=(...i)=>a.openSucker&&a.openSucker(...i))},[Pf],2)),a.isSucking?(e.openBlock(),e.createBlock("svg",zf,[Hf])):e.createCommentVNode("v-if",!0)])}co.render=Rf,co.__file="src/color/Sucker.vue";var po=e.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(a,{emit:t}){return{modelColor:e.computed({get(){return a.color||""},set(s){t("inputColor",s)}}),handleFocus:s=>{t("inputFocus",s)},handleBlur:s=>{t("inputBlur",s)}}}});const Uf={class:"color-type"},Ff={class:"name"};function Zf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",Uf,[e.createVNode("span",Ff,e.toDisplayString(a.name),1),e.withDirectives(e.createVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=i=>a.modelColor=i),class:"value",onFocus:t[2]||(t[2]=(...i)=>a.handleFocus&&a.handleFocus(...i)),onBlur:t[3]||(t[3]=(...i)=>a.handleBlur&&a.handleBlur(...i))},null,544),[[e.vModelText,a.modelColor]])])}po.render=Zf,po.__file="src/color/Box.vue";var uo=e.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(a,{emit:t}){const o=e.ref(),r=e.ref([]),n=e.ref();a.colorsHistoryKey&&localStorage&&(r.value=JSON.parse(localStorage.getItem(a.colorsHistoryKey))||[]),n.value=oo(4).toDataURL(),e.onUnmounted(()=>{s(o.value)});function s(l){if(!l)return;const c=r.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),r.value=c||[],localStorage&&a.colorsHistoryKey&&localStorage.setItem(a.colorsHistoryKey,JSON.stringify(c))}function i(l){t("selectColor",l)}return{setColorsHistory:s,colorsHistory:r,color:o,imgAlphaBase64:n,selectColor:i}}});const Wf={class:"colors"},qf={key:0,class:"colors history"};function Yf(a,t,o,r,n,s){return e.openBlock(),e.createBlock("div",null,[e.createVNode("ul",Wf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsDefault,i=>(e.openBlock(),e.createBlock("li",{key:i,class:"item",onClick:l=>a.selectColor(i)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:i},class:"color"},null,4)],8,["onClick"]))),128))]),a.colorsHistory.length?(e.openBlock(),e.createBlock("ul",qf,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsHistory,i=>(e.openBlock(),e.createBlock("li",{key:i,class:"item",onClick:l=>a.selectColor(i)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:i},class:"color"},null,4)],8,["onClick"]))),128))])):e.createCommentVNode("v-if",!0)])}uo.render=Yf,uo.__file="src/color/Colors.vue";var vt=e.defineComponent({components:{Saturation:no,Hue:io,Alpha:so,Preview:lo,Sucker:co,Box:po,Colors:uo},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 Nf(this.rgba,!0)}},created(){Object.assign(this,ot(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(a){const{r:t,g:o,b:r,h:n,s,v:i}=ot(a);Object.assign(this,{r:t,g:o,b:r,h:n,s,v:i}),this.setText()},handleFocus(a){this.$emit("inputFocus",a)},handleBlur(a){this.$emit("inputBlur",a)},selectHue(a){const{r:t,g:o,b:r,h:n,s,v:i}=ot(a);Object.assign(this,{r:t,g:o,b:r,h:n,s,v:i}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(a){this.a=a,this.setText()},inputHex(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.modelHex=a,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.modelHex=this.hexString,this.modelRgba=a,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(a){this.$emit("openSucker",a)},selectSucker(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(a){const{r:t,g:o,b:r,a:n,h:s,s:i,v:l}=ot(a);Object.assign(this,{r:t,g:o,b:r,a:n,h:s,s:i,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Kf={class:"color-set"};function Gf(a,t,o,r,n,s){const i=e.resolveComponent("Saturation"),l=e.resolveComponent("Hue"),c=e.resolveComponent("Alpha"),u=e.resolveComponent("Preview"),d=e.resolveComponent("Sucker"),p=e.resolveComponent("Box"),m=e.resolveComponent("Colors");return e.openBlock(),e.createBlock("div",{class:["hu-color-picker",{light:a.isLightTheme}],style:{width:a.totalWidth+"px"}},[e.createVNode("div",Kf,[e.createVNode(i,{ref:"saturation",color:a.rgbString,hsv:a.hsv,size:a.hueHeight,onSelectSaturation:a.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),e.createVNode(l,{ref:"hue",hsv:a.hsv,width:a.hueWidth,height:a.hueHeight,onSelectHue:a.selectHue},null,8,["hsv","width","height","onSelectHue"]),e.createVNode(c,{ref:"alpha",color:a.rgbString,rgba:a.rgba,width:a.hueWidth,height:a.hueHeight,onSelectAlpha:a.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),e.createVNode("div",{style:{height:a.previewHeight+"px"},class:"color-show"},[e.createVNode(u,{color:a.rgbaString,width:a.previewWidth,height:a.previewHeight},null,8,["color","width","height"]),a.suckerHide?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(d,{key:0,"sucker-canvas":a.suckerCanvas,"sucker-area":a.suckerArea,onOpenSucker:a.openSucker,onSelectSucker:a.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),e.createVNode(p,{name:"HEX",color:a.modelHex,onInputColor:a.inputHex,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(p,{name:"RGBA",color:a.modelRgba,onInputColor:a.inputRgba,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(m,{color:a.rgbaString,"colors-default":a.colorsDefault,"colors-history-key":a.colorsHistoryKey,onSelectColor:a.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),e.createCommentVNode(" custom options "),e.renderSlot(a.$slots,"default")],6)}vt.render=Gf,vt.__file="src/color/ColorPicker.vue",vt.install=a=>{a.component(vt.name,vt)};const W4="",Xf={class:"color-picker-wrapper"},mo=e.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(a,{emit:t}){const o=a,r=e.ref(!1),n=e.ref(null),s=e.ref(null),i=e.ref(0),l=e.ref(0),c=async f=>{s.value=f,r.value=!0,await e.nextTick();const g=f.getBoundingClientRect(),b=n.value,h=(b==null?void 0:b.offsetHeight)||300,y=window.innerHeight-g.bottom,C=g.top,v=y<h&&C>h;console.log("pickerHeight = "+h),i.value=v?g.top-h-8:g.bottom+8,l.value=g.left,setTimeout(()=>{window.addEventListener("click",d)},0)},u=e.computed(()=>({position:"fixed",top:`${i.value}px`,left:`${l.value}px`,zIndex:1e3})),d=f=>{const g=f.target;n.value&&!n.value.contains(g)&&(r.value=!1,t("update:color",p.value),window.removeEventListener("click",d))};e.onBeforeUnmount(()=>{window.removeEventListener("click",d)}),e.watch(()=>o.color,f=>{r.value||(p.value=f)});const p=e.ref(o.color),m=f=>{const{r:g,g:b,b:h,a:y}=f.rgba;p.value=`rgba(${g}, ${b}, ${h}, ${y})`};return(f,g)=>(e.openBlock(),e.createElementBlock("div",Xf,[e.renderSlot(f.$slots,"clickable",{openPicker:c,bgColor:f.color}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:n,class:"color-picker",style:e.normalizeStyle(u.value)},[e.createVNode(e.unref(vt),{class:"color-picker-box",theme:"light",color:f.color,onChangeColor:m},null,8,["color"])],4)):e.createCommentVNode("",!0)]))}}),q4="",Qf={class:"ao-card-project-phase__header"},Jf={class:"ao-card-project-item__title-line"},eh={key:0,class:"ao-card-project-item-phase__estimation"},th={class:"ao-card-project-phase__footer"},ah={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},oh={class:"ao-card-project-phase__subitem"},rh={class:"ao-card-project-phase__subitem"},nh={key:0,class:"ao-card-project-phase__secondary"},ih={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},sh=e.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(a,{emit:t}){const o=a,r=p=>{t("update:title",p)},n=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.reduce((m,f)=>{var g;return m+((g=f.activities)==null?void 0:g.reduce((b,h)=>b+(h.estimation||0),0))},0)}),s=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.length}),i=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.filter(m=>m.status===kt.done).length}),l=e.computed(()=>(i.value||0)/(s.value||1)),c=e.computed({get:()=>o.deadline??"",set:p=>t("update:deadline",p!=null&&p.length?p:null)}),u=e.computed({get:()=>o.color,set:p=>{t("updatePhase",{id:o.id,color:p})}}),d=(p,m)=>{const f=p.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m(f)};return(p,m)=>(e.openBlock(),e.createBlock(mo,{color:u.value,"onUpdate:color":m[2]||(m[2]=f=>u.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:g})=>[e.createVNode(ba,{class:"ao-card-project-phase","is-clickable":p.isEditable,color:g,withLeftBorder:!0,onClick:b=>d(b,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Jf,[e.createVNode(ne,{id:p.id,class:"ao-card-project-phase__title",title:p.name||"",level:4,"is-editable":p.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),n.value?(e.openBlock(),e.createElementBlock("span",eh," ("+e.toDisplayString(n.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",th,[s.value?(e.openBlock(),e.createElementBlock("div",ah,[e.createElementVNode("div",oh,[e.createVNode(Q,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",rh,e.toDisplayString(i.value)+" / "+e.toDisplayString(s.value),1)]),e.createVNode(ya,{percentages:l.value,class:"ao-card-project-phase__progress",color:p.color},null,8,["percentages","color"]),p.$slots.secondary?(e.openBlock(),e.createElementBlock("div",nh,[e.renderSlot(p.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-card-project-phase__footer-row",c.value?"":"ao-card-project-phase__no_deadline"])},[p.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=b=>c.value=b),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",ih,e.toDisplayString(e.unref(ra)(p.deadline)),1)],2)])]),_:2},[p.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",Qf,[e.createVNode(Y,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>p.active?p.$emit("archivePhase",{id:p.id}):p.$emit("unarchivePhase",{id:p.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),Y4="",lh=e.defineComponent({__name:"AoBadge",props:{color:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("span",{class:"aoBadge",style:e.normalizeStyle({backgroundColor:t.color})},null,4))}}),K4="",ch={class:"ao-card-project-milestone__default"},dh={class:"ao-title-with-badge-wrapper"},ph={class:"ao-card-project-item__title-line"},uh={key:0,class:"ao-card-project-item-milestone__estimation"},mh={key:0,class:"ao-card-project-milestone__archive"},fh={class:"ao-card-project-milestone__activities"},hh={class:"ao-card-project-milestone__activities-row"},gh={class:"ao-card-project-milestone__subitem"},_h={class:"ao-card-project-milestone__subitem"},vh={key:1,class:"ao-card-project-milestone__secondary"},Ch={class:"ao-card-project-milestone__footer"},bh={key:1,class:"ao-field ao-card-project-milestone__deadline"},yh={class:"ao-field__label"},wh={key:2,class:"ao-card-project-milestone__assignee"},kh=e.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}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(a,{emit:t}){const o=a,r=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.reduce((u,d)=>u+(d.estimation||0),0)}),n=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.length}),s=e.computed(()=>{var c;return(c=o.activities)==null?void 0:c.filter(u=>ja(u,o.closedStatus)).length}),i=e.computed(()=>(s.value||0)/(n.value||1)),l=c=>{t("updateMilestone",{id:o.id,name:c})};return(c,u)=>(e.openBlock(),e.createBlock(ba,{class:e.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!c.readonly,"tag-name":"li","is-selected":c.isSelected,color:c.phaseColor},{default:e.withCtx(()=>[e.createElementVNode("div",ch,[e.createElementVNode("div",dh,[e.createVNode(lh,{color:c.color||""},null,8,["color"]),e.createElementVNode("div",ph,[e.createVNode(ne,{id:c.id,title:c.name||"",level:5,"is-editable":!c.readonly&&c.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":l},null,8,["id","title","is-editable"]),r.value?(e.openBlock(),e.createElementBlock("span",uh," ("+e.toDisplayString(r.value)+")",1)):e.createCommentVNode("",!0)])]),!c.readonly&&c.isEditable?(e.openBlock(),e.createElementBlock("div",mh,[e.createVNode(Y,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:c.active?c.$t("archive"):c.$t("unarchive"),onClick:u[0]||(u[0]=e.withModifiers(()=>c.active?c.$emit("archiveMilestone",{id:c.id}):c.$emit("unarchiveMilestone",{id:c.id}),["stop"]))},null,8,["label"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",fh,[e.createElementVNode("div",hh,[n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",gh,[e.createVNode(Q,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",_h,e.toDisplayString(s.value)+" / "+e.toDisplayString(n.value),1)]),e.createVNode(ya,{percentages:i.value,color:c.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):e.createCommentVNode("",!0),c.$slots.secondary?(e.openBlock(),e.createElementBlock("div",vh,[e.renderSlot(c.$slots,"secondary")])):e.createCommentVNode("",!0)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",Ch,[c.important?(e.openBlock(),e.createBlock(Q,{key:0,name:"FlagRounded",class:e.normalizeClass(c.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):e.createCommentVNode("",!0),c.deadline?(e.openBlock(),e.createElementBlock("label",bh,[e.createElementVNode("span",yh,e.toDisplayString(e.unref(ra)(c.deadline)),1)])):e.createCommentVNode("",!0),c.assignee?(e.openBlock(),e.createElementBlock("div",wh,[e.createVNode(ye,{"user-name":e.unref(er)(c.assignee),"avatar-url":c.assignee.avatarUrl,color:c.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):e.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}}),G4="",$h={class:"ao-mapping-card-project-phase__header"},Eh={class:"ao-card-project-item__title-line"},Bh={key:0,class:"ao-card-project-item-phase__estimation"},Vh={class:"ao-mapping-card-project-phase__footer"},Sh={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},Nh={class:"ao-mapping-card-project-phase__subitem"},xh={class:"ao-mapping-card-project-phase__subitem"},Mh={key:0,class:"ao-mapping-card-project-phase__secondary"},Th={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},Ah=e.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,r=p=>{t("update:title",p)},n=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.reduce((m,f)=>{var g;return m+((g=f.activities)==null?void 0:g.reduce((b,h)=>b+(h.estimation||0),0))},0)}),s=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.length}),i=e.computed(()=>{var p;return(p=o.milestones)==null?void 0:p.filter(m=>m.status===kt.done).length}),l=e.computed(()=>(i.value||0)/(s.value||1)),c=e.computed({get:()=>o.deadline??"",set:p=>t("update:deadline",p!=null&&p.length?p:null)}),u=e.computed({get:()=>o.color,set:p=>{t("updatePhase",{id:o.id,color:p})}}),d=(p,m)=>{const f=p.target;f.closest("button")||f.closest("input")||f.closest(".ao-title")||m()};return(p,m)=>(e.openBlock(),e.createBlock(mo,{color:u.value,"onUpdate:color":m[2]||(m[2]=f=>u.value=f)},{clickable:e.withCtx(({openPicker:f,bgColor:g})=>[e.createVNode(ba,{class:"ao-mapping-card-project-phase","is-clickable":p.isEditable,color:g,withLeftBorder:!0,onClick:b=>d(b,f)},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Eh,[e.createVNode(ne,{id:p.id,class:"ao-mapping-card-project-phase__title",title:p.name||"",level:4,"is-editable":p.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),n.value?(e.openBlock(),e.createElementBlock("span",Bh," ("+e.toDisplayString(n.value)+")",1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",Vh,[s.value?(e.openBlock(),e.createElementBlock("div",Sh,[e.createElementVNode("div",Nh,[e.createVNode(Q,{name:"MountainFlagOutlineRounded",size:"sm"}),e.createElementVNode("span",xh,e.toDisplayString(i.value)+" / "+e.toDisplayString(s.value),1)]),e.createVNode(ya,{percentages:l.value,class:"ao-mapping-card-project-phase__progress",color:u.value},null,8,["percentages","color"]),p.$slots.secondary?(e.openBlock(),e.createElementBlock("div",Mh,[e.renderSlot(p.$slots,"secondary")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["ao-mapping-card-project-phase__footer-row",c.value?"":"ao-mapping-card-project-phase__no_deadline"])},[p.isEditable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":m[1]||(m[1]=b=>c.value=b),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[e.vModelText,c.value,void 0,{lazy:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("span",Th,e.toDisplayString(e.unref(ra)(p.deadline)),1)],2)])]),_:2},[p.isEditable?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",$h,[e.createVNode(Y,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=e.withModifiers(()=>p.active?p.$emit("archivePhase",{id:p.id}):p.$emit("unarchivePhase",{id:p.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}}),X4="",Oh={class:"ao-project-phase"},Ih={key:0,class:"ao-project-phase__drag ao-card__drag"},Lh={key:1,class:"ao-project-phase__col-phase"},jh={key:2,class:"ao-mapping-project-phase__col-phase"},Dh={key:0,class:"ao-project-phase__col-milestones"},Ph={class:"ao-project-phase__milestones-list-footer"},zh=e.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a,{t:r}=We();e.watch(()=>o.phase.milestones,(C,v)=>{Te(C,v)});const n=C=>{t("updatePhase",{id:o.phase.id,name:C})},s=C=>{t("updatePhase",{id:o.phase.id,deadline:C})},i=C=>{t("updatePhase",C)},l=e.computed(()=>o.phase.milestones.map(C=>_2(C,o.closedStatus))),c=C=>{const{name:v,rank:_}=at(l.value??[],"milestone",r);t("addMilestone",{name:v,rank:_,phaseId:C})},u=C=>{t("updateMilestone",C)},d=C=>{t("archiveMilestone",C)},p=C=>{t("unarchiveMilestone",C)},m=C=>{t("archivePhase",C)},f=C=>{t("unarchivePhase",C)},g=C=>{"added"in C?t("updateMilestone",{id:C.added.element.id,phaseId:o.phase.id,rank:dt(l.value,C.added.newIndex)}):"removed"in C||"moved"in C&&t("updateMilestone",{id:C.moved.element.id,rank:dt(l.value,C.moved.newIndex)})},b=Le.useRoute(),h=e.computed(()=>b.path.includes("/mapping")),y=e.computed(()=>{var C;return o.phase.id!==((C=b.params)==null?void 0:C.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:C2(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(C,v)=>(e.openBlock(),e.createElementBlock("li",Oh,[e.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:e.normalizeStyle(y.value)},[C.isEditable?(e.openBlock(),e.createElementBlock("div",Ih,[e.createVNode(Q,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("div",jh,[e.createVNode(Ah,{id:C.phase.id,milestones:l.value,name:C.phase.name,deadline:C.phase.deadline,active:C.phase.active,"is-editable":C.isEditable,color:C.phase.color,"onUpdate:deadline":s,"onUpdate:title":n,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:i},null,8,["id","milestones","name","deadline","active","is-editable","color"])])):(e.openBlock(),e.createElementBlock("div",Lh,[e.createVNode(sh,{id:C.phase.id,milestones:l.value,name:C.phase.name,deadline:C.phase.deadline,active:C.phase.active,"is-editable":C.isEditable,color:C.phase.color,"onUpdate:deadline":s,"onUpdate:title":n,onArchivePhase:m,onUnarchivePhase:f,onUpdatePhase:i},null,8,["id","milestones","name","deadline","active","is-editable","color"])]))],4),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Dh,[e.createElementVNode("div",{class:"ao-project-phase__milestones",style:e.normalizeStyle(y.value)},[e.createVNode(e.unref(je),e.mergeProps({class:"ao-project-phase__milestones-list",list:l.value,disabled:C.readonly||!C.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:g}),{item:e.withCtx(({element:_})=>{var B;return[e.createVNode(kh,{id:_.id,name:_.name,color:_.color,"phase-color":C.phase.color,activities:_.activities,deadline:_.deadline,active:_.active,"is-editable":!C.readonly&&C.isEditable,"is-draggable":!C.readonly&&C.isEditable,"closed-status":C.closedStatus,"is-selected":_.id===((B=C.$route.params)==null?void 0:B.milestoneId),assignee:_.assignee,important:_.important,readonly:C.readonly,class:e.normalizeClass(["ao-project-phase__milestone"]),onClick:$=>!C.readonly&&C.$router.push({name:e.unref(re).milestone,params:{phaseId:C.phase.id,milestoneId:_.id}}),onUpdateMilestone:u,onArchiveMilestone:d,onUnarchiveMilestone:p},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","onClick"])]}),_:1},16,["list","disabled"]),e.createElementVNode("div",Ph,[C.isEditable?(e.openBlock(),e.createBlock(Pe,{key:0,label:C.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:v[0]||(v[0]=()=>c(C.phase.id))},null,8,["label"])):e.createCommentVNode("",!0)])],4)]))]))}}),Q4="",Hh={class:"ao-project__phases"},Rh={key:0,class:"ao-project-phase__phases-list-footer"},Uh=e.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1),Fh={class:"ao-project-phase__col-phase"},Zh=e.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1),fo=e.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(a,{emit:t}){const o=a;e.watch(()=>o.phases,(m,f)=>{Te(m,f)});const r=m=>{t("addMilestone",m)},n=m=>{t("updateMilestone",m)},s=m=>{t("archiveMilestone",m)},i=m=>{t("unarchiveMilestone",m)},l=m=>{t("archivePhase",m)},c=m=>{t("unarchivePhase",m)},u=m=>{if(m.moved){const f=Ot(m,o.phases??[]);t("updatePhase",{id:m.moved.element.id,rank:f})}},d=m=>{t("updatePhase",m)},p=m=>{t("addPhase",m)};return(m,f)=>(e.openBlock(),e.createElementBlock("div",Hh,[e.createVNode(e.unref(je),{class:"ao-project-phase__phases-list","model-value":m.phases,"item-key":"id",handle:".ao-card__drag",onChange:u},{item:e.withCtx(({element:g})=>[e.createVNode(zh,{phase:g,"is-editable":!m.readonly&&m.isEditable,"closed-status":m.closedStatus,users:m.users,readonly:m.readonly,onAddMilestone:r,onUpdateMilestone:n,onArchiveMilestone:s,onUnarchiveMilestone:i,onUpdatePhase:d,onArchivePhase:l,onUnarchivePhase:c},null,8,["phase","is-editable","closed-status","users","readonly"])]),_:1},8,["model-value"]),m.isEditable?(e.openBlock(),e.createElementBlock("div",Rh,[Uh,e.createElementVNode("div",Fh,[e.createVNode(Pe,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),Zh])):e.createCommentVNode("",!0)]))}}),J4="",Wh=["onSubmit"],qh={class:"ao-add-template-modal__form-body"},Yh={class:"field__row"},Kh={class:"ao-add-template-modal__form-footer"},Ar=e.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(a,{emit:t}){const o=a,r=e.computed(()=>o.templates.map(l=>({value:l.id,label:l.name}))),n=e.ref(null),s=l=>{n.value=l},i=()=>{n.value&&t("apply",n.value,o.projectId)};return(l,c)=>(e.openBlock(),e.createBlock(na,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:l.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:e.withModifiers(i,["prevent"])},[e.createElementVNode("p",null,e.toDisplayString(l.$t("project.template.apply.notice")),1),e.createElementVNode("div",qh,[e.createElementVNode("div",Yh,[e.createVNode(ce,{value:n.value,options:r.value,detached:!0,onChange:s},null,8,["value","options"])])]),e.createElementVNode("footer",Kh,[e.createVNode(Y,{label:l.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:i},null,8,["label"])])],40,Wh)]),_:1}))}}),e9="",Gh=["onSubmit"],Xh={class:"ao-save-template-modal__form-body"},Qh={class:"field__row"},Jh={class:"ao-field ao-field--inline"},e5={class:"ao-field__label"},t5={class:"ao-save-template-modal__phases"},a5={class:"ao-field__label"},o5={class:"ao-save-template-modal__phases-list"},r5=["value"],n5={class:"ao-save-template-modal__form-footer"},Or=e.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(a,{emit:t}){const o=a,r=e.ref(""),n=e.ref([]);e.onMounted(()=>{n.value=o.phases.map(i=>i.id)});const s=()=>{r.value&&t("save",r.value,n.value)};return(i,l)=>(e.openBlock(),e.createBlock(na,{size:"sm"},{header:e.withCtx(()=>[e.createVNode(ne,{title:i.$t("project.template.save.title"),level:3},null,8,["title"])]),default:e.withCtx(()=>[e.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:e.withModifiers(s,["prevent"])},[e.createElementVNode("div",Xh,[e.createElementVNode("div",Qh,[e.createElementVNode("label",Jh,[e.createElementVNode("span",e5,e.toDisplayString(i.$t("project.template.name.label"))+": ",1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),type:"text"},null,512),[[e.vModelText,r.value]])])]),e.createElementVNode("div",t5,[e.createElementVNode("div",a5,e.toDisplayString(i.$t("project.template.phases.label")),1),e.createElementVNode("div",o5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.phases,c=>(e.openBlock(),e.createElementBlock("label",{class:"ao-field ao-field--checkbox",key:c.id},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:c.id,"onUpdate:modelValue":l[1]||(l[1]=u=>n.value=u)},null,8,r5),[[e.vModelCheckbox,n.value]]),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]))),128))])])]),e.createElementVNode("footer",n5,[e.createVNode(Y,{label:i.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:s},null,8,["label"])])],40,Gh)]),_:1}))}}),t9="",i5=e.defineComponent({props:{modelValue:{type:[String,Number],required:!0},tabs:{type:Array,required:!0}},emits:["update:modelValue"],methods:{selectTab(a){this.$emit("update:modelValue",a)}}}),a9="",s5={class:"tabbar-wrapper"},l5=["onClick"];function c5(a,t,o,r,n,s){return e.openBlock(),e.createElementBlock("div",s5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tabs,i=>(e.openBlock(),e.createElementBlock("button",{key:i.value,class:e.normalizeClass(["tab-button",{"tab-button--active":i.value===a.modelValue}]),type:"button",onClick:l=>a.selectTab(i.value)},e.toDisplayString(i.label),11,l5))),128))])}const wa=D(i5,[["render",c5],["__scopeId","data-v-ff4e3297"]]),d5={class:"ao-project"},p5={class:"ao-project__body"},u5=e.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}},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(a,{emit:t}){const o=a,{t:r}=We(),n=e.computed(()=>o.phases.flatMap(E=>E.milestones)),s=()=>{const{name:E,rank:j}=at(o.phases,"phase",r);t("addPhase",{name:E,rank:j,projectId:o.project.id})},i=E=>{t("updatePhase",E)},l=E=>{t("archivePhase",E)},c=E=>{t("unarchivePhase",E)},u=E=>{t("copyPhaseToTemplate",E)},d=E=>{t("addMilestone",E)},p=E=>{t("updateMilestone",E)},m=E=>{t("archiveMilestone",E)},f=E=>{t("unarchiveMilestone",E)},g=E=>{t("addActivity",E)},b=E=>{t("update:activity",E)},h=E=>{t("archiveActivity",E)},y=E=>{t("unarchiveActivity",E)},C=E=>{t("addSubtask",E)},v=E=>{t("updateSubtask",E)},_=E=>{t("deleteSubtask",E)},B=e.computed(()=>n.value.flatMap(E=>E.activities)),$=E=>{t("addFiles",E)},N=E=>{t("removeFile",E)},A=E=>{t("addComment",E)},z=E=>{t("updateComment",E)},U=E=>{t("removeComment",E)},Z=e.ref(!1),O=e.ref(!1),H=(E,j)=>{t("applyTemplate",{templateId:E,projectId:j}),Z.value=!1},K=(E,j)=>{var w;const V=(w=o.templates)==null?void 0:w.at(-1),T=V?ie.LexoRank.parse(V.rank).genNext():ie.LexoRank.middle();t("saveTemplate",{templateName:E,rank:T.format(),phaseIds:j}),O.value=!1},W=Le.useRouter(),F=e.ref("overview"),S=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(F,E=>{E==="feed"?(W.push({name:re.feed}),console.log("Navigating to feed...")):E==="overview"?(W.push({name:re.project}),console.log("Navigating to feed...")):E==="mapping"&&(W.push({name:re.mapping}),console.log("Navigating to feed..."))}),(E,j)=>{const V=e.resolveComponent("RouterView");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-overview"},E.$attrs),[e.createElementVNode("div",d5,[e.createVNode(It,null,{primary:e.withCtx(()=>[e.createVNode(wa,{tabs:S,modelValue:F.value,"onUpdate:modelValue":j[0]||(j[0]=T=>F.value=T)},null,8,["modelValue"]),e.createVNode(Y,{class:"ao-feed__show-archived",size:"sm","icon-name":E.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:E.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":E.showsArchived,onClick:j[1]||(j[1]=T=>E.$emit("update:showsArchived",!E.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[E.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:E.$t("project.template.save.label"),onClick:j[2]||(j[2]=T=>O.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),E.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:1,class:"ao-project-overview__add-template",color:"primary",label:E.$t("project.template.apply.label"),onClick:j[3]||(j[3]=T=>Z.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",p5,[e.createVNode(fo,{phases:E.phases,"closed-status":E.closedStatus,"is-editable":E.isEditable===!0,users:E.users,onAddMilestone:d,onUpdateMilestone:p,onArchiveMilestone:m,onUnarchiveMilestone:f,onAddPhase:s,onUpdatePhase:i,onArchivePhase:l,onUnarchivePhase:c,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users"])])]),e.createVNode(V,{class:"ao-project__sidebar",phases:E.phases,"project-id":E.project.id,"project-name":E.project.name,users:E.users,"is-editable":E.isEditable===!0,"closed-status":E.closedStatus,onClose:j[4]||(j[4]=T=>E.$router.push({name:e.unref(re).project})),onUpdateMilestone:p,onAddActivity:g,onUpdateActivity:b,onArchiveActivity:h,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(V,{name:"modal",activities:B.value,"is-task-checkable":E.isTaskCheckable,statuses:E.statuses,"activity-types":E.activityTypes,phases:E.phases,project:E.project,users:E.users,"user-id":E.userId,"is-editable":E.isEditable,"attachment-enabled":E.attachmentEnabled,"onUpdate:activity":b,onAddSubtask:C,onUpdateSubtask:v,onDeleteSubtask:_,onAddFiles:$,onRemoveFile:N,onAddComment:A,onUpdateComment:z,onRemoveComment:U},{default:e.withCtx(({Component:T})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(T),null,{default:e.withCtx(w=>[e.renderSlot(E.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(w)))]),_:2},1024))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled"])]))],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[O.value?(e.openBlock(),e.createBlock(Or,{key:0,phases:E.phases,onClose:j[5]||(j[5]=T=>O.value=!1),onSave:K},null,8,["phases"])):e.createCommentVNode("",!0),Z.value?(e.openBlock(),e.createBlock(Ar,{key:1,"project-id":E.project.id,templates:E.templates,onClose:j[6]||(j[6]=T=>Z.value=!1),onApply:H},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64)}}}),o9="",m5={class:"ao-card-feed__header"},f5={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},h5={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},g5={class:"ao-card-feed__body"},_5={key:0,class:"ao-card-feed__breadcrumbs"},v5={class:e.normalizeClass(["ao-card-feed__title-group"])},C5={class:"ao-card-feed__title-line"},b5={key:0,class:"ao-card-feed__slug"},y5={key:1,class:"ao-card-feed__deadline"},w5={class:"ao-card-feed__footer"},k5={class:"ao-card-feed__footer-row"},$5={class:"ao-assignees"},E5={key:0,class:"ao-assignee"},B5={key:0,class:"ao-card-feed__subitems"},V5={key:0,class:"ao-card-feed__subitem"},S5={class:"ao-card-feed__subitem"},N5={key:1,class:"ao-card-feed__subitem"},x5={class:"ao-card-feed__subitem"},M5={class:"ao-card-feed__footer-row"},T5={key:0,class:"ao-card-feed__progress-wrapper"},A5={class:"ao-card-feed__subitem"},O5={class:"ao-card-feed__subitem"},ho=e.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(a,{emit:t}){const o=a,r=e.computed(()=>o.tagType==="milestone"?o.milestoneName:o.projectName),n=e.computed(()=>o.tagType==="milestone"?o.milestoneColor:o.projectColor),s=g=>{t("updateActivity",{id:o.id,name:g})},i=e.computed(()=>o.tagType==="milestone"&&o.phaseName?`${o.phaseName}`:o.phaseName&&o.milestoneName?`${o.phaseName} / ${o.milestoneName}`:""),l=e.computed(()=>o.assignee?[o.assignee]:[]),c=e.computed(()=>ra(o.deadline)),u=g=>{t("removeAssignee",g)},d=()=>{t("startTimer",{activityId:o.id,name:o.name,project:o.projectName,projectId:o.projectId,slug:o.slug})},p=e.computed(()=>{var g;return(g=o.tasks)==null?void 0:g.length}),m=e.computed(()=>{var g;return(g=o.tasks)==null?void 0:g.filter(b=>b.isDone).length}),f=e.computed(()=>(m.value||0)/(p.value||1));return(g,b)=>(e.openBlock(),e.createBlock(ba,{class:e.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":g.isClosed}]),"is-clickable":!0},{header:e.withCtx(()=>[e.createElementVNode("div",m5,[r.value?(e.openBlock(),e.createBlock(wt,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:g.projectColor?void 0:"primary","raw-color":n.value},null,8,["label","color","raw-color"])):e.createCommentVNode("",!0),g.isPrivate||g.important||g.isClosed?(e.openBlock(),e.createElementBlock("div",f5,[g.isPrivate?(e.openBlock(),e.createBlock(Q,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):e.createCommentVNode("",!0),g.important?(e.openBlock(),e.createBlock(Q,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):e.createCommentVNode("",!0),g.isClosed?(e.openBlock(),e.createBlock(Q,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),g.$slots.secondary?(e.openBlock(),e.createElementBlock("div",h5,[e.createVNode(Q,{name:"TimerOutline",class:"ao-card-feed__timer",size:"sm",onClick:e.withModifiers(d,["stop"])},null,8,["onClick"]),e.renderSlot(g.$slots,"secondary")])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.createElementVNode("div",g5,[i.value?(e.openBlock(),e.createElementBlock("span",_5,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",v5,[e.createElementVNode("div",C5,[g.slug?(e.openBlock(),e.createElementBlock("span",b5,e.toDisplayString(g.slug)+": ",1)):e.createCommentVNode("",!0),e.createVNode(ne,{id:g.id,title:g.name,level:5,"is-editable":g.isEditable,"onUpdate:title":s,class:"ao-card-feed__title-inline"},null,8,["id","title","is-editable"])])]),g.deadline?(e.openBlock(),e.createElementBlock("span",y5,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0)])]),footer:e.withCtx(()=>[e.createElementVNode("div",w5,[e.createElementVNode("div",k5,[e.createElementVNode("ul",$5,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:h.id},[h?(e.openBlock(),e.createElementBlock("li",E5,[e.createVNode(ye,{"user-name":e.unref(er)(h),"avatar-url":h.avatarUrl,"is-closable":!0,onClose:()=>u(h.id)},null,8,["user-name","avatar-url","onClose"])])):e.createCommentVNode("",!0)],64))),128))]),g.comments||g.attachments?(e.openBlock(),e.createElementBlock("ul",B5,[g.comments?(e.openBlock(),e.createElementBlock("li",V5,[e.createVNode(Q,{name:"ChatOutline",size:"sm"}),e.createElementVNode("span",S5,e.toDisplayString(g.comments),1)])):e.createCommentVNode("",!0),g.attachments?(e.openBlock(),e.createElementBlock("li",N5,[e.createVNode(Q,{name:"AttachFileRounded",size:"sm"}),e.createElementVNode("span",x5,e.toDisplayString(g.attachments),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",M5,[g.tasks&&g.tasks.length?(e.openBlock(),e.createElementBlock("div",T5,[e.createElementVNode("div",A5,[e.createVNode(Q,{name:"SelectCheckBox",size:"sm"}),e.createElementVNode("span",O5,e.toDisplayString(m.value)+" / "+e.toDisplayString(p.value),1)]),e.createVNode(ya,{percentages:f.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):e.createCommentVNode("",!0)])])]),_:3},8,["class"]))}}),r9="",I5={class:"ao-project-milestone"},L5={class:"ao-project-milestone__header"},j5={class:"ao-project-milestone__header_line"},D5={class:"ao-project-milestone__header_line"},P5={class:"ao-project-milestone__title"},z5={key:0,class:"ao-fieldset ao-milestone__fieldset"},H5={class:"ao-field__row ao-milestone__field-row"},R5={class:"ao-field ao-field--inline"},U5={class:"ao-field__row ao-milestone__field-row"},F5={class:"ao-field ao-milestone__field-multiselect"},Z5=["onClick"],W5={class:"ao-project-milestone__body"},q5={key:0,class:"ao-project-milestone__footer"},Ir=e.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(a,{emit:t}){const o=a,{t:r}=We(),n=_=>{var B;t("startTimer",_),(B=window.parent)==null||B.postMessage({type:"startTimer",data:_},"*")},s=e.computed(()=>{var _;return(_=o.phases)==null?void 0:_.find(B=>B.id===o.phaseId)}),i=e.computed(()=>{var _;return(_=o.phases)==null?void 0:_.flatMap(B=>B.milestones)}),l=e.computed(()=>{var _;return(_=i.value)==null?void 0:_.find(B=>B.id===o.milestoneId)}),c=e.computed(()=>{var _;return(_=l.value)==null?void 0:_.activities});e.watch(c,(_,B)=>{Te(_,B)});const u=_=>{t("close",_)},d=()=>{const{name:_,rank:B}=at(c.value??[],"activity",r);t("addActivity",{milestoneId:o.milestoneId,name:_,rank:B,projectId:o.projectId})},p=_=>{t("updateActivity",_)},m=_=>{c.value&&"moved"in _&&t("updateActivity",{id:_.moved.element.id,rank:dt(c.value,_.moved.newIndex)})},f=e.computed({get:()=>{var _;return(_=l.value)==null?void 0:_.color},set:_=>{l.value&&t("updateMilestone",{id:l.value.id,color:_})}}),g=e.computed({get:()=>{var _;return((_=l==null?void 0:l.value)==null?void 0:_.deadline)??""},set:_=>{l.value&&t("updateMilestone",{id:l.value.id,deadline:_!=null&&_.length?_:null})}}),b=_=>o.closedStatus?ja(_,o.closedStatus):!1,h=e.computed(()=>{var _;return((_=o.users)==null?void 0:_.map(B=>({label:`${B.firstName} ${B.lastName}`,value:B.id,avatar:B.avatarUrl})))||[]}),y=e.computed({get(){var _,B;return(B=(_=l.value)==null?void 0:_.assignee)!=null&&B.id?[l.value.assignee.id]:[]},set(_){t("updateMilestone",{id:o.milestoneId,assigneeId:_[0]??null})}}),C=e.computed({get(){var _;return((_=l.value)==null?void 0:_.important)??!1},set(_){t("updateMilestone",{id:o.milestoneId,important:_})}}),v=(_,B)=>{const $=_.currentTarget;$ instanceof HTMLElement&&B($)};return(_,B)=>{var $;return e.openBlock(),e.createElementBlock("div",I5,[e.createElementVNode("header",L5,[e.createElementVNode("div",j5,[e.createVNode(Y,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:u})]),e.createElementVNode("div",D5,[e.createElementVNode("div",P5,[e.createVNode(ne,{title:(($=l.value)==null?void 0:$.name)||_.milestoneId,level:5},null,8,["title"]),e.createVNode(to,{modelValue:C.value,"onUpdate:modelValue":B[0]||(B[0]=N=>C.value=N),modelModifiers:{lazy:!0},disabled:!_.isEditable,class:"ao-milestone__important",color:"danger",label:_.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),l.value?(e.openBlock(),e.createElementBlock("div",z5,[e.createElementVNode("div",H5,[e.createElementVNode("label",R5,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[1]||(B[1]=N=>g.value=N),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[e.vModelText,g.value,void 0,{lazy:!0}]])])]),e.createElementVNode("div",U5,[e.createElementVNode("label",F5,[e.createVNode(ce,{modelValue:y.value,"onUpdate:modelValue":B[2]||(B[2]=N=>y.value=N),options:h.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:_.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!_.isEditable,caret:_.isEditable},{tag:e.withCtx(({option:N,handleTagRemove:A})=>[e.createVNode(ye,{"user-name":N.label,"avatar-url":N.avatar,"is-closable":!0,onClose:z=>A(N,z)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),e.createVNode(mo,{color:f.value,"onUpdate:color":B[3]||(B[3]=N=>f.value=N)},{clickable:e.withCtx(({openPicker:N,bgColor:A})=>[e.createElementVNode("button",{style:e.normalizeStyle({background:A}),class:"color-button",onClick:z=>v(z,N)},null,12,Z5)]),_:1},8,["color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",W5,[e.createVNode(e.unref(je),e.mergeProps({class:"ao-project-milestone__activities",list:c.value,disabled:!_.isEditable,"item-key":"id",group:"kanban"},_.$attrs,{onChange:m}),{item:e.withCtx(({element:N})=>{var A,z,U,Z,O;return[e.createVNode(ho,{id:N.id,name:N.name||N.id,"project-id":_.projectId,"phase-name":(A=s.value)==null?void 0:A.name,"milestone-name":(z=l.value)==null?void 0:z.name,"milestone-color":(U=l.value)==null?void 0:U.color,deadline:N.deadline,important:N.important,users:_.users,assignee:N.assignee,slug:N.slug,comments:(Z=N.comments)==null?void 0:Z.length,attachments:(O=N.attachments)==null?void 0:O.length,tasks:N.tasks,"is-editable":_.isEditable,"is-private":N.private,"is-closed":b(N),onClick:H=>_.$router.push({name:e.unref(re).activity,params:{milestoneId:_.milestoneId,activityId:N.id}}),onUpdateActivity:p,onRemoveAssignee:()=>p({id:N.id,assigneeId:null}),onStartTimer:n},e.createSlots({_:2},[_.isEditable?{name:"secondary",fn:e.withCtx(()=>[_.isEditable&&N.active?(e.openBlock(),e.createBlock(Y,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:_.$t("archive"),onClick:e.withModifiers(()=>_.$emit("archiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),_.isEditable&&!N.active?(e.openBlock(),e.createBlock(Y,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:_.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>_.$emit("unarchiveActivity",{id:N.id}),["stop"])},null,8,["label","onClick"])):e.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"]),_.isEditable?(e.openBlock(),e.createElementBlock("div",q5,[e.createVNode(Pe,{"icon-name":"Add",label:_.$t("project.activity.add"),onClick:d},null,8,["label"])])):e.createCommentVNode("",!0)])])}}}),n9="",Y5=e.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(a,{emit:t}){const o=a,r=e.computed(()=>{var h;return(h=o.phases)==null?void 0:h.find(y=>y.id===o.phaseId)}),n=e.computed(()=>{var h;return(h=o.phases)==null?void 0:h.flatMap(y=>y.milestones)}),s=e.computed(()=>{var h;return(h=n.value)==null?void 0:h.find(y=>y.id===o.milestoneId)}),i=e.computed(()=>{var h;return(h=o.activities)==null?void 0:h.find(y=>y.id===o.activityId)}),l=h=>{t("update:activity",h)},c=h=>{t("addSubtask",h)},u=h=>{t("updateSubtask",h)},d=h=>{t("deleteSubtask",h)},p=h=>{t("addFiles",h)},m=h=>{t("removeFile",h)},f=h=>{t("addComment",h)},g=h=>{t("updateComment",h)},b=h=>{t("removeComment",h)};return(h,y)=>{var C,v;return i.value?(e.openBlock(),e.createBlock(ao,{key:0,activity:i.value,"activity-types":h.activityTypes,"milestone-id":h.milestoneId,"template-activities":h.activities,"is-template":!1,users:h.users,"user-id":h.userId,"is-task-checkable":h.isTaskCheckable,statuses:h.statuses,breadcrumbs:`${(C=r.value)==null?void 0:C.name} / ${(v=s.value)==null?void 0:v.name}`,"is-editable":h.isEditable,"attachment-enabled":h.attachmentEnabled,projects:[h.project],"time-tracking-data":h.timeTrackingData,onClose:h.$router.back,"onUpdate:activity":l,onAddSubtask:c,onUpdateSubtask:u,onDeleteSubtask:d,onAddFiles:p,onRemoveFile:m,onAddComment:f,onUpdateComment:g,onRemoveComment:b},{default:e.withCtx(_=>[e.renderSlot(h.$slots,"default",e.normalizeProps(e.guardReactiveProps(_)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","onClose"])):e.createCommentVNode("",!0)}}}),K5={class:"ao-col-header"},G5=e.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("header",K5,[e.createVNode(ne,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(e.openBlock(),e.createBlock(wt,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):e.createCommentVNode("",!0)]))}}),i9="";function X5(a){return e.getCurrentScope()?(e.onScopeDispose(a),!0):!1}function ka(a){return typeof a=="function"?a():e.unref(a)}const Q5=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const J5=a=>a!=null,Rt=()=>{};function e7(a,t){function o(...r){return new Promise((n,s)=>{Promise.resolve(a(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(n).catch(s)})}return o}function t7(a,t={}){let o,r,n=Rt;const s=l=>{clearTimeout(l),n(),n=Rt};return l=>{const c=ka(a),u=ka(t.maxWait);return o&&s(o),c<=0||u!==void 0&&u<=0?(r&&(s(r),r=null),Promise.resolve(l())):new Promise((d,p)=>{n=t.rejectOnCancel?p:d,u&&!r&&(r=setTimeout(()=>{o&&s(o),r=null,d(l())},u)),o=setTimeout(()=>{r&&s(r),r=null,d(l())},c)})}}function a7(a,t=200,o={}){return e7(t7(t,o),a)}function go(a){var t;const o=ka(a);return(t=o==null?void 0:o.$el)!=null?t:o}const o7=Q5?window:void 0;function r7(){const a=e.ref(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{a.value=!0},t),a}function n7(a){const t=r7();return e.computed(()=>(t.value,!!a()))}function i7(a,t,o={}){const{root:r,rootMargin:n="0px",threshold:s=.1,window:i=o7,immediate:l=!0}=o,c=n7(()=>i&&"IntersectionObserver"in i),u=e.computed(()=>{const g=ka(a);return(Array.isArray(g)?g:[g]).map(go).filter(J5)});let d=Rt;const p=e.ref(l),m=c.value?e.watch(()=>[u.value,go(r),p.value],([g,b])=>{if(d(),!p.value||!g.length)return;const h=new IntersectionObserver(t,{root:go(b),rootMargin:n,threshold:s});g.forEach(y=>y&&h.observe(y)),d=()=>{h.disconnect(),d=Rt}},{immediate:l,flush:"post"}):Rt,f=()=>{d(),m(),p.value=!1};return X5(f),{isSupported:c,isActive:p,pause(){d(),p.value=!1},resume(){p.value=!0},stop:f}}const s7={class:e.normalizeClass(["ao-list-kanban"])},l7={class:"ao-list-kanban__header"},c7={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},d7={key:1,class:"ao-list-kanban__end"},p7={key:0,class:"ao-list-kanban__no-more"},u7={key:1,class:"ao-list-kanban__divider"},m7={key:1,class:"ao-list-kanban__footer"},f7=e.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{}},emits:["add","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(a,{emit:t}){const o=a,r=e.ref(!1),n=e.ref(null);i7(n,([{isIntersecting:d}])=>{r.value=d}),e.watch(r,d=>{d&&o.hasMore&&!o.isLoading&&t("loadMore")});const s=d=>{var p;return o.isEditable===!0?!0:o.userId&&o.isEditable==="only-own"?o.userId===((p=d.assignee)==null?void 0:p.id):!1},i=d=>{t("selectActivity",d)},l=d=>{t("updateActivity",d)},c=d=>{"added"in d?t("updateActivity",{id:d.added.element.id,statusId:o.status.id,rank:dt(o.list,d.added.newIndex)}):"removed"in d||"moved"in d&&t("updateActivity",{id:d.moved.element.id,rank:dt(o.list,d.moved.newIndex)})},u=e.ref(!1);return(d,p)=>(e.openBlock(),e.createElementBlock("div",s7,[d.title||d.$slots.header?e.renderSlot(d.$slots,"header",{key:0},()=>{var m;return[e.createElementVNode("div",l7,[d.title?(e.openBlock(),e.createBlock(G5,{key:0,title:d.title,level:3,items:(m=d.list)==null?void 0:m.length},null,8,["title","items"])):e.createCommentVNode("",!0)])]}):e.createCommentVNode("",!0),e.createVNode(e.unref(je),e.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:d.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},d.$attrs,{draggable:".ao-list-draggable",disabled:!d.isEditable,onChange:c,onStart:p[1]||(p[1]=m=>u.value=!0),onEnd:p[2]||(p[2]=m=>u.value=!1),"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"}}),{item:e.withCtx(({element:m})=>{var f,g,b,h,y,C,v,_,B,$;return[e.createVNode(ho,{class:e.normalizeClass(s(m)?"ao-list-draggable":""),id:m.id,name:m.name,"project-name":(f=m.project)==null?void 0:f.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(b=m.project)==null?void 0:b.color,"phase-name":(y=(h=m.milestone)==null?void 0:h.phase)==null?void 0:y.name,"milestone-name":(C=m.milestone)==null?void 0:C.name,"milestone-color":(v=m.milestone)==null?void 0:v.color,deadline:m.deadline,rules:((_=m.rules)==null?void 0:_.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(B=m.comments)==null?void 0:B.length,attachments:($=m.attachments)==null?void 0:$.length,users:d.users,assignee:m.assignee,slug:m.slug,"is-editable":s(m),"is-private":m.private,"tag-type":d.tagType,onUpdateActivity:[N=>s(m)&&l(N),()=>s(m)&&l],onClick:()=>i(m.id),onRemoveAssignee:()=>s(m)&&l({id:m.id,assigneeId:null}),onStartTimer:p[0]||(p[0]=N=>d.$emit("startTimer",N))},{secondary:e.withCtx(()=>[s(m)&&m.active?(e.openBlock(),e.createBlock(Y,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.archive"),onClick:e.withModifiers(()=>d.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),s(m)&&!m.active?(e.openBlock(),e.createBlock(Y,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>d.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),_:2},1032,["class","id","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:e.withCtx(()=>[d.isLoading?(e.openBlock(),e.createElementBlock("div",c7,[e.createVNode(Q,{name:"Loading"})])):d.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:n,class:"ao-list-kanban__end"},null,512)):(e.openBlock(),e.createElementBlock("div",d7,[d.noMoreLabel?(e.openBlock(),e.createElementBlock("span",p7,e.toDisplayString(d.noMoreLabel),1)):d.isEditable?(e.openBlock(),e.createElementBlock("span",u7)):e.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),d.$slots.footer||d.footerLabel?(e.openBlock(),e.createElementBlock("div",m7,[e.renderSlot(d.$slots,"footer",{},()=>[d.isEditable?(e.openBlock(),e.createBlock(Pe,{key:0,"icon-name":"AddBoxOutlineRounded",label:d.footerLabel,onClick:p[3]||(p[3]=m=>d.$emit("add"))},null,8,["label"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]))}}),s9="",h7={class:"ao-field ao-search-field"},g7=["value","placeholder","onKeypress"],_7=e.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(a,{emit:t}){const o=a,r=async i=>{const c=i.target.value;t("update:modelValue",c,i)},n=a7(r,o.delay),s=i=>{t("clear",i)};return(i,l)=>(e.openBlock(),e.createElementBlock("div",h7,[e.createElementVNode("input",{value:i.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:i.placeholder,onInput:l[0]||(l[0]=(...c)=>e.unref(n)&&e.unref(n)(...c)),onKeypress:e.withKeys(r,["enter"])},null,40,g7),e.createVNode(Q,{name:"SearchRounded",class:e.normalizeClass(`ao-search-field__icon ao-search-field__action ${i.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),e.createVNode(Y,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:e.normalizeClass(`ao-search-field__button ao-search-field__action ${i.modelValue?"ao-search-field__action--visible":""}`),onClick:s},null,8,["class"])]))}}),l9="",v7={class:"ao-feed"},C7={class:"ao-feed__filters"},b7={class:"ao-feed__body"},Lr=e.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{}},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(a,{emit:t}){const o=a,{t:r}=We();function n(V,T){t("toast",V,T)}const s=e.toRef(o,"activities"),i=async(V,T)=>{await t("selectActivity",V,T)},l=e.ref({}),c=e.ref(!1),u=e.ref(!1),d=e.computed(()=>o.project?"milestone":"project");e.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([V,T,w,x],[R,P])=>{l.value=Object.fromEntries(V.map(M=>[M.id,T.filter(L=>{var ee;return((ee=L.status)==null?void 0:ee.id)===M.id})])),w&&!c.value?(i(w,null),c.value=!0):x&&!c.value&&(i(null,x),c.value=!0),u.value&&Te(T,P)},{immediate:!0});const p=e.computed(()=>{var V;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((V=o.selectedActivity.milestone.phase)==null?void 0:V.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=V=>{var P,M;const T=(P=o.activities)==null?void 0:P.at(-1),w=T?ie.LexoRank.parse(T.rank).genNext():ie.LexoRank.middle(),x=((M=o.activities)==null?void 0:M.length)??0,R={name:r("activity.defaultName",{idx:x+1}),rank:w.format(),statusId:V.id};o.filters.assigneeId.length>0&&(R.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(R.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(R.typeId=o.filters.typeId[0]),u.value=!0,t("addActivity",R)},f=(V,T)=>{u.value=!1,t("update:filters",{...o.filters,[V]:T})},g=e.computed(()=>o.project?[o.project]:o.projects??[]),b=e.computed(()=>g.value.map(V=>({value:V.id,label:V.name}))),h=e.computed(()=>{var V;return(V=o.activityTypes)==null?void 0:V.map(T=>({value:T.id,label:T.name}))}),y=e.computed(()=>o.users.map(V=>({value:V.id,label:`${V.firstName} ${V.lastName}`,avatar:V.avatarUrl}))),C=V=>{o.selectedActivity&&t("update:activity",V)},v=V=>{t("update:activity",V)},_=V=>{t("archiveActivity",V)},B=V=>{t("unarchiveActivity",V)},$=V=>{var T;t("startTimer",V),(T=window.parent)==null||T.postMessage({type:"startTimer",data:V},"*")},N=V=>{u.value=!1,t("update:searchText",V)},A=V=>{u.value=!1,t("clear:searchText",V)},z=V=>{o.selectedActivity&&t("addSubtask",V)},U=V=>{o.selectedActivity&&t("updateSubtask",V)},Z=V=>{o.selectedActivity&&t("deleteSubtask",V)},O=V=>{t("addFiles",V)},H=V=>{t("removeFile",V)},K=V=>{o.selectedActivity&&t("addComment",{...V,activityId:o.selectedActivity.id})},W=V=>{const{id:T}=o.selectedActivity||{};T&&t("updateComment",V)},F=V=>{const{id:T}=o.selectedActivity||{};T&&t("removeComment",V)},S=Le.useRouter(),E=e.ref("feed"),j=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(E,V=>{V==="feed"?(S.push({name:re.feed}),console.log("Navigating to feed...")):V==="overview"?(S.push({name:re.project}),console.log("Navigating to feed...")):V==="mapping"&&(S.push({name:re.mapping}),console.log("Navigating to feed..."))}),(V,T)=>{var w;return e.openBlock(),e.createElementBlock("div",v7,[e.createVNode(It,null,{primary:e.withCtx(()=>[e.createElementVNode("div",C7,[e.createVNode(wa,{tabs:j,modelValue:E.value,"onUpdate:modelValue":T[0]||(T[0]=x=>E.value=x)},null,8,["modelValue"]),e.createVNode(_7,{"model-value":V.searchText,placeholder:V.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":N,onClear:A},null,8,["model-value","placeholder"]),o.project?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ce,{key:0,"model-value":V.filters[e.unref(Xe).project],mode:"tags",options:b.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:V.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":T[1]||(T[1]=x=>f(e.unref(Xe).project,x))},null,8,["model-value","options","placeholder"])),h.value?(e.openBlock(),e.createBlock(ce,{key:1,"model-value":V.filters[e.unref(Xe).type],mode:"tags",options:h.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:V.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":T[2]||(T[2]=x=>f(e.unref(Xe).type,x))},null,8,["model-value","options","placeholder"])):e.createCommentVNode("",!0),y.value.length?(e.openBlock(),e.createBlock(ce,{key:2,"model-value":V.filters[e.unref(Xe).assignee],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:V.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":T[3]||(T[3]=x=>f(e.unref(Xe).assignee,x))},{tag:e.withCtx(({option:x,handleTagRemove:R})=>[e.createVNode(ye,{"user-name":x.label,"avatar-url":x.avatar,"is-closable":!0,onClose:P=>R(x,P)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):e.createCommentVNode("",!0)]),e.createVNode(Y,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":V.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":V.showsOnlyNonAssigned,onClick:T[4]||(T[4]=x=>V.$emit("update:showsOnlyNonAssigned",!V.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),e.createVNode(Y,{class:"ao-feed__only-important",size:"sm","icon-name":V.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":V.showsOnlyImportant,onClick:T[5]||(T[5]=x=>V.$emit("update:showsOnlyImportant",!V.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),e.createVNode(Y,{class:"ao-feed__show-archived",size:"sm","icon-name":V.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:V.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":V.showsArchivedActivities,onClick:T[6]||(T[6]=x=>V.$emit("update:showsArchivedActivities",!V.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),e.createElementVNode("div",b7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.statuses,x=>(e.openBlock(),e.createBlock(f7,{key:x.id,status:x,list:l.value[x.id],title:x.name,"footer-label":V.$t("feed.activity.add"),users:V.users,"user-id":V.userId,"is-editable":V.isEditable,tagType:d.value,onAdd:()=>m(x),onSelectActivity:i,onArchiveActivity:_,onUnarchiveActivity:B,onUpdateActivity:v,onStartTimer:$},null,8,["status","list","title","footer-label","users","user-id","is-editable","tagType","onAdd"]))),128))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[V.selectedActivity?(e.openBlock(),e.createBlock(ao,{key:0,activity:V.selectedActivity,"activity-types":V.activityTypes,"milestone-id":(w=V.selectedActivity.milestone)==null?void 0:w.id,"template-activities":s.value,users:V.users,"user-id":V.userId,"is-task-checkable":V.isTaskCheckable,statuses:V.statuses,breadcrumbs:p.value,"is-editable":V.isEditable,"attachment-enabled":V.attachmentEnabled,projects:g.value,"time-tracking-data":V.timeTrackingData,onClose:T[7]||(T[7]=()=>i(null,null)),"onUpdate:activity":C,onAddSubtask:z,onUpdateSubtask:U,onDeleteSubtask:Z,onAddFiles:O,onRemoveFile:H,onAddComment:K,onUpdateComment:W,onRemoveComment:F,onToast:n},{default:e.withCtx(x=>[e.renderSlot(V.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(x)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data"])):e.createCommentVNode("",!0)]))])}}}),c9="",y7={class:"ao-project-mapping"},w7={class:"ao-project-mapping-mapping__body"},k7={class:"ao-project-mapping-mapping__phases"},$7={key:0,class:"ao-project-mapping-mapping__image-wrapper"},E7=["src","alt"],B7=e.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(a,{emit:t}){const o=a,{t:r}=We(),n=()=>{const{name:h,rank:y}=at(o.phases,"phase",r);t("addPhase",{name:h,rank:y,projectId:o.project.id})},s=h=>{t("updatePhase",h)},i=h=>{t("archivePhase",h)},l=h=>{t("unarchivePhase",h)},c=h=>{t("copyPhaseToTemplate",h)},u=e.ref(!1),d=e.ref(!1),p=(h,y)=>{t("applyTemplate",{templateId:h,projectId:y}),u.value=!1},m=(h,y)=>{var _;const C=(_=o.templates)==null?void 0:_.at(-1),v=C?ie.LexoRank.parse(C.rank).genNext():ie.LexoRank.middle();t("saveTemplate",{templateName:h,rank:v.format(),phaseIds:y}),d.value=!1},f=Le.useRouter(),g=e.ref("mapping"),b=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(g,h=>{h==="feed"?(f.push({name:re.feed}),console.log("Navigating to feed...")):h==="overview"?(f.push({name:re.project}),console.log("Navigating to feed...")):h==="mapping"&&(f.push({name:re.mapping}),console.log("Navigating to feed..."))}),(h,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-mapping-overview"},h.$attrs),[e.createElementVNode("div",y7,[e.createVNode(It,null,{primary:e.withCtx(()=>[e.createVNode(wa,{modelValue:g.value,"onUpdate:modelValue":y[0]||(y[0]=C=>g.value=C),tabs:b},null,8,["modelValue"]),e.createVNode(Y,{class:"ao-feed__show-archived",size:"sm","icon-name":h.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:h.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":h.showsArchived,onClick:y[1]||(y[1]=C=>h.$emit("update:showsArchived",!h.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[h.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:0,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:h.$t("project.template.save.label"),onClick:y[2]||(y[2]=C=>d.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),h.isEditable===!0?(e.openBlock(),e.createBlock(Y,{key:1,class:"ao-project-mapping-overview__add-template",color:"primary",label:h.$t("project.template.apply.label"),onClick:y[3]||(y[3]=C=>u.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",w7,[e.createElementVNode("div",k7,[e.createVNode(fo,{phases:h.phases,"closed-status":h.closedStatus,"is-editable":h.isEditable===!0,users:h.users,onAddPhase:n,onUpdatePhase:s,onArchivePhase:i,onUnarchivePhase:l,onCopyPhaseToTemplate:c},null,8,["phases","closed-status","is-editable","users"])]),h.project.architectureImage?(e.openBlock(),e.createElementBlock("div",$7,[e.createElementVNode("img",{class:"architecture-image",src:h.project.architectureImage.url,alt:e.unref(r)("architectureImage.alt")},null,8,E7)])):e.createCommentVNode("",!0)])])],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?(e.openBlock(),e.createBlock(Or,{key:0,phases:h.phases,onClose:y[4]||(y[4]=C=>d.value=!1),onSave:m},null,8,["phases"])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createBlock(Ar,{key:1,"project-id":h.project.id,templates:h.templates,onClose:y[5]||(y[5]=C=>u.value=!1),onApply:p},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64))}}),d9="",rt={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},V7=(a,t={})=>[{path:a,name:rt.TEMPLATES,redirect:{name:rt.TEMPLATES_LIST},...t,children:[{path:"",name:rt.TEMPLATES_LIST,component:jr},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:rt.TEMPLATE_DETAILS,component:Mr,props:!0}]}],re={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},S7=(a,t={})=>[{path:a,...t,redirect:{name:re.project},children:[{path:"",name:re.project,component:u5,props:!0,children:[{path:":phaseId/:milestoneId",name:re.milestone,component:Ir,props:!0},{path:":phaseId/:milestoneId/:activityId",name:re.activity,props:{default:!0,modal:!0},components:{default:Ir,modal:Y5}}]},{path:"feed",name:re.feed,component:Lr,props:!0},{path:"mapping",name:re.mapping,component:B7,props:!0}]}],N7={class:"ao-templates"},jr=e.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(a,{emit:t}){const o=a,{t:r}=We();e.watch(()=>o.templates,(c,u)=>{Te(c,u)});const n=()=>{var m,f;const c=(m=o.templates)==null?void 0:m.at(-1),u=c?ie.LexoRank.parse(c.rank).genNext():ie.LexoRank.middle(),d=((f=o.templates)==null?void 0:f.length)??0,p={name:r("template.defaultName.template",{idx:d+1}),rank:u.format()};t("addTemplate",p)},s=(c,u)=>{t("updateItem",{itemType:te.TEMPLATES,id:c,templateId:c,data:{name:u}})},i=(c,u)=>{t("removeItem",{itemType:te.TEMPLATES,templateId:c,data:{id:c,...u?{name:u}:{}}})},l=c=>{if(c.moved){const u=Ot(c,o.templates??[]);t("updateItem",{itemType:te.TEMPLATES,id:c.moved.element.id,templateId:c.moved.element.id,data:{rank:u}})}};return(c,u)=>(e.openBlock(),e.createElementBlock("div",N7,[e.createVNode(It,null,{secondary:e.withCtx(()=>[e.createVNode(Y,{label:c.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:n},null,8,["label"])]),_:1}),e.createVNode(e.unref(je),{"model-value":c.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:l},{item:e.withCtx(({element:d})=>{var p;return[e.createVNode(F2,{id:d.id,title:d.name,phases:d.phases,milestones:(p=d.phases)!=null&&p.length?e.unref(m2)(d.phases):0,activities:d.phases?e.unref(f2)(d.phases):0,"updated-at":d.updatedAt,"updated-by":d.updatedBy,onUpdateTitle:m=>s(d.id,m),onClick:m=>c.$router.push({name:e.unref(rt).TEMPLATE_DETAILS,params:{templateId:d.id}}),onDeleteItem:u[0]||(u[0]=(m,f)=>i(m,f))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}}),p9="",x7={class:"ao-field__label"},Dr=e.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[e.createElementVNode("span",x7,e.toDisplayString(t.label),1),e.renderSlot(t.$slots,"default")],2))}}),M7=["type","value","disabled","readonly"],T7=e.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(a,{emit:t}){const o=a,r=e.computed(()=>o.modelModifiers.lazy?"change":"input"),n=s=>{o.modelModifiers.number&&(s=Number(s)),t("update:modelValue",s)};return(s,i)=>(e.openBlock(),e.createBlock(Dr,{label:s.label},{default:e.withCtx(()=>[e.createElementVNode("input",e.mergeProps({class:"ao-field__input",type:s.type,value:s.modelValue,disabled:s.isDisabled,readonly:s.isReadonly},{[e.toHandlerKey(r.value)]:i[0]||(i[0]=l=>n(l.target.value))}),null,16,M7)]),_:1},8,["label"]))}}),A7={class:"ao-field"},O7={class:"ao-field__label"},I7=["checked","disabled"],L7=e.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(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",A7,[e.createElementVNode("span",O7,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:o[0]||(o[0]=r=>{var n;return t.$emit("update:modelValue",((n=r.target)==null?void 0:n.checked)??!1)})},null,40,I7)]))}});X.AoAvatar=ye,X.AoCardFeed=ho,X.AoCheckboxField=L7,X.AoFeed=Lr,X.AoField=Dr,X.AoInputField=T7,X.AoMultiselect=ce,X.AoProjectPhases=fo,X.AoTabBar=wa,X.AoTemplateDetails=Mr,X.AoTemplates=Wr,X.AoTemplatesList=jr,X.TemplateItemTypeEnum=To,X.activityFeedStatus=Nd,X.durationTypes=Sd,X.feedFilterTypes=Xe,X.getProjectOverviewRoutes=S7,X.getTemplateRoutes=V7,X.listUpdateTypes=xd,X.milestoneStatus=kt,X.projectOverviewRoutes=re,X.ruleComparators=No,X.ruleDurationUnits=Mo,X.ruleTriggerTypes=xo,X.templateItemType=te,X.templateRouteNames=rt,Object.defineProperty(X,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.41.131",
7
+ "version": "0.41.132",
8
8
  "workspaces": [
9
9
  "packages/*"
10
10
  ],