|
1
|
|
-import{S as t,Z as e,bA as a,a0 as i,a9 as s,aO as n,T as o,$ as r,_ as l,a7 as d,a8 as c,aP as h,a2 as u,a5 as f,H as p,ax as b,bB as g,av as m,a1 as _,bC as v,U as C,bx as k,bD as y,bE as w,bF as $,bG as S,bH as N,bI as T}from"../vendor.js?ver=1.95.3";import{P as B,D as V,g as P,B as D,C as M,u as A,A as E,s as L,m as I,a as q,b as H,t as x,c as U,d as F,f as R,e as Z,h as O,v as j,i as Q,j as W,k as z,$ as G,R as J,S as Y,l as X,r as K}from"../prevent-context-menu.js?ver=1.95.3";import{E as tt,a as et,b as at,c as it,d as st,e as nt,f as ot,g as rt,h as lt,s as dt,i as ct,j as ht,k as ut,l as ft,m as pt,n as bt,o as gt,p as mt,q as _t,r as vt}from"../vendor-element-plus.js?ver=1.95.3";import{_ as Ct}from"../taskDateStatus.js?ver=1.95.3";const kt={class:"fbs_no_notification_found"};const yt=["src","title"],wt=["href"],$t={key:0},St={key:1,class:"fbs-unread-mark"},Nt={class:"fbs-notification-card-inner-description"},Tt={key:1,class:"fbs-notification-card-details"},Bt={key:0},Vt={class:"fbs-notification-card-details-bottom"},Pt=["href"];const Dt={key:0,class:"fbs_notification-number"},Mt={class:"fbs-notification-actions"},At={class:"el-dropdown-link"},Et={key:0,style:{height:"80px"}},Lt={key:1,style:{"padding-top":"20px",width:"100%","text-align":"center"}};const It=Ct({name:"Notification",inject:["eventBus"],components:{DrawerHeader:V,Pagination:B,NoNotificationFound:Ct({name:"NoNotificationFound",props:{message:{type:String,reuired:!0}}},[["render",function(n,o,r,l,d,c){return t(),e("div",kt,[o[0]||(o[0]=a('<svg xmlns="http://www.w3.org/2000/svg" width="201" height="197" viewBox="0 0 201 197" fill="none" data-v-682bdb32><path d="M196.764 98.3818C196.764 118.095 190.933 136.513 180.845 151.876C178.624 155.393 176.217 158.54 173.626 161.687C155.578 183.066 128.553 196.671 98.4744 196.671C68.3953 196.671 41.3703 182.974 23.3229 161.687C20.7314 158.54 18.3251 155.393 16.1039 151.969C13.5125 147.897 11.0136 143.547 8.97746 139.012C7.40409 135.402 5.83072 131.7 4.72011 127.813C2.77653 121.982 1.48082 116.152 0.740409 110.043C0.462756 108.562 0.370205 107.082 0.277653 105.416C0.185102 103.102 0 100.603 0 98.1967C0 70.709 11.1987 45.9979 29.3387 28.1355C31.1897 26.2845 33.2258 24.526 35.1694 22.7676C52.3839 8.69981 74.4111 0 98.4744 0C117.725 0 135.772 5.55307 151.043 15.1784C151.784 15.5486 152.432 16.0113 153.172 16.5666C153.82 17.0294 154.56 17.3996 155.116 17.9549C158.818 20.5463 162.427 23.4154 165.666 26.5622C167.61 28.4132 169.554 30.2642 171.22 32.3003C173.348 34.7067 175.477 37.113 177.328 39.797C177.791 40.4448 178.161 41.0001 178.716 41.648C179.179 42.2959 179.549 42.8512 180.104 43.499C185.658 51.7361 189.915 60.8061 192.877 70.4314C193.339 72.1899 193.895 73.7632 194.265 75.5217C195.838 82.7407 196.764 90.4224 196.764 98.3818Z" fill="#EAEEF9" data-v-682bdb32></path><path d="M188.525 151.877V161.688H23.2288C20.6373 158.541 18.231 155.394 16.0098 151.97H188.525V151.877Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M193.061 76.3554H112.912V71.2651H191.673C192.321 72.8384 192.691 74.5969 193.061 76.3554Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M177.699 42.3875V71.9113H136.791V17.4912H151.969C152.617 17.954 153.358 18.3242 153.913 18.8795C157.615 21.4709 161.225 24.34 164.464 27.4867C166.407 29.3378 168.351 31.1888 170.017 33.2249C172.146 35.6312 174.274 38.0376 176.125 40.7215C176.773 41.1843 177.328 41.8322 177.699 42.3875Z" fill="white" data-v-682bdb32></path><path d="M177.699 42.3878C177.236 41.74 176.866 41.1846 176.311 40.5368V70.6159H138.18V18.7873H153.913C153.265 18.3245 152.71 17.9543 151.97 17.399C151.322 16.9363 150.581 16.566 149.841 16.0107H135.311V73.1148H178.81V44.2388C178.532 43.6835 178.162 43.0357 177.699 42.3878Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M170.2 33.1332V62.0091H144.193V27.395H164.462C166.591 29.246 168.442 31.0971 170.2 33.1332Z" fill="#EAEEF9" data-v-682bdb32></path><path d="M66.4515 150.211C66.4515 151.044 65.8037 151.692 65.0633 151.97C64.9707 151.97 64.7856 151.97 64.6931 151.97H16.0112C13.4198 147.898 10.9209 143.548 8.88477 139.013C11.106 135.311 12.4017 131.331 12.957 127.814C13.2347 126.611 13.3272 125.5 13.4198 124.297H50.1626C50.2551 125.408 50.5328 126.518 50.8104 127.814C52.1987 134.478 55.8082 142.807 63.3974 148.453H64.6005C65.7111 148.453 66.4515 149.286 66.4515 150.211Z" fill="#CAD3E2" data-v-682bdb32></path><path d="M100.973 27.1168V123.648C100.973 125.961 99.1215 127.72 96.9003 127.72H4.71935C2.86833 122.167 1.57261 116.336 0.832206 110.228C0.554552 108.747 0.462001 107.266 0.36945 105.6C0.276899 103.194 0.0917969 100.788 0.0917969 98.3812C0.0917969 70.8935 11.2905 46.1824 29.4305 28.32C31.2815 26.469 33.3176 24.7105 35.2612 22.952H96.7152C99.214 22.952 100.973 24.9882 100.973 27.1168Z" fill="#DEE5EF" data-v-682bdb32></path><path d="M100.973 27.1168V110.228H0.832206C0.554552 108.747 0.462001 107.266 0.36945 105.6C0.276899 103.194 0.0917969 100.788 0.0917969 98.3812C0.0917969 70.8935 11.2905 46.1824 29.4305 28.32C31.2815 26.469 33.3176 24.7105 35.2612 22.952H96.7152C99.214 22.952 100.973 24.9882 100.973 27.1168Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M95.6057 28.3203V105.693H0.4632C0.370649 103.287 0.185547 100.88 0.185547 98.4741C0.185547 70.9864 11.3842 46.2752 29.5242 28.4129H95.6057V28.3203Z" fill="white" data-v-682bdb32></path><path d="M31.3748 122.815C33.2258 122.815 34.7066 121.334 34.7066 119.483C34.7066 117.632 33.2258 116.151 31.3748 116.151C29.5238 116.151 28.043 117.632 28.043 119.483C28.043 121.334 29.5238 122.815 31.3748 122.815Z" fill="white" data-v-682bdb32></path><path d="M49.7011 129.294V133.273H46.9245C45.3512 133.273 43.9629 134.662 43.9629 136.235V141.788C43.9629 143.361 45.3512 144.75 46.9245 144.75H49.7011V149.007C49.7011 150.488 50.9042 151.784 52.4776 151.784H64.7869C66.2677 151.784 67.5634 150.58 67.5634 149.007V129.109H49.7011V129.294ZM46.9245 142.714C46.5543 142.714 46.1841 142.343 46.1841 141.973V136.42C46.1841 136.05 46.5543 135.68 46.9245 135.68H49.7011V142.806H46.9245V142.714Z" fill="#989FB0" data-v-682bdb32></path><path d="M58.7708 105.877C59.8814 108.654 60.1591 111.43 58.4932 113.559C56.9198 115.78 55.7166 118.742 57.3825 121.056C58.9559 123.277 59.5112 125.035 58.8634 126.146C58.2155 127.257 58.8634 126.053 60.992 123.647C62.8431 121.704 59.5112 120.038 59.4187 118.464C59.3261 116.983 61.1771 113.837 61.1771 111.801C61.0846 109.579 60.0665 106.71 58.7708 105.877Z" fill="white" data-v-682bdb32></path><path d="M54.1413 118.002C54.6041 119.39 54.7892 120.778 54.0487 121.889C53.3083 123 52.6605 124.48 53.586 125.591C54.419 126.702 54.6041 127.535 54.3264 128.183C54.0487 128.83 54.3264 128.183 55.437 126.979C56.27 125.961 54.6966 125.128 54.6041 124.388C54.5115 123.648 55.437 122.167 55.437 121.056C55.3445 119.853 54.8817 118.465 54.1413 118.002Z" fill="white" data-v-682bdb32></path><path d="M103.656 131.885C104.674 129.663 108.099 125.406 111.616 123.648C112.078 123.37 112.634 123.555 112.819 124.018C113.837 125.776 116.336 130.219 115.41 134.569C114.207 139.844 103.656 131.885 103.656 131.885Z" fill="#989FB0" data-v-682bdb32></path><path d="M99.3064 132.256C99.3064 132.256 94.8639 127.443 91.9948 125.685C91.2544 125.315 90.4215 125.592 90.0513 126.333C86.9045 132.256 86.9045 139.105 87.6449 142.714C88.4779 146.601 95.1416 135.865 95.1416 135.865L99.3064 132.256Z" fill="#989FB0" data-v-682bdb32></path><path d="M97.2716 133.829C97.2716 133.829 94.495 130.867 92.8291 129.756C92.3663 129.571 91.811 129.664 91.6259 130.127C89.7749 133.829 89.6824 137.993 90.2377 140.215C90.793 142.621 94.8652 135.957 94.8652 135.957L97.2716 133.829Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M106.527 132.163C107.083 130.683 109.304 127.906 111.433 126.795C111.71 126.703 111.988 126.795 112.266 127.073C112.821 128.184 114.394 131.053 113.839 133.922C113.098 137.439 106.527 132.163 106.527 132.163Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M193.341 189.451C183.901 185.472 185.289 173.07 186.215 161.594C187.048 161.594 187.788 161.594 188.621 161.594C188.621 158.354 188.621 155.022 188.621 151.783C188.621 151.691 184.271 151.876 183.808 151.876C181.68 151.876 180.569 150.673 178.811 149.932C178.996 150.025 178.348 155.022 178.255 155.578C175.201 168.998 169 173.718 174.831 179.919C176.589 181.77 177.422 185.749 173.35 187.508C169.278 189.081 166.872 183.158 165.483 180.289C163.077 175.291 165.113 167.887 167.704 152.709C167.704 152.709 138.921 152.616 130.684 152.709C130.129 155.022 125.501 171.126 124.853 174.458C123.835 179.456 125.501 183.065 125.871 185.749C126.242 188.618 121.429 190.562 117.819 187.323C113.192 183.065 118.097 176.494 118.745 161.871C118.745 161.038 119.023 152.061 118.467 152.061C108.935 152.061 99.4943 151.968 89.9615 152.153C88.8509 152.153 87.185 152.616 86.5372 151.598C81.3543 144.009 94.4966 126.887 109.12 131.329C111.526 132.07 114.117 133.643 116.709 133.828C116.709 133.828 118.19 133.365 125.686 127.905C138.273 120.686 154.099 121.241 163.91 123.555C177.145 126.702 179.458 137.345 183.253 142.065C188.714 148.914 193.896 150.673 193.156 167.424C192.878 174.18 192.786 177.79 198.339 181.677C202.041 184.639 199.079 191.858 193.341 189.451Z" fill="white" data-v-682bdb32></path><path d="M105.046 150.488C104.028 150.58 102.732 150.765 101.529 150.765C101.159 150.765 100.696 150.765 100.326 150.858C96.2534 150.95 92.3663 150.395 91.8109 147.341C91.4407 144.935 94.8651 141.88 96.7162 140.862C103.01 137.345 109.488 142.528 110.229 145.675C110.784 148.359 107.915 150.025 105.046 150.488Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M100.974 147.155C101.992 147.155 102.825 146.785 102.825 146.23C102.825 145.675 101.992 145.304 100.974 145.304C99.956 145.304 99.123 145.675 99.123 146.23C99.123 146.785 99.956 147.155 100.974 147.155Z" fill="#989FB0" data-v-682bdb32></path><path d="M101.9 147.157V150.766C101.345 150.766 100.604 150.859 100.049 150.859V147.249L101.9 147.157Z" fill="#989FB0" data-v-682bdb32></path><path d="M125.778 185.75C126.148 188.619 121.335 190.562 117.726 187.323C114.117 183.991 117.448 172.792 118.374 166.869C118.837 163.722 118.837 159.928 118.744 156.966C120.317 158.91 124.205 163.815 126.981 166.406C126.148 169.646 125.223 172.607 124.852 174.644C123.834 179.364 125.315 182.973 125.778 185.75Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M174.645 180.013C176.404 181.864 177.236 185.843 173.164 187.602C169.092 189.175 166.686 183.252 165.297 180.383C163.909 177.514 164.187 170.665 165.297 165.112C165.668 163.168 166.13 161.04 166.408 159.189C167.241 159.651 168.166 160.207 168.907 160.762C170.85 162.243 172.794 164.001 175.015 165.204C173.997 168.074 173.164 170.387 172.609 171.498C171.406 174.552 172.887 178.162 174.645 180.013Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M198.246 188.897C195.469 191.488 190.749 188.527 188.158 185.565C185.566 182.603 185.011 173.348 185.936 165.296C186.029 163.908 186.214 162.705 186.029 161.594H188.528V151.784H180.939C180.846 151.691 180.661 151.506 180.568 151.414C180.661 151.043 180.846 150.581 180.939 150.21C181.586 148.267 180.568 146.323 182.79 142.158C183.437 143.177 183.993 143.732 184.641 144.287C185.844 145.398 187.139 146.231 189.361 149.377C193.711 155.301 193.063 167.795 192.878 172.7C192.785 177.791 196.209 180.937 198.338 181.77C200.189 182.696 200.93 186.305 198.246 188.897Z" fill="#D5DDEA" data-v-682bdb32></path><path d="M107.452 136.235H107.359L104.768 135.865C104.305 135.865 104.027 135.402 104.027 135.032C104.027 134.57 104.49 134.292 104.86 134.292L107.452 134.662C107.914 134.662 108.192 135.125 108.192 135.495C108.192 136.05 107.822 136.235 107.452 136.235Z" fill="#AAB2C5" data-v-682bdb32></path><path d="M94.9572 136.513H95.0498L97.6412 136.143C98.1039 136.143 98.3816 135.68 98.3816 135.31C98.3816 134.847 97.9188 134.569 97.5486 134.569L94.9572 134.94C94.4945 134.94 94.2168 135.402 94.2168 135.773C94.4019 136.143 94.587 136.42 94.9572 136.513Z" fill="#AAB2C5" data-v-682bdb32></path><path d="M115.009 70.9834L114.231 66.5173L131.707 63.4717L132.485 67.9377L123.048 84.3879L135.183 82.2729L135.962 86.7389L117.709 89.9199L116.931 85.4539L126.369 69.0037L115.009 70.9834Z" fill="#989FB0" data-v-682bdb32></path><path d="M108.318 101.794L109.129 99.1384L119.397 102.276L118.585 104.931L109.112 111.23L116.193 113.394L115.382 116.049L104.583 112.749L105.395 110.094L114.868 103.795L108.318 101.794Z" fill="#989FB0" data-v-682bdb32></path><path d="M179.642 152.061H188.527V151.968V161.779H177.605" fill="#D5DDEA" data-v-682bdb32></path></svg>',1)),i("p",null,s(r.message),1)])}],["__scopeId","data-v-682bdb32"]]),NotificationCard:Ct({name:"NotificationCard",props:["notification"],data:()=>({}),methods:{getDescriptionPreview(t){const e=this.notification.description||"";return e.length>t?e.substring(0,t)+"...":e},makeNotificationRead(){this.notification.read||this.$put("notifications/read",{notification_id:this.notification.id}).then(t=>{this.notification.read=t.notification.marked_read_at,this.emitter.emit("readSingleNotification",this.notification),this.notification.task_id&&this.emitter.emit("update-notification-in-card",this.notification.task_id)}).catch(t=>{this.handleError(t)})}}},[["render",function(a,h,u,f,p,b){const g=n("Avatar"),m=et,_=tt,v=at;return t(),o(v,{gutter:10},{default:r(()=>[l(_,{span:3,class:"fbs-pd-0"},{default:r(()=>[u.notification.activitist?(t(),e("img",{key:0,class:"fbs-notification-user-avatar",src:u.notification.activitist.photo,title:u.notification.activitist.display_name},null,8,yt)):(t(),o(m,{key:1,class:"fbs-notification-user-avatar fbs-notification-no-user"},{default:r(()=>[l(g)]),_:1}))]),_:1}),l(_,{span:21,style:{"padding-top":"5px"}},{default:r(()=>[u.notification.task?(t(),e("a",{key:0,href:a.$getTaskUrl(u.notification.task,this.notification.settings),onClick:h[0]||(h[0]=(...t)=>b.makeNotificationRead&&b.makeNotificationRead(...t)),class:"fbs-notification-card-details"},[u.notification.activitist?(t(),e("strong",$t,s(u.notification.activitist.display_name),1)):d("",!0),i("span",null,s(" "+a.$t(u.notification.action)),1),u.notification.read?d("",!0):(t(),e("span",St)),i("div",Nt,s(b.getDescriptionPreview(100)),1)],8,wt)):(t(),e("p",Tt,[u.notification.activitist?(t(),e("span",Bt,s(u.notification.activitist.display_name),1)):d("",!0),c(" "+s(b.getDescriptionPreview(120)),1)])),i("div",Vt,[i("span",null,s(a.$humanTimeDiff(u.notification.created_at)),1),h[2]||(h[2]=i("span",{class:"fbs-dot"},null,-1)),u.notification.task?(t(),e("a",{key:0,href:a.$getTaskUrl(u.notification.task,this.notification.settings),onClick:h[1]||(h[1]=(...t)=>b.makeNotificationRead&&b.makeNotificationRead(...t))},s(u.notification.task.title.length>42?u.notification.task.title.substring(0,40)+"...":u.notification.task.title),9,Pt)):d("",!0)])]),_:1})]),_:1})}],["__scopeId","data-v-447d2897"]])},data:()=>({board:null,loading:!1,totalUnread:0,notifications:[],toggle:!0,allNotifications:!1,unreadNotifications:!0,pagination:{current_page:0},drawer:!1,noMoreNotifications:!1,mentionedNotifications:!1,assignedNotifications:!1}),mounted(){this.fetchNotificationNumber(),this.emitter.off("readSingleNotification"),this.emitter.on("readSingleNotification",t=>{this.markNotificationAsRead(t)}),this.eventBus.on("fetch-notification-number",()=>{this.fetchNotificationNumber()})},beforeUnmount(){this.eventBus.off("fetch-notification-number")},methods:{showAllNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!0,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.fetchAllNotifications()},showMentionedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!0,this.assignedNotifications=!1,this.fetchSpecificNotifications()},showAssignedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!0,this.fetchSpecificNotifications()},fetchSpecificNotifications(t={page:1}){this.loading=!0;let e=this.assignedNotifications?"task_assignee_changed":"task_comment_mentioned";this.$get("notifications/",{...t,action:e}).then(t=>{this.setNotifications(t)}).catch(t=>{this.handleError(t)}).finally(()=>{this.loading=!1})},markNotificationAsRead(t){this.unreadNotifications&&(this.notifications=this.notifications.filter(e=>e.id!=t.id),this.noMoreNotifications||this.fetchAllUnreadNotifications()),this.totalUnread--},fetchNotificationNumber(){this.$get("notifications/unread-count").then(t=>{this.totalUnread=t.total_unread}).catch(t=>{this.handleError(t)}).finally(()=>{})},markAllNotificationAsRead(){this.$put("notifications/read",{notification_id:null}).then(t=>{this.unreadNotifications?this.notifications=[]:this.fetchAllNotifications(),this.emitter.emit("update-notification-in-card",null)}).catch(t=>{this.handleError(t)}).finally(()=>{this.totalUnread=0})},openDrawer(){this.drawer=!0,this.unreadNotifications=this.totalUnread>0,this.toggle=!0,this.notifications=[],this.unreadNotifications?this.fetchAllUnreadNotifications():this.fetchAllNotifications()},showUnreadNotifications(){this.notifications=[],this.pagination={current_page:0},this.unreadNotifications=!0,this.allNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.fetchAllUnreadNotifications()},fetchAllNotifications(t={page:1}){this.loading=!0,this.$get("notifications/",t).then(t=>{this.setNotifications(t)}).catch(t=>{this.handleError(t)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},handleScroll(){const t=this.$refs.notificationContainer;if(t){const{scrollTop:e,scrollHeight:a,clientHeight:i}=t;if(e+i>=a-200){if(this.noMoreNotifications||this.loading)return;const t={page:this.pagination.current_page+1};this.mentionedNotifications?this.fetchSpecificNotifications(t):this.unreadNotifications?this.fetchAllUnreadNotifications(t):this.fetchAllNotifications(t)}}},fetchAllUnreadNotifications(t){this.loading=!0,this.$get("notifications/unread",t).then(t=>{this.setNotifications(t)}).catch(t=>{this.handleError(t)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},setNotifications(t){this.notifications=this.updateNotificationsMerge(this.notifications,t.data),this.pagination=t,this.noMoreNotifications="last_page"in this.pagination&&this.pagination.last_page<=this.pagination.current_page&&this.pagination.last_page!=this.pagination.current_page},updateNotificationsMerge(t,e){const a=new Map;return t.forEach(t=>{a.set(t.id,t)}),e.forEach(t=>{a.set(t.id,t)}),Array.from(a.values())},drawerClosing(){this.notifications=[],this.pagination={current_page:0},this.noMoreNotifications=!1,this.allNotifications=!1,this.unreadNotifications=!0,this.mentionedNotifications=!1,this.assignedNotifications=!1}},beforeUnmount(){this.emitter.off("readSingleNotification")}},[["render",function(a,g,m,_,v,C){const k=n("Bell"),y=et,w=it,$=st,S=n("drawer-header"),N=n("MoreFilled"),T=rt,B=ot,V=nt,P=n("notification-card"),D=n("no-notification-found"),M=at,A=lt,E=h("loading");return t(),e("div",null,[l($,{effect:"dark",content:"Notifications",placement:"top"},{default:r(()=>[l(w,{style:{height:"35px",width:"35px","border-radius":"50%"},class:"fbs-btn-notification",onClick:C.openDrawer},{default:r(()=>[l(y,null,{default:r(()=>[l(k)]),_:1}),v.totalUnread>0?(t(),e("p",Dt,[i("span",null,s(v.totalUnread),1)])):d("",!0)]),_:1},8,["onClick"])]),_:1}),l(A,{modelValue:v.drawer,"onUpdate:modelValue":g[6]||(g[6]=t=>v.drawer=t),"append-to-body":"",class:"fbs_right_sidebar","with-header":!1,size:"500px",direction:a.appVars.is_rtl?"ltr":"rtl",onClose:C.drawerClosing},{default:r(()=>[l(S,{"header-title":"Notifications",onCloseDrawer:g[0]||(g[0]=t=>v.drawer=!1)}),i("div",Mt,[i("button",{class:u(["fbs-switch-btn",v.allNotifications?"fbs-active":""]),onClick:g[1]||(g[1]=(...t)=>C.showAllNotifications&&C.showAllNotifications(...t))},s(a.$t("All")),3),i("button",{class:u(["fbs-switch-btn",v.unreadNotifications?"fbs-active":""]),onClick:g[2]||(g[2]=(...t)=>C.showUnreadNotifications&&C.showUnreadNotifications(...t))},s(a.$t("Unread")),3),i("button",{class:u(["fbs-switch-btn",v.mentionedNotifications?"fbs-active":""]),onClick:g[3]||(g[3]=(...t)=>C.showMentionedNotifications&&C.showMentionedNotifications(...t))},s(a.$t("Mentioned")),3),i("button",{class:u(["fbs-switch-btn",v.assignedNotifications?"fbs-active":""]),onClick:g[4]||(g[4]=(...t)=>C.showAssignedNotifications&&C.showAssignedNotifications(...t))},s(a.$t("Assigned")),3),l(V,{trigger:"click",class:"fbs-notification-dropdown"},{dropdown:r(()=>[l(B,null,{default:r(()=>[l(T,{onClick:C.markAllNotificationAsRead,icon:"View"},{default:r(()=>[c(s(a.$t("mark_all_read")),1)]),_:1},8,["onClick"])]),_:1})]),default:r(()=>[i("span",At,[l(y,null,{default:r(()=>[l(N)]),_:1})])]),_:1})]),f((t(),e("div",{onScroll:g[5]||(g[5]=(...t)=>C.handleScroll&&C.handleScroll(...t)),ref:"notificationContainer",class:"fbs_notification_container",id:"notification-container"},[(t(!0),e(p,null,b(v.notifications,(a,i)=>(t(),e("div",{key:i,class:u([i+1==v.notifications.length?"fbs-notification_card-last-child":"","fbs-notification_card"])},[l(P,{notification:a},null,8,["notification"])],2))),128)),v.loading&&v.pagination.current_page>0?f((t(),e("p",Et,null,512)),[[E,!0]]):d("",!0),v.noMoreNotifications&&v.notifications.length>0?(t(),e("p",Lt,s(a.$t("No more notification")),1)):d("",!0),0!==v.notifications.length||v.loading?d("",!0):(t(),o(M,{key:2},{default:r(()=>[l(D,{message:v.unreadNotifications?a.$t("No unread notification"):a.$t("No notification")},null,8,["message"])]),_:1}))],32)),[[E,v.loading]])]),_:1},8,["modelValue","direction","onClose"])])}],["__scopeId","data-v-228badd9"]]),qt={class:"fbs-quick-search-wrap"},Ht={class:"fbs-quick-search-button-text"},xt={class:"fbs-quick-search-header"},Ut={style:{"font-size":"22px"}},Ft={class:"fbs-quick-search-input"},Rt={class:"fbs-quick-search-results-box"},Zt={key:0,class:"fbs-item-type"},Ot={key:1,class:"fbs-quick-search-results"},jt=["href"],Qt={class:"fbs-item-title"},Wt={key:3,class:"fbs-item-type"},zt={key:4,class:"fbs-quick-search-results"},Gt=["href"],Jt={class:"fbs-item-title"},Yt={class:"fbs-item-board"},Xt={key:6,class:"fbs-quick-results-not-found"},Kt={key:7,class:"fbs-item-type"},te={key:8,class:"fbs-quick-search-results"},ee=["onClick"],ae={class:"item-title"};const ie=Ct({name:"QuickSearch",components:{Search:dt,BoardsNotFoundImage:D},data:()=>({query:"",loading:!1,loadingBoards:!1,loadingTasks:!1,searchDialogVisible:!1,boards:[],tasks:[],showRecent:!0,showCurrentBoard:!1,recentQueries:[],search_scope:"all_boards",taskPagination:{page:1,hasMore:!1},boardPagination:{page:1,hasMore:!1},perPage:20,placeholderPhrases:["Review Dragon Deployment sprint board","Type id: 34545 to open task #34545","Open Hogwarts Admissions queue","Review Fortress Defense by Commander task"],currentPhraseIndex:0,currentPlaceholder:"",typingForward:!0,typingCharIndex:0,placeholderInterval:null,holdTimer:null,typingSpeed:70,deletingSpeed:40,holdDuration:1700}),mounted(){document.addEventListener("keydown",t=>{"/"!==t.key||this.searchDialogVisible||["INPUT","TEXTAREA"].includes(t.target.tagName)||t.target.isContentEditable||(t.preventDefault(),this.searchDialogVisible=!0,this.focusSearchInput())}),this.getRecentQueries(),this.startPlaceholderCycling()},computed:{hasResults(){return this.boards.length>0||this.tasks.length>0},userOperatingSystem(){let t=window.navigator.platform;return t.includes("Win")?"windows":t.includes("Mac")?"mac":t.includes("Linux")?"linux":t}},watch:{query(){this.debouncedFetch(),this.tryDirectTaskJump()},search_scope(){this.debouncedFetch()},searchDialogVisible(t){t&&(this.focusSearchInput(),this.$route.params.id?(this.showCurrentBoard=!0,this.search_scope="current_board"):(this.showCurrentBoard=!1,this.search_scope="all_boards"))}},created(){this.debouncedFetch=g(()=>{this.fetchInitialResults()},300)},unmounted(){this.stopPlaceholderCycling()},methods:{showDialog(){this.searchDialogVisible=!0,setTimeout(()=>{this.$refs.queryInput.focus()},100),this.query="",this.boards=[],this.tasks=[],this.taskPagination={page:1,hasMore:!1},this.boardPagination={page:1,hasMore:!1},this.showRecent=!0,this.getRecentQueries(),this.search_scope=this.$route.params.id?"current_board":"all_boards",this.$nextTick(()=>{this.debouncedFetch()})},closeDialog(){this.searchDialogVisible=!1},getBoardUrl:P,startPlaceholderCycling(){if(this.placeholderInterval)return;const t=()=>{if(this.query&&this.query.length>0)return;const t=this.$t?this.$t(this.placeholderPhrases[this.currentPhraseIndex]):this.placeholderPhrases[this.currentPhraseIndex];if(this.typingForward)this.typingCharIndex<t.length?(this.currentPlaceholder=t.slice(0,this.typingCharIndex+1),this.typingCharIndex++):(this.typingForward=!1,clearTimeout(this.holdTimer),this.holdTimer=setTimeout(()=>{this.holdTimer=null},this.holdDuration));else{if(this.holdTimer)return;this.typingCharIndex>0?(this.typingCharIndex--,this.currentPlaceholder=t.slice(0,this.typingCharIndex)):(this.typingForward=!0,this.currentPhraseIndex=(this.currentPhraseIndex+1)%this.placeholderPhrases.length)}},e=()=>{t();const a=this.typingForward?this.typingSpeed:this.holdTimer?120:this.deletingSpeed;this.placeholderInterval=setTimeout(e,a)};e()},stopPlaceholderCycling(){this.placeholderInterval&&(clearTimeout(this.placeholderInterval),this.placeholderInterval=null),this.holdTimer&&(clearTimeout(this.holdTimer),this.holdTimer=null)},async fetchInitialResults(){if(this.query.length<2)return this.loading=!1,this.boards=[],this.tasks=[],this.showRecent=!0,this.taskPagination.hasMore=!1,void(this.boardPagination.hasMore=!1);if(!this.loading){this.loading=!0,this.showRecent=!1,this.boards=[],this.tasks=[],this.taskPagination={page:1,hasMore:!1},this.boardPagination={page:1,hasMore:!1};try{const t=await this.$get("quick-search",{query:this.query,scope:"current_board"===this.search_scope?this.$route.params.id:"all",task_page:1,board_page:1,per_page:this.perPage}),{tasks:e,boards:a}=t;e&&e.data&&e.data.length?(this.tasks=e.data,this.taskPagination.hasMore=e.last_page>e.current_page,this.taskPagination.hasMore&&(this.taskPagination.page=2)):(this.tasks=[],this.taskPagination.hasMore=!1),a&&a.data&&a.data.length?(this.boards=a.data,this.boardPagination.hasMore=a.last_page>a.current_page,this.boardPagination.hasMore&&(this.boardPagination.page=2)):(this.boards=[],this.boardPagination.hasMore=!1),this.addQueryToRecent(this.query)}catch(t){this.$handleError(t)}finally{this.loading=!1}}},async tryDirectTaskJump(){if(!this.query)return;const t=this.query.trim().match(/^id:\s*(\d{1,10})$/i);if(!t)return;const e=t[1];try{const t=await this.$get("tasks/"+e);t&&t.id&&(window.location.href=this.$getTaskUrl(t))}catch(a){}},async fetchMoreBoards(){if(!this.loadingBoards&&this.boardPagination.hasMore){this.loadingBoards=!0;try{const t=await this.$get("quick-search",{query:this.query,scope:"current_board"===this.search_scope?this.$route.params.id:"all",board_page:this.boardPagination.page,per_page:this.perPage}),{boards:e}=t;if(e&&e.data&&e.data.length){const t=[...this.boards,...e.data];this.boards=this.deduplicateBoardsById(t),this.boardPagination.hasMore=e.last_page>e.current_page,this.boardPagination.hasMore&&this.boardPagination.page++}else this.boardPagination.hasMore=!1}catch(t){this.$handleError(t)}finally{this.loadingBoards=!1}}},async fetchMoreTasks(){if(!this.loadingTasks&&this.taskPagination.hasMore){this.loadingTasks=!0;try{const t=await this.$get("quick-search",{query:this.query,scope:"current_board"===this.search_scope?this.$route.params.id:"all",task_page:this.taskPagination.page,per_page:this.perPage}),{tasks:e}=t;if(e&&e.data&&e.data.length){const t=[...this.tasks,...e.data];this.tasks=this.deduplicateTasksById(t),this.taskPagination.hasMore=e.last_page>e.current_page,this.taskPagination.hasMore&&this.taskPagination.page++}else this.taskPagination.hasMore=!1}catch(t){this.$handleError(t)}finally{this.loadingTasks=!1}}},getRecentQueries(){let t=JSON.parse(window.localStorage.getItem("fbs-quick-search-queries"))||[];this.recentQueries=t.reverse()},focusSearchInput(){this.$nextTick(()=>{setTimeout(()=>{var t;const e=this.$refs.queryInput,a=null==(t=null==e?void 0:e.$el)?void 0:t.querySelector("input");a&&a.focus()},100)})},addQueryToRecent(t){this.recentQueries.includes(t)||(this.recentQueries.unshift(t),this.recentQueries.length>5&&this.recentQueries.pop(),localStorage.setItem("fbs-quick-search-queries",JSON.stringify(this.recentQueries)))},deduplicateTasksById(t){const e=new Map;return t.forEach(t=>{e.set(t.id,t)}),Array.from(e.values())},deduplicateBoardsById(t){const e=new Map;return t.forEach(t=>{e.set(t.id,t)}),Array.from(e.values())}}},[["render",function(a,u,g,_,v,C){const k=n("Search"),y=et,w=it,$=ut,S=ht,N=ct,T=n("BoardsNotFoundImage"),B=ft,V=h("loading");return t(),e("div",qt,[l(w,{class:"fbs-quick-search-button",onClick:C.showDialog},{default:r(()=>[l(y,null,{default:r(()=>[l(k)]),_:1}),i("span",Ht,s(a.$t("Search")),1),u[5]||(u[5]=i("kbd",null,"/",-1))]),_:1},8,["onClick"]),l(B,{plain:"",modelValue:v.searchDialogVisible,"onUpdate:modelValue":u[4]||(u[4]=t=>v.searchDialogVisible=t),width:"50%","with-header":!1,"append-to-body":"","modal-class":"fbs-quick-search-dialog","destroy-on-close":!0},{default:r(()=>[i("div",xt,[i("h3",Ut,s(a.$t("Quick Search")),1),i("p",null,s(a.$t("Search for boards and tasks")),1)]),i("div",Ft,[l(N,{modelValue:v.query,"onUpdate:modelValue":u[1]||(u[1]=t=>v.query=t),ref:"queryInput",placeholder:v.currentPlaceholder,"prefix-icon":"Search"},{append:r(()=>[l(S,{class:"fbs-quick-search-dropdown",modelValue:v.search_scope,"onUpdate:modelValue":u[0]||(u[0]=t=>v.search_scope=t),placeholder:"On",style:{width:"140px"}},{default:r(()=>[v.showCurrentBoard?(t(),o($,{key:0,label:"This Board",value:"current_board"})):d("",!0),l($,{label:"All Boards",value:"all_boards"})]),_:1},8,["modelValue"])]),_:1},8,["modelValue","placeholder"])]),f((t(),e("div",Rt,[v.boards.length>0?(t(),e("h4",Zt,s(a.$t("Boards")),1)):d("",!0),v.boards.length>0?(t(),e("ul",Ot,[(t(!0),e(p,null,b(v.boards,n=>(t(),e("li",{key:n.id},[i("a",{href:a.$getBoardUrl(n),class:"fbs-quick-search-results-item"},[i("div",Qt,s(n.title.slice(0,100)),1)],8,jt)]))),128))])):d("",!0),v.boardPagination.hasMore?f((t(),e("div",{key:2,onClick:u[2]||(u[2]=(...t)=>C.fetchMoreBoards&&C.fetchMoreBoards(...t)),class:"fbs-view-more-container"},[i("p",null,s(a.$t("Show more...")),1)])),[[V,v.loadingBoards]]):d("",!0),v.tasks.length>0?(t(),e("h4",Wt,s(a.$t("Tasks")),1)):d("",!0),v.tasks.length>0?(t(),e("ul",zt,[(t(!0),e(p,null,b(v.tasks,n=>(t(),e("li",{key:n.id},[i("a",{href:a.$getTaskUrl(n),class:"fbs-quick-search-results-item"},[i("div",Jt,s(n.title.slice(0,100)),1),i("div",Yt,[c(s(n.board.title)+" - ",1),i("span",null,s(n.stage.title),1)])],8,Gt)]))),128))])):d("",!0),v.taskPagination.hasMore?f((t(),e("div",{key:5,onClick:u[3]||(u[3]=(...t)=>C.fetchMoreTasks&&C.fetchMoreTasks(...t)),class:"fbs-view-more-container"},[i("p",null,s(a.$t("Show more...")),1)])),[[V,v.loadingTasks]]):d("",!0),v.loading||v.showRecent||C.hasResults?d("",!0):(t(),e("div",Xt,[l(T),i("h4",null,s(a.$t("We couldn't find anything matching your query"))+' "'+s(v.query)+'"',1),i("p",null,s(a.$t("Please, Try again with a different term")),1)])),v.showRecent&&v.recentQueries.length>0?(t(),e("h4",Kt,s(a.$t("Recent Searches")),1)):d("",!0),v.showRecent&&v.recentQueries.length>0?(t(),e("ul",te,[(t(!0),e(p,null,b(v.recentQueries,(a,n)=>(t(),e("li",{key:n},[i("a",{onClick:m(t=>v.query=a,["prevent"]),class:"fbs-quick-search-results-item"},[i("div",ae,s(a),1)],8,ee)]))),128))])):d("",!0)])),[[V,v.loading]])]),_:1},8,["modelValue"])])}]]),se={class:"fbs-pinned-boards-button-text"},ne={class:"fbs-pinned-board-item"},oe={class:"fbs-pinned-board-background-part"},re={class:"fbs-pinned-board-description"},le={class:"fbs-board-title"},de={class:"fbs-pinned-board-pin"};const ce=Ct({name:"PinnedBoards",components:{CustomIcon:M},data:()=>({pinnedBoards:[],hoverOnPin:!1,loading:!1,selectedBoardId:null}),created(){this.fetchPinnedBoards()},methods:{handleDropdownVisible(t){t&&this.fetchPinnedBoards()},goToBoard(t){if(this.hoverOnPin)return null;this.$router.push({name:"board",params:{id:t.id}})},fetchPinnedBoards(){this.loading=!0,this.$get("projects/pinned-boards").then(t=>{this.pinnedBoards=t.pinnedBoards}).catch(t=>{this.handleError(t)}).finally(()=>{this.loading=!1})},stripHtmlTags:t=>t?t.replace(/<[^>]*>/g,""):"",unpinBoard(t){this.loading=!0,this.selectedBoardId=t,this.$put("projects/"+t+"/unpin-board").then(e=>{this.fetchPinnedBoards(),this.hoverOnPin=!1,this.emitter.emit("remove-pinned-board",t)}).catch(t=>{this.handleError(t)}).finally(()=>{this.loading=!1,this.selectedBoardId=null})}}},[["render",function(a,d,u,g,v,C){const k=n("arrow-down"),y=et,w=n("custom-icon"),$=it,S=rt,N=ot,T=nt,B=h("loading");return t(),o(T,{placement:"bottom-end",class:"fbs-pinned-boards",trigger:"click",onVisibleChange:C.handleDropdownVisible},{dropdown:r(()=>[l(N,null,{default:r(()=>[v.pinnedBoards.length?(t(!0),e(p,{key:0},b(v.pinnedBoards,n=>(t(),o(S,{key:n.id,class:"fbs-pinned-board-items",onClick:t=>C.goToBoard(n)},{default:r(()=>{var o,r,c,h,u;return[f((t(),e("div",ne,[i("div",oe,[i("div",{class:"fbs-board-background",style:_((null==(o=null==n?void 0:n.background)?void 0:o.is_image)?`background-image: url(${null==(r=null==n?void 0:n.background)?void 0:r.image_url});`:`background: ${null==(c=null==n?void 0:n.background)?void 0:c.color}`)},null,4)]),i("div",re,[i("p",le,s((null==(h=null==n?void 0:n.title)?void 0:h.length)>20?C.stripHtmlTags(n.title.substring(0,20))+"...":C.stripHtmlTags(n.title)),1),i("p",null,s((null==(u=null==n?void 0:n.description)?void 0:u.length)>30?C.stripHtmlTags(n.description.substring(0,30))+"...":C.stripHtmlTags(n.description)),1)]),i("div",de,[l(w,{onMouseenter:d[0]||(d[0]=t=>v.hoverOnPin=!0),onMouseleave:d[1]||(d[1]=t=>v.hoverOnPin=!1),onClick:[d[2]||(d[2]=m(()=>{},["stop"])),t=>C.unpinBoard(n.id)],"icon-name":"pin-filled",class:"fbs-is-favorited",fillColor:"#0047AB",title:a.$t("board is pinned")},null,8,["title","onClick"])])])),[[B,v.loading&&v.selectedBoardId===n.id]])]}),_:2},1032,["onClick"]))),128)):(t(),o(S,{key:1},{default:r(()=>[c(s(a.$t("No pinned board yet!")),1)]),_:1}))]),_:1})]),default:r(()=>[l($,{class:"fbs-pinned-boards-button"},{default:r(()=>[i("span",se,s(a.$t("Pinned")),1),l(y,{class:"el-icon--right"},{default:r(()=>[l(k)]),_:1}),l($,{class:"fbs-pinned-boards-icon",style:{display:"none"}},{default:r(()=>[l(w,{"icon-name":"pin-no-filled",strokeColor:"gray",title:a.$t("Pinned Boards")},null,8,["title"])]),_:1})]),_:1})]),_:1},8,["onVisibleChange"])}]]),he={name:"GlobalAddBoardStageTaskCreate",inject:["eventBus"],components:{DrawerHeader:V,AddNewBoard:E},data:()=>({drawer:!1,activeName:"Board",task:{title:"",board_id:null,stage_id:null},boards:[],stages:[],openTaskAfterCreate:!1,stage:{title:"",status:"open",board_id:null},boardLoading:!1,isSavingTask:!1,isSavingStage:!1,statusOptions:[{value:"open",label:"Open"},{value:"closed",label:"Closed"}]}),computed:{...v(A,["board"]),isAdmin(){return["wordpress_admin","fluent_boards_admin"].includes(this.appVars.me.fluent_boards_role)},canCreateBoard(){return this.$canCreateBoard()},...v(A,["board"])},methods:{openDrawer(){this.drawer=!0,this.activeName="Board","board"!==this.$route.name&&this.canCreateBoard||(this.activeName="Task",!this.board||this.board.archived_at||this.board.isUserOnlyViewer||(this.task.board_id=parseInt(this.$route.params.id)),this.getBoardWithStages())},changeTab(t){if(this.activeName=t,"Board"!==this.activeName){if("board"===this.$route.name&&this.board&&!this.board.archived_at&&!this.board.isUserOnlyViewer){const t=parseInt(this.$route.params.id);this.task.board_id=t,this.stage.board_id=t}if(this.boards.length)return;this.getBoardWithStages()}},getBoardWithStages(){this.boardLoading=!0,this.$get("projects/list-of-boards",{withRoadmap:!0}).then(t=>{this.boards=t.boards,this.boardStage()}).catch(t=>{this.handleError(t)}).finally(()=>{this.boardLoading=!1})},boardStage(){const t=this.boards.find(t=>t.id===this.task.board_id);this.stages=t?t.stages:[]},createTask(){this.isSavingTask||(this.task.title.trim()?this.task.board_id?this.task.stage_id?(this.isSavingTask=!0,this.$post("projects/"+this.task.board_id+"/tasks",{task:this.task}).then(t=>{if(this.openTaskAfterCreate){const e=`/boards/${t.task.board_id}/tasks/${t.task.id}-${L(t.task.title)}`;this.$router.push({path:e,query:this.$route.query})}this.$route.params.id==this.task.board_id&&this.eventBus.emit("update-tasks",t.updatedTasks),this.$notify({title:this.$t("Success"),message:this.$t("Task Created"),type:"success"}),this.resetTask()}).catch(t=>{this.handleError(t)}).finally(()=>{this.isSavingTask=!1})):this.$notify({message:this.$t("Select a Stage"),type:"error"}):this.boardIdEmptyError():this.titleEmptyError("Task"))},createStage(){this.isSavingStage||(this.stage.title.trim()?this.stage.board_id?(this.isSavingStage=!0,this.$post("projects/"+this.stage.board_id+"/stage-create",this.stage).then(t=>{this.$route.params.id==this.stage.board_id&&this.eventBus.emit("update-stages",t.updatedStages),this.$notify({title:this.$t("Success"),message:this.$t("Stage Created"),type:"success"}),this.resetStage()}).catch(t=>{this.handleError(t)}).finally(()=>{this.isSavingStage=!1})):this.boardIdEmptyError():this.titleEmptyError("Task"))},resetVariable(){this.activeName="Board",this.boards=[],this.stages=[],this.openTaskAfterCreate=!1,this.resetTask(),this.resetStage()},titleEmptyError(t){this.$notify({message:this.$t(`${t} title cannot be empty.`),type:"error"})},boardIdEmptyError(){this.$notify({message:this.$t("Select a Board"),type:"error"})},resetTask(){this.task={title:"",board_id:null,stage_id:null},this.drawer=!1},resetStage(){this.stage={title:"",status:"open",board_id:null},this.drawer=!1},cancelBoardDrawer(){this.drawer=!1}}},ue={class:"fbs_global_add_drawer_body"},fe={class:"fbs_global_add_drawer_menu"},pe={class:"fbs_global_add_drawer_content"},be={key:1,class:"fbs_global_add_task"},ge={class:"fbs-actions"},me=["disabled"],_e={key:2,class:"fbs_global_add_task"},ve={class:"fbs-actions"},Ce=["disabled"];const ke={class:"fl_app"},ye={key:0},we={class:"fbs-global-menu-icons",ref:"global_menu_right"},$e=["src"];const Se=Ct({name:"DashboardApplication",inject:["eventBus"],components:{QuickSearch:ie,Notification:It,PinnedBoards:ce,GlobalAddBoardStageTask:Ct(he,[["render",function(a,g,m,v,C,k){const y=n("Plus"),w=et,$=it,S=n("drawer-header"),N=n("add-new-board"),T=ct,B=ut,V=n("Search"),P=ht,D=pt,M=lt,A=h("loading");return t(),e(p,null,[C.drawer?d("",!0):(t(),o($,{key:0,class:"fbs_global_add_drawer_button fbs_save_button",onClick:k.openDrawer},{default:r(()=>[l(w,{class:"fbs_global_add_drawer_button-icon"},{default:r(()=>[l(y)]),_:1})]),_:1},8,["onClick"])),l(M,{modelValue:C.drawer,"onUpdate:modelValue":g[15]||(g[15]=t=>C.drawer=t),"append-to-body":"","with-header":!1,class:"fbs_global_add_drawer",onClose:k.resetVariable,direction:a.appVars.is_rtl?"ltr":"rtl"},{default:r(()=>[i("div",null,[l(S,{"header-title":`Create New ${C.activeName}`,onCloseDrawer:g[0]||(g[0]=t=>C.drawer=!1)},null,8,["header-title"]),i("div",ue,[i("div",fe,[i("div",{onClick:g[1]||(g[1]=t=>k.changeTab("Task")),class:u(["Task"===C.activeName?"fbs_global_add_tab_active":"","fbs_global_add_tab"])},s(a.$t("Task")),3),i("div",{onClick:g[2]||(g[2]=t=>k.changeTab("Stage")),class:u(["Stage"===C.activeName?"fbs_global_add_tab_active":"","fbs_global_add_tab"])},s(a.$t("Stage")),3),k.canCreateBoard?(t(),e("div",{key:0,onClick:g[3]||(g[3]=t=>k.changeTab("Board")),class:u(["Board"===C.activeName?"fbs_global_add_tab_active":"","fbs_global_add_tab"])},s(a.$t("Board")),3)):d("",!0)]),i("div",pe,["Board"===C.activeName?(t(),o(N,{key:0,"drawer-visible":"Board"===C.activeName,onCloseDrawer:k.cancelBoardDrawer,"with-header":!1},null,8,["drawer-visible","onCloseDrawer"])):d("",!0),"Task"==C.activeName?(t(),e("div",be,[i("p",null,[c(s(a.$t("Title")),1),g[16]||(g[16]=i("span",null,"*",-1))]),l(T,{modelValue:C.task.title,"onUpdate:modelValue":g[4]||(g[4]=t=>C.task.title=t),placeholder:a.$t("Task Title"),size:"large"},null,8,["modelValue","placeholder"]),i("p",null,[c(s(a.$t("Board")),1),g[17]||(g[17]=i("span",null,"*",-1))]),f((t(),o(P,{class:"fbs-ajax-selector",modelValue:C.task.board_id,"onUpdate:modelValue":g[5]||(g[5]=t=>C.task.board_id=t),filterable:"",remote:"","reserve-keyword":"",placeholder:a.$t("Search or Select Board"),"popper-class":"fbs_popover",onChange:k.boardStage},{prefix:r(()=>[l(w,null,{default:r(()=>[l(V)]),_:1})]),default:r(()=>[(t(!0),e(p,null,b(C.boards,e=>(t(),o(B,{key:e.id,label:e.title,value:e.id,style:_({display:e.archived_at||e.isUserOnlyViewer?"none":""}),disabled:e.archived_at||e.isUserOnlyViewer},null,8,["label","value","style","disabled"]))),128))]),_:1},8,["modelValue","placeholder","onChange"])),[[A,C.boardLoading]]),i("p",null,[c(s(a.$t("Stage")),1),g[18]||(g[18]=i("span",null,"*",-1))]),l(P,{class:"fbs-ajax-selector",modelValue:C.task.stage_id,"onUpdate:modelValue":g[6]||(g[6]=t=>C.task.stage_id=t),filterable:"",remote:"",clearable:"","reserve-keyword":"",placeholder:a.$t("Search or Select Stage"),"popper-class":"fbs_popover",disabled:!C.task.board_id},{prefix:r(()=>[l(w,null,{default:r(()=>[l(V)]),_:1})]),default:r(()=>[(t(!0),e(p,null,b(C.stages,e=>(t(),o(B,{key:e.id,label:e.title,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),l(D,{modelValue:C.openTaskAfterCreate,"onUpdate:modelValue":g[7]||(g[7]=t=>C.openTaskAfterCreate=t),label:a.$t("Go To task after creation."),size:"large"},null,8,["modelValue","label"]),i("div",ge,[i("div",{class:u(["fbs-btn fbs-create",{"fbs-disabled":C.isSavingTask}]),onClick:g[8]||(g[8]=(...t)=>k.createTask&&k.createTask(...t)),disabled:C.isSavingTask},s(C.isSavingTask?a.$t("Saving..."):a.$t("Save")),11,me),i("div",{class:"fbs-btn fbs-cancel",onClick:g[9]||(g[9]=(...t)=>k.resetTask&&k.resetTask(...t))},s(a.$t("Cancel")),1)])])):d("",!0),"Stage"==C.activeName?(t(),e("div",_e,[i("p",null,[c(s(a.$t("Title")),1),g[19]||(g[19]=i("span",null,"*",-1))]),l(T,{modelValue:C.stage.title,"onUpdate:modelValue":g[10]||(g[10]=t=>C.stage.title=t),placeholder:a.$t("Stage Title"),size:"large"},null,8,["modelValue","placeholder"]),i("p",null,[c(s(a.$t("Status")),1),g[20]||(g[20]=i("span",null,"*",-1))]),l(P,{modelValue:C.stage.status,"onUpdate:modelValue":g[11]||(g[11]=t=>C.stage.status=t),placeholder:"Select"},{default:r(()=>[(t(!0),e(p,null,b(C.statusOptions,e=>(t(),o(B,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),i("p",null,[c(s(a.$t("Board")),1),g[21]||(g[21]=i("span",null,"*",-1))]),f((t(),o(P,{class:"fbs-ajax-selector",modelValue:C.stage.board_id,"onUpdate:modelValue":g[12]||(g[12]=t=>C.stage.board_id=t),filterable:"",remote:"","reserve-keyword":"",placeholder:a.$t("Search or Select Board"),"popper-class":"fbs_popover"},{prefix:r(()=>[l(w,null,{default:r(()=>[l(V)]),_:1})]),default:r(()=>[(t(!0),e(p,null,b(C.boards,e=>(t(),o(B,{key:e.id,label:e.title,value:e.id,style:_({display:e.archived_at||e.isUserOnlyViewer?"none":""}),disabled:e.archived_at||e.isUserOnlyViewer},null,8,["label","value","style","disabled"]))),128))]),_:1},8,["modelValue","placeholder"])),[[A,C.boardLoading]]),i("div",ve,[i("div",{class:u(["fbs-btn fbs-create",{"fbs-disabled":C.isSavingStage}]),onClick:g[13]||(g[13]=(...t)=>k.createStage&&k.createStage(...t)),disabled:C.isSavingStage},s(C.isSavingStage?a.$t("Saving..."):a.$t("Save")),11,Ce),i("div",{class:"fbs-btn fbs-cancel",onClick:g[14]||(g[14]=(...t)=>k.resetStage&&k.resetStage(...t))},s(a.$t("Cancel")),1)])])):d("",!0)])])])]),_:1},8,["modelValue","onClose","direction"])],64)}],["__scopeId","data-v-82f237e2"]])},data:()=>({onlineStatus:!0,willRender:!0,isFullScreen:!1,isBeta:!1,isActiveWindow:!0,intervalTimer:null,activeWindowHasDataChangeTimeOut:null,hasInitializedConnectionStatus:!1,connectionStatusCheckId:0}),watch:{onlineStatus(t,e){this.hasInitializedConnectionStatus&&t!==e&&(t?this.$notify({title:"Online",message:"You're back online.",type:"success"}):this.$notify({title:"Offline",message:"You are offline. Changes made now will not be saved.",type:"error"}))}},methods:{async checkBackendConnection(){var t,e;const a=null==(e=null==(t=this.appVars)?void 0:t.rest)?void 0:e.url;if(!a)return!1;const i="undefined"!=typeof AbortController?new AbortController:null;let s=null;i&&(s=setTimeout(()=>i.abort(),3e3));try{return(await fetch(a,{method:"HEAD",cache:"no-store",credentials:"same-origin",headers:{"X-Requested-With":"XMLHttpRequest"},signal:i?i.signal:void 0})).ok}catch(n){return!1}finally{s&&clearTimeout(s)}},async updateConnectionStatus(t=null){const e=++this.connectionStatusCheckId;if("offline"===(null==t?void 0:t.type))return void(this.onlineStatus=!1);const a=await this.checkBackendConnection();e===this.connectionStatusCheckId&&(this.onlineStatus=a)},toggleFullScreen(){this.isFullScreen="yes"==this.isFullScreen?"no":"yes",this.Storage.set("full_screen",this.isFullScreen),"yes"===this.isFullScreen?(document.body.classList.add("fbs_full_screen"),document.documentElement.classList.remove("wp-toolbar")):(document.body.classList.remove("fbs_full_screen"),document.documentElement.classList.add("wp-toolbar"))},updateViewClass(){const t=document.querySelector(".fluent_boards_frontend"),e=document.getElementById("fluent-boards-app");if(t){const t=document.querySelector(".fframe_main-menu-items"),a=document.querySelector(".fframe_menu_small_screen"),i=e.offsetWidth;i<=530?(t.classList.add("fbs_small_screen_menu_items"),a.classList.add("fbs_small_screen_menu_items"),e.classList.add("fbs_app_mobile_view"),e.classList.remove("fbs_app_tablet_view","fbs_app_laptop_view")):i<=809?(t.classList.add("fbs_small_screen_menu_items"),a.classList.add("fbs_small_screen_menu_items"),e.classList.add("fbs_app_tablet_view"),e.classList.remove("fbs_app_mobile_view","fbs_app_laptop_view")):i<=1133?(t.classList.add("fbs_small_screen_menu_items"),a.classList.add("fbs_small_screen_menu_items"),e.classList.add("fbs_app_laptop_view"),e.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view")):(t.classList.remove("fbs_small_screen_menu_items"),a.classList.remove("fbs_small_screen_menu_items"),e.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view","fbs_app_laptop_view"))}},handleWindowVisibilityChange(){"visible"===document.visibilityState?(this.isActiveWindow||(this.eventBus.emit("has-board-data-changed"),this.isActiveWindow=!0),this.activeWindowHasDataChangeTimeOut&&clearTimeout(this.activeWindowHasDataChangeTimeOut)):this.activeWindowHasDataChangeTimeOut=setTimeout(()=>{this.isActiveWindow=!1},3e5)}},async mounted(){jQuery(".notice-warning, .notice-error").remove(),window.addEventListener("online",this.updateConnectionStatus),window.addEventListener("offline",this.updateConnectionStatus),window.addEventListener("resize",this.updateViewClass),document.addEventListener("visibilitychange",this.handleWindowVisibilityChange),await this.updateConnectionStatus({type:"initial"}),this.hasInitializedConnectionStatus=!0,this.intervalTimer=setInterval(()=>{navigator.onLine&&!window.request_is_pending&&this.isActiveWindow&&(this.eventBus.emit("has-board-data-changed"),this.eventBus.emit("fetch-notification-number"))},3e5)},beforeUnmount(){document.removeEventListener("visibilitychange",this.handleWindowVisibilityChange),window.removeEventListener("online",this.updateConnectionStatus),window.removeEventListener("offline",this.updateConnectionStatus),window.removeEventListener("resize",this.updateViewClass),this.intervalTimer&&clearInterval(this.intervalTimer)},created(){this.isBeta=this.appVars.is_beta,this.isFullScreen=this.Storage.get("full_screen","no"),this.updateViewClass(),"yes"===this.isFullScreen?document.body.classList.add("fbs_full_screen"):document.body.classList.remove("fbs_full_screen")}},[["render",function(a,s,h,u,f,p){const b=bt,g=n("router-view"),m=n("quick-search"),_=n("pinned-boards"),v=n("notification"),k=n("global-add-board-stage-task"),y=n("FullScreen"),w=et,$=it,S=n("router-link"),N=st;return t(),e("div",ke,[f.isBeta?(t(),e("div",ye,[l(b,{type:"warning",center:"",closable:!1,"close-text":!1},{default:r(()=>[...s[0]||(s[0]=[i("p",{style:{"font-size":"16px",color:"black"}},[c(" You are using FluentBoards Beta Version. We just launched special Lifetime Deal for Beta users "),i("a",{class:"el-button fbs-primary-btn",href:"https://fluentboards.com/discount-deal/",rel:"noopener",target:"_blank"},"Get FluentBoards Pro")],-1)])]),_:1})])):d("",!0),l(g),(t(),o(C,{to:"#fluent_app_actions"},[i("div",we,[l(m),l(_),l(v),l(k),l($,{onClick:p.toggleFullScreen,title:"Toggle Full Screen Mode",class:"fbs_full_screen_btn",size:"default"},{default:r(()=>[l(w,null,{default:r(()=>[l(y)]),_:1})]),_:1},8,["onClick"]),l(N,{content:a.$t("Profile"),placement:"bottom"},{default:r(()=>{var e;return[(null==(e=a.appVars.me)?void 0:e.id)?(t(),o(S,{key:0,class:"fbs-my-profile-link",to:"/member/"+a.appVars.me.id},{default:r(()=>[i("img",{src:a.appVars.me.photo,alt:"My Profile"},null,8,$e)]),_:1},8,["to"])):d("",!0)]}),_:1},8,["content"])],512)]))])}],["__scopeId","data-v-f4ebf7ed"]]),Ne=T(),Te=k(Se),Be=T();Te.config.globalProperties.appVars=window.fluentAddonVars,Te.config.globalProperties.appVars.isFrontView="front"===window.fluentAddonVars.render_in,window.Fuse=y,window.moment=I,Te.mixin({data:()=>({Storage:Y,hasPro:!!window.fluentAddonVars.has_pro,isTouchScreen:"ontouchstart"in window||navigator.maxTouchPoints>0}),methods:{$get:J.get,$post:J.post,$put:J.put,$del:J.delete,$uploadFile:J.uploadFile,formatNumber:(t,e=!1)=>!t&&e?"":(t||(t="0"),new Intl.NumberFormat("en-US").format(t)),$changeTitle(t=null){null!=t?jQuery("head title").text(t+" - FluentBoards"):jQuery("head title").text("FluentBoards")},$t:G,$humanTimeDiff:z,$handleError:W,handleError:W,convertToText:Q,$validateEmail:j,smartDate:O,$smartDate:U,$checkOverdue:Z,$formatDate:R,$smartDateRange:F,smartDateWithYear:U,taskGroupingByStages:x,sortTaskByPosition:H,$getPref:(t,e="")=>Y.get(t,e),$setPref(t,e){Y.set(t,e)},$formatMinutes(t){let e=parseInt(t);if(!e)return"--";const a=Math.floor(e/60);return e%=60,a?e?`${a}h ${e}m`:`${a}h`:`${e}m`},$getTaskUrl:q,$getBoardUrl:P,$isAdmin(){let t=window.fluentAddonVars.me.fluent_boards_role;return"wordpress_admin"===t||"fluent_boards_admin"===t},$isMember:()=>"member"===window.fluentAddonVars.me.fluent_boards_role,$isBoardManager(t){const e=window.fluentAddonVars.me.fluent_boards_capabilities.find(e=>e.board_id==t);return!!e&&"board_admin"===e.role},$canCreateBoard:()=>!!window.fluentAddonVars.me.can_create_board}}),Te.config.globalProperties.$notify=t=>{gt({...t,position:"bottom-right",style:{}})},Te.config.globalProperties.$notify.success=t=>{gt({...t,position:"bottom-right",type:"success",style:{}})},Te.config.globalProperties.$notify.error=t=>{gt({...t,position:"bottom-right",title:"Error",type:"error",style:{}})},Te.config.globalProperties.$notify.warning=t=>{gt({...t,position:"bottom-right",title:"Warning",type:"warning",style:{}})},Te.config.globalProperties.$confirm=mt.confirm,Te.config.globalProperties.emitter=Ne;const Ve=w({routes:K,history:$()}),Pe=S();Pe.use(N),Te.use(Ve),Te.use(_t),Te.use(Pe),Te.provide("eventBus",Be),Te.directive("prevent-context-menu",X);for(const[De,Me]of Object.entries(vt))Te.component(De,Me);Te.mount("#fluent-framework-app"),Ve.beforeEach((t,e,a)=>{window.fbsPreviousRoute=e,a()}),Ve.afterEach((t,e)=>{const a=t.meta.active_menu;jQuery(".fframe_menu li").removeClass("active_item"),jQuery(".fframe_menu li.fframe_item_"+a).addClass("active_item"),jQuery(".toplevel_page_fluent_frame li").removeClass("current"),jQuery(".toplevel_page_fluent_frame li.fluent_frame_"+a).addClass("current"),t.meta.title&&jQuery("head title").text(t.meta.title+" - Fluent Boards")}); |
|
1
|
+import{aO as e,S as t,Z as i,_ as s,T as a,$ as n,a0 as o,a7 as l,H as r,a9 as c,a8 as d,ax as h,a2 as f,a6 as m,aP as u,a5 as p,a_ as b,av as g,R as _,c0 as v,c1 as y,c2 as w,U as k,bx as N,c3 as C,c4 as $,c5 as T,c6 as S,c7 as M,c8 as L}from"../vendor.js?ver=2.2.0";import{t as I,P as B,D as x,C as A,T as E,a as P,m as F,g as V,b as q,s as U,c as D,d as R,e as O,f as W,h as j,i as H,v as z,j as K,k as Q,l as Z,$ as G,n as Y,o as X,R as J,p as ee,S as te,q as ie,r as se,u as ae}from"../UpgradeUrl.js?ver=2.2.0";import{E as ne,a as oe,b as le,c as re,d as ce,e as de,f as he,g as fe,h as me,i as ue,j as pe,k as be,l as ge,m as _e,n as ve}from"../vendor-element-plus.js?ver=2.2.0";import{_ as ye,E as we,I as ke,B as Ne,d as Ce}from"../descriptionToPlainText.js?ver=2.2.0";const $e={class:"fbs_no_notification_found"};const Te={class:"fbs-notification-avatar-wrap"},Se=["src","alt","title"],Me={key:2,class:"fbs-unread-mark","aria-hidden":"true"},Le={class:"fbs-notification-card-content"},Ie={class:"fbs-notification-card-details"},Be={key:0,class:"fbs-notification-card-actor"},xe={key:1,class:"fbs-notification-card-action"},Ae={key:2,class:"fbs-notification-card-action"},Ee={key:0,class:"fbs-notification-card-task-title"},Pe={key:1,class:"fbs-notification-card-action"},Fe={key:0,class:"fbs-notification-card-task-title"},Ve={key:1,class:"fbs-notification-card-action"},qe={key:0,class:"fbs-notification-card-actor"},Ue={class:"fbs-notification-card-action"},De={class:"fbs-notification-card-details-bottom"};const Re={class:"icon"},Oe={key:0,class:"fbs-notification-button-badge"},We={class:"fbs-notification-actions"},je=["aria-label"],He=["aria-selected"],ze=["aria-selected"],Ke=["aria-selected"],Qe=["aria-selected"],Ze={class:"icon"},Ge={class:"icon"},Ye={key:0,class:"fbs-notification-loading-spacer"};const Xe=ye({name:"Notification",inject:["eventBus"],components:{Icons:ke,DrawerHeader:x,Pagination:B,NoNotificationFound:ye({name:"NoNotificationFound",components:{EmptyState:we},props:{message:{type:String,required:!0}}},[["render",function(a,n,o,l,r,c){const d=e("empty-state");return t(),i("div",$e,[s(d,{message:o.message,"icon-width":120,"icon-height":92},null,8,["message"])])}]]),NotificationCard:ye({name:"NotificationCard",props:["notification"],data:()=>({descriptionActions:["task_due_date_changed","task_start_date_changed","task_priority_changed","task_moved_to_new_stage"]}),methods:{pieces:e=>I(e),getDescriptionPreview(e){const t=this.notification.description||"";return t.length>e?t.substring(0,e)+"...":t},makeNotificationRead(){this.notification.read||this.$put("notifications/read",{notification_id:this.notification.id}).then(e=>{this.notification.read=e.notification.marked_read_at,this.emitter.emit("readSingleNotification",this.notification),this.notification.task_id&&this.emitter.emit("update-notification-in-card",this.notification.task_id)}).catch(e=>{this.handleError(e)})}}},[["render",function(u,p,b,g,_,v){const y=e("Avatar"),w=ne;return t(),a(m(b.notification.task?"a":"div"),{class:f(["fbs-notification_card",{"fbs-notification_card--clickable":b.notification.task}]),href:b.notification.task?u.$getTaskUrl(b.notification.task,b.notification.settings):void 0,onClick:p[0]||(p[0]=e=>b.notification.task&&v.makeNotificationRead())},{default:n(()=>[o("span",Te,[b.notification.activitist?(t(),i("img",{key:0,class:"fbs-notification-user-avatar",src:b.notification.activitist.photo,alt:b.notification.activitist.display_name,title:b.notification.activitist.display_name},null,8,Se)):(t(),a(w,{key:1,class:"fbs-notification-user-avatar fbs-notification-no-user"},{default:n(()=>[s(y)]),_:1})),b.notification.read?l("",!0):(t(),i("span",Me))]),o("span",Le,[o("span",Ie,[b.notification.task?(t(),i(r,{key:0},[b.notification.activitist?(t(),i("span",Be,c(b.notification.activitist.display_name),1)):l("",!0),"task_assignee_changed"==b.notification.action?(t(),i("span",xe,c(" "+v.getDescriptionPreview(120)),1)):(t(),i("span",Ae,c(" "+u.$t(b.notification.action)),1)),_.descriptionActions.includes(b.notification.action)?(t(),i(r,{key:3},[p[1]||(p[1]=d(c(" ")+" ",-1)),(t(!0),i(r,null,h(v.pieces(u.$t("to %s")),(e,s)=>(t(),i(r,{key:"to"+s},[e.arg?(t(),i("span",Ee,c(v.getDescriptionPreview(120)),1)):(t(),i("span",Pe,c(e.text),1))],64))),128))],64)):l("",!0),b.notification.task.title?(t(),i(r,{key:4},[p[2]||(p[2]=d(c(" ")+" ",-1)),(t(!0),i(r,null,h(v.pieces(u.$t("in %s")),(e,s)=>(t(),i(r,{key:"in"+s},[e.arg?(t(),i("span",Fe,c(b.notification.task.title),1)):(t(),i("span",Ve,c(e.text),1))],64))),128))],64)):l("",!0)],64)):(t(),i(r,{key:1},[b.notification.activitist?(t(),i("span",qe,c(b.notification.activitist.display_name),1)):l("",!0),o("span",Ue,c(b.notification.activitist?" "+v.getDescriptionPreview(120):v.getDescriptionPreview(120)),1)],64))]),o("span",De,c(u.$humanTimeDiff(b.notification.created_at)),1)])]),_:1},8,["class","href"])}]])},data:()=>({board:null,loading:!1,totalUnread:0,notifications:[],toggle:!0,allNotifications:!1,unreadNotifications:!0,pagination:{current_page:0},drawer:!1,noMoreNotifications:!1,mentionedNotifications:!1,assignedNotifications:!1}),computed:{notificationEmptyMessage(){return this.unreadNotifications?"No unread notifications":"No notifications"}},mounted(){this.fetchNotificationNumber(),this.emitter.on("readSingleNotification",this.markNotificationAsRead),this.eventBus.on("fetch-notification-number",this.fetchNotificationNumber)},beforeUnmount(){this.emitter.off("readSingleNotification",this.markNotificationAsRead),this.eventBus.off("fetch-notification-number",this.fetchNotificationNumber)},methods:{showAllNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!0,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.fetchAllNotifications()},showMentionedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!0,this.assignedNotifications=!1,this.fetchSpecificNotifications()},showAssignedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!0,this.fetchSpecificNotifications()},fetchSpecificNotifications(e={page:1}){this.loading=!0;let t=this.assignedNotifications?"task_assignee_changed":"task_comment_mentioned";this.$get("notifications/",{...e,action:t}).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})},markNotificationAsRead(e){this.unreadNotifications&&(this.notifications=this.notifications.filter(t=>t.id!=e.id),this.noMoreNotifications||this.fetchAllUnreadNotifications()),this.totalUnread--},fetchNotificationNumber(){this.$get("notifications/unread-count").then(e=>{this.totalUnread=e.total_unread}).catch(e=>{this.handleError(e)}).finally(()=>{})},markAllNotificationAsRead(){this.$put("notifications/read",{notification_id:null}).then(e=>{this.unreadNotifications?this.notifications=[]:this.fetchAllNotifications(),this.emitter.emit("update-notification-in-card",null)}).catch(e=>{this.handleError(e)}).finally(()=>{this.totalUnread=0})},openDrawer(){this.drawer=!0,this.unreadNotifications=this.totalUnread>0,this.allNotifications=!this.unreadNotifications,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.toggle=!0,this.notifications=[],this.unreadNotifications?this.fetchAllUnreadNotifications():this.fetchAllNotifications()},showUnreadNotifications(){this.notifications=[],this.pagination={current_page:0},this.unreadNotifications=!0,this.allNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.fetchAllUnreadNotifications()},fetchAllNotifications(e={page:1}){this.loading=!0,this.$get("notifications/",e).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},handleScroll(){const e=this.$refs.notificationContainer;if(e){const{scrollTop:t,scrollHeight:i,clientHeight:s}=e;if(t+s>=i-200){if(this.noMoreNotifications||this.loading)return;const e={page:this.pagination.current_page+1};this.mentionedNotifications||this.assignedNotifications?this.fetchSpecificNotifications(e):this.unreadNotifications?this.fetchAllUnreadNotifications(e):this.fetchAllNotifications(e)}}},fetchAllUnreadNotifications(e){this.loading=!0,this.$get("notifications/unread",e).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},setNotifications(e){this.notifications=this.updateNotificationsMerge(this.notifications,e.data),this.pagination=e,this.noMoreNotifications="last_page"in this.pagination&&this.pagination.last_page<=this.pagination.current_page&&this.pagination.last_page!=this.pagination.current_page},updateNotificationsMerge(e,t){const i=new Map;return e.forEach(e=>{i.set(e.id,e)}),t.forEach(e=>{i.set(e.id,e)}),Array.from(i.values())},drawerClosing(){this.notifications=[],this.pagination={current_page:0},this.noMoreNotifications=!1,this.allNotifications=!1,this.unreadNotifications=!0,this.mentionedNotifications=!1,this.assignedNotifications=!1}}},[["render",function(m,b,g,_,v,y){const w=e("Icons"),k=oe,N=le,C=e("drawer-header"),$=de,T=ce,S=re,M=e("notification-card"),L=e("no-notification-found"),I=he,B=fe,x=u("loading");return t(),i("div",null,[s(N,{effect:"dark",content:m.$t("Notifications"),placement:"bottom"},{default:n(()=>[s(k,{text:"",size:"small",class:"fbs_topbar_icon_btn only-icon-btn fbs-notification-button","aria-label":m.$t("Notifications"),onClick:y.openDrawer},{default:n(()=>[o("span",Re,[s(w,{"icon-name":"bell"})]),v.totalUnread>0?(t(),i("span",Oe,c(v.totalUnread>99?"99+":v.totalUnread),1)):l("",!0)]),_:1},8,["aria-label","onClick"])]),_:1},8,["content"]),s(B,{modelValue:v.drawer,"onUpdate:modelValue":b[6]||(b[6]=e=>v.drawer=e),"append-to-body":"",class:"fbs_right_sidebar fbs-notification-drawer","with-header":!1,size:"min(440px, 100vw)",direction:m.appVars.is_rtl?"ltr":"rtl",onClose:y.drawerClosing},{default:n(()=>[s(C,{title:"Notification","icon-name":"notification",onClose:b[0]||(b[0]=e=>v.drawer=!1)}),o("div",We,[o("div",{class:"fbs-notification-tabs",role:"tablist","aria-label":m.$t("Notifications")},[o("button",{type:"button",class:f(["fbs-switch-btn",v.allNotifications?"fbs-active":""]),role:"tab","aria-selected":v.allNotifications,onClick:b[1]||(b[1]=(...e)=>y.showAllNotifications&&y.showAllNotifications(...e))},c(m.$t("All")),11,He),o("button",{type:"button",class:f(["fbs-switch-btn",v.unreadNotifications?"fbs-active":""]),role:"tab","aria-selected":v.unreadNotifications,onClick:b[2]||(b[2]=(...e)=>y.showUnreadNotifications&&y.showUnreadNotifications(...e))},c(m.$t("Unread")),11,ze),o("button",{type:"button",class:f(["fbs-switch-btn",v.mentionedNotifications?"fbs-active":""]),role:"tab","aria-selected":v.mentionedNotifications,onClick:b[3]||(b[3]=(...e)=>y.showMentionedNotifications&&y.showMentionedNotifications(...e))},c(m.$t("Mentioned")),11,Ke),o("button",{type:"button",class:f(["fbs-switch-btn",v.assignedNotifications?"fbs-active":""]),role:"tab","aria-selected":v.assignedNotifications,onClick:b[4]||(b[4]=(...e)=>y.showAssignedNotifications&&y.showAssignedNotifications(...e))},c(m.$t("Assigned")),11,Qe)],8,je),s(S,{trigger:"click",class:"fbs-notification-dropdown",placement:"bottom-end"},{dropdown:n(()=>[s(T,null,{default:n(()=>[s($,{onClick:y.markAllNotificationAsRead},{default:n(()=>[o("span",Ge,[s(w,{"icon-name":"eye"})]),d(" "+c(m.$t("mark_all_read")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>[s(k,{text:"",size:"small",class:"only-icon-btn","aria-label":m.$t("Menu")},{default:n(()=>[o("span",Ze,[s(w,{"icon-name":"dots","aria-hidden":"true"})])]),_:1},8,["aria-label"])]),_:1})]),p((t(),i("div",{onScroll:b[5]||(b[5]=(...e)=>y.handleScroll&&y.handleScroll(...e)),ref:"notificationContainer",class:"fbs_notification_container",id:"notification-container"},[(t(!0),i(r,null,h(v.notifications,e=>(t(),a(M,{key:e.id,notification:e},null,8,["notification"]))),128)),v.loading&&v.pagination.current_page>0?p((t(),i("p",Ye,null,512)),[[x,!0]]):l("",!0),0!==v.notifications.length||v.loading?l("",!0):(t(),a(I,{key:1},{default:n(()=>[s(L,{message:y.notificationEmptyMessage},null,8,["message"])]),_:1}))],32)),[[x,v.loading]])]),_:1},8,["modelValue","direction","onClose"])])}]]),Je={class:"navigable_list_container fbs_global_search_result_container"},et={key:0,class:"no_results fbs_global_search_result_not_found"},tt={class:"fbs_global_search_empty_state"},it={key:1},st={ref:"listContainer",class:"navigable_list fbs_global_search_result_list"},at=["tabindex","onClick","onKeydown"];const nt=[{key:"boards",title:"Boards",type:"board"},{key:"tasks",title:"Tasks",type:"task"}],ot=["title","aria-label"],lt={class:"fbs_global_search_input_container"},rt={key:0,class:"searched_item"},ct={key:0,class:"fbs_global_search_commands"},dt={class:"fbs_global_search_commands_label"},ht={key:0,class:"fbs_global_search_commands_list"},ft=["onClick","onMouseenter"],mt={class:"fbs_command_slash"},ut={class:"fbs_command_desc"},pt={key:1,class:"fbs_global_search_commands_empty"},bt={class:"fbs_global_searching_for"},gt={class:"fbs_global_searching_for_label"},_t={class:"fbs_global_searching_suggestion_list"},vt=["onClick"],yt={class:"fbs_global_search_no_result"},wt={key:2,class:"fbs-global-remote-result-container"},kt={class:"fbs-w-full"},Nt={key:0,class:"fbs_global_search_subscriber"},Ct={class:"fbs_global_search_subscriber_avatar"},$t={class:"fbs_global_search_subscriber_avatar_placeholder"},Tt={class:"fbs_global_search_subscriber_info"},St={class:"fbs_global_search_subscriber_name"},Mt={class:"fbs_global_search_subscriber_meta"},Lt={class:"fbs_global_search_result_type"},It={key:1,class:"fbs_global_search_subscriber fbs_global_search_title_item"},Bt={class:"fbs_global_search_subscriber_name"},xt={class:"fbs_global_search_subscriber_meta"},At={key:0,class:"fbs_global_search_subscriber_email"},Et={class:"fbs-global-search-stage-title"},Pt={class:"fbs_global_search_result_type"},Ft={class:"dialog-footer is-border"},Vt={key:0,class:"fbs_search_tip"},qt={class:"fbs_search_tip_label"},Ut={class:"fbs_search_tip_text"},Dt={class:"fbs_search_commands"},Rt={class:"fbs_label"},Ot={class:"fbs_label"},Wt={class:"fbs_label"};const jt=ye({name:"GlobalSearch",components:{NavigableList:ye({name:"NavigableList",components:{EmptyState:we},props:{items:{type:Array,required:!0,default:()=>[]},noResultsText:{type:String,default:"No results found"},onAction:{type:Function,required:!0}},data:()=>({selectedIndex:-1}),methods:{navigate(e){const t=this.items.length;if(0===t)return;const i=t-1;"up"===e?this.selectedIndex=this.selectedIndex<=0?i:this.selectedIndex-1:"down"===e&&(this.selectedIndex=this.selectedIndex>=i?0:this.selectedIndex+1),this.scrollToSelectedElement()},scrollToSelectedElement(){const e=this.$refs.listContainer,t=this.$refs.listItem&&this.$refs.listItem[this.selectedIndex];t&&e&&(t.scrollIntoView({behavior:"smooth",block:"nearest"}),this.$nextTick(()=>{t.focus()}))},handleItemClick(e){this.selectedIndex=e,this.performAction(e)},performAction(e){e>=0&&e<this.items.length&&this.onAction(this.items[e],e)},resetSelection(){this.selectedIndex=-1},focusList(e){(e=null!=e?e:this.items.length-1)>=0&&(this.selectedIndex=e,this.$nextTick(()=>{const t=this.$refs.listItem&&this.$refs.listItem[e];t&&t.focus()}))},performFirstAction(){this.items.length>0?(this.selectedIndex=0,this.performAction(0)):this.selectedIndex=-1},performSelectedAction(){this.items.length<1?this.selectedIndex=-1:this.selectedIndex<0||this.selectedIndex>=this.items.length?this.performFirstAction():this.performAction(this.selectedIndex)}},watch:{items:{handler(){this.resetSelection()},immediate:!0}}},[["render",function(a,n,l,c,d,m){const u=e("empty-state");return t(),i("div",Je,[0===l.items.length?(t(),i("div",et,[o("div",tt,[s(u,{message:l.noResultsText,"icon-width":84,"icon-height":64},null,8,["message"])])])):(t(),i("div",it,[o("ul",st,[(t(!0),i(r,null,h(l.items,(e,s)=>(t(),i("li",{key:s,ref_for:!0,ref:"listItem",class:f({selected:s===d.selectedIndex}),tabindex:s,onClick:e=>m.handleItemClick(s),onKeydown:[n[0]||(n[0]=b(g(e=>m.navigate("up"),["prevent"]),["arrow-up"])),n[1]||(n[1]=b(g(e=>m.navigate("down"),["prevent"]),["arrow-down"])),b(e=>m.performAction(s),["enter"])]},[_(a.$slots,"default",{item:e,index:s,isSelected:s===d.selectedIndex})],42,at))),128))],512)]))])}]]),CustomIcon:A,Icons:ke},data:()=>({visible:!1,query:"",scopeTag:null,loading:!1,results:[],payload:null,lastScope:null,searchTimer:null,activeTip:"",commandIndex:-1,perPage:20}),computed:{scopeTags(){const e={boards:{label:this.$t("Boards"),placeholder:this.$t("Search Boards"),commandDesc:this.$t("Search in Boards")},tasks:{label:this.$t("Tasks"),placeholder:this.$t("Search Tasks"),commandDesc:this.$t("Search in Tasks")}};return nt.map(t=>({...t,...e[t.key]}))},scope(){return this.scopeTag?this.scopeTag.key:"all"},isCommandMode(){return this.query.startsWith("/")},commandQuery(){return this.query.slice(1).toLowerCase().trim()},filteredCommands(){if(!this.isCommandMode)return[];const e=this.commandQuery;return this.scopeTags.filter(t=>!e||t.title.toLowerCase().includes(e))}},watch:{scopeTag(){this.query.trim()&&this.search()},filteredCommands(){this.commandIndex=this.filteredCommands.length?0:-1}},mounted(){window.addEventListener("keydown",this.onKeydown)},beforeUnmount(){clearTimeout(this.searchTimer),window.removeEventListener("keydown",this.onKeydown)},methods:{open(){this.setRandomTip(),this.visible=!0},onClosed(){var e;this.visible=!1,this.query="",this.scopeTag=null,this.results=[],this.payload=null,null==(e=this.$refs.listRef)||e.resetSelection()},focusInput(){this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()})},onInput(){clearTimeout(this.searchTimer),this.isCommandMode?this.results=[]:this.query.trim()?this.searchTimer=setTimeout(()=>this.search(),400):this.results=[]},search(){const e=this.query.trim();if(!e)return void(this.results=[]);if(this.payload&&this.lastScope===this.scope&&this.payload._query===e)return void this.applyPayload();const t={query:e,scope:"all",per_page:this.perPage};this.scopeTag&&"boards"!==this.scopeTag.key||(t.board_page=1),this.scopeTag&&"tasks"!==this.scopeTag.key||(t.task_page=1),this.loading=!0,this.$get("global-search",t).then(t=>{this.payload={...t,_query:e},this.lastScope=this.scope,this.applyPayload()}).catch(()=>{this.results=[]}).finally(()=>{this.loading=!1})},applyPayload(){if(!this.payload)return;const e=(this.payload.boards&&this.payload.boards.data||[]).map(e=>({...e,_resultType:"board"})),t=(this.payload.tasks&&this.payload.tasks.data||[]).map(e=>({...e,_resultType:"task"}));this.scopeTag&&"boards"===this.scopeTag.key?this.results=e:this.scopeTag&&"tasks"===this.scopeTag.key?this.results=t:this.results=[...e,...t]},focusList(e="down"){if(this.isCommandMode){const t=this.filteredCommands.length;if(!t)return;return void(this.commandIndex="up"===e?this.commandIndex<=0?t-1:this.commandIndex-1:this.commandIndex>=t-1?0:this.commandIndex+1)}const t=this.$refs.listRef;t&&this.results.length&&("up"!==e?t.focusList(0):t.focusList(this.results.length-1))},selectFromKeyboard(){if(this.isCommandMode){const e=this.filteredCommands[this.commandIndex];return void(e&&this.selectCommand(e))}const e=this.$refs.listRef;e&&this.results.length&&e.performSelectedAction()},selectCommand(e){this.scopeTag=e,this.query="",this.commandIndex=-1,this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()})},goToItem(e){const t="board"===e._resultType?this.$getBoardUrl(e):this.$getTaskUrl(e);t&&"#"!==t&&(window.location.href=t),this.visible=!1},resultTypeLabel(e){return this.$t({board:"Board",task:"Task"}[e._resultType]||"Item")},setRandomTip(){const e=[this.$t('Press "/" anywhere to open Search quickly'),this.$t("Use the Boards or Tasks chips to narrow results"),this.$t("Use ↑↓ keys to move through results"),this.$t("Press Enter to open the selected result"),this.$t('Type "id: 123" to find a board or task by id')];this.activeTip=e[Math.floor(Math.random()*e.length)]||""},onKeydown(e){var t;if("/"!==(null==(t=e.key)?void 0:t.toLowerCase())||e.metaKey||e.ctrlKey||e.altKey)return;const i=e.target,s=i&&i.tagName?i.tagName.toUpperCase():"";i&&(i.isContentEditable||"INPUT"===s||"TEXTAREA"===s||"SELECT"===s)||(e.preventDefault(),this.open(),this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()}))}}},[["render",function(a,m,_,v,y,w){const k=me,N=e("Icons"),C=e("custom-icon"),$=e("NavigableList"),T=ue,S=u("loading");return t(),i(r,null,[o("button",{type:"button",class:"fbs_icon_btn fbs_global_search",title:a.$t("Global Search"),"aria-label":a.$t("Global Search"),onClick:m[0]||(m[0]=(...e)=>w.open&&w.open(...e))},[...m[7]||(m[7]=[o("span",{class:"icon"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[o("path",{d:"M12.0232 10.9627L15.2355 14.1742L14.1742 15.2355L10.9627 12.0232C9.7678 12.9812 8.2815 13.5022 6.75 13.5C3.024 13.5 0 10.476 0 6.75C0 3.024 3.024 0 6.75 0C10.476 0 13.5 3.024 13.5 6.75C13.5022 8.2815 12.9812 9.7678 12.0232 10.9627ZM10.5187 10.4062C11.4706 9.42741 12.0021 8.11532 12 6.75C12 3.849 9.65025 1.5 6.75 1.5C3.849 1.5 1.5 3.849 1.5 6.75C1.5 9.65025 3.849 12 6.75 12C8.11532 12.0021 9.42741 11.4706 10.4062 10.5187L10.5187 10.4062Z",fill:"currentColor",transform:"translate(2.5 2.5)"})])],-1),o("span",{class:"slash-icon"},"/",-1)])],8,ot),s(T,{modelValue:y.visible,"onUpdate:modelValue":m[6]||(m[6]=e=>y.visible=e),onOpened:w.focusInput,onClosed:w.onClosed,class:"fbs_global_search_container","modal-class":"fbs_global_search_modal","append-to-body":!0},{header:n(()=>[o("div",lt,[m[9]||(m[9]=o("span",{class:"icon"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[o("path",{d:"M12.0232 10.9627L15.2355 14.1742L14.1742 15.2355L10.9627 12.0232C9.7678 12.9812 8.2815 13.5022 6.75 13.5C3.024 13.5 0 10.476 0 6.75C0 3.024 3.024 0 6.75 0C10.476 0 13.5 3.024 13.5 6.75C13.5022 8.2815 12.9812 9.7678 12.0232 10.9627ZM10.5187 10.4062C11.4706 9.42741 12.0021 8.11532 12 6.75C12 3.849 9.65025 1.5 6.75 1.5C3.849 1.5 1.5 3.849 1.5 6.75C1.5 9.65025 3.849 12 6.75 12C8.11532 12.0021 9.42741 11.4706 10.4062 10.5187L10.5187 10.4062Z",fill:"var(--fbs-text-muted, #99a0ae)",transform:"translate(1 1)"})])],-1)),y.scopeTag?(t(),i("div",rt,[d(c(y.scopeTag.label)+" ",1),o("span",{class:"icon",onClick:m[1]||(m[1]=e=>y.scopeTag=null)},[...m[8]||(m[8]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[o("path",{d:"M6 5.057L9.3 1.757l.943.943-3.3 3.3 3.3 3.3-.943.943-3.3-3.3-3.3 3.3-.943-.943 3.3-3.3-3.3-3.3.943-.943 3.3 3.3Z",fill:"currentColor"})],-1)])])])):l("",!0),s(k,{ref:"inputRef",modelValue:y.query,"onUpdate:modelValue":m[2]||(m[2]=e=>y.query=e),class:"mousetrap",placeholder:y.scopeTag?y.scopeTag.placeholder:a.$t("Type to search or / to filter"),clearable:"",autofocus:"",onInput:w.onInput,onKeydown:[m[3]||(m[3]=b(g(e=>w.focusList("down"),["prevent"]),["arrow-down"])),m[4]||(m[4]=b(g(e=>w.focusList("up"),["prevent"]),["arrow-up"])),b(g(w.selectFromKeyboard,["prevent"]),["enter"]),m[5]||(m[5]=b(e=>""===y.query&&(y.scopeTag=null),["backspace"]))]},null,8,["modelValue","placeholder","onInput","onKeydown"])])]),default:n(()=>[w.isCommandMode?(t(),i("div",ct,[o("div",dt,c(a.$t("Filter by")),1),w.filteredCommands.length?(t(),i("ul",ht,[(t(!0),i(r,null,h(w.filteredCommands,(e,s)=>(t(),i("li",{key:e.key,class:f({selected:s===y.commandIndex}),onClick:t=>w.selectCommand(e),onMouseenter:e=>y.commandIndex=s},[o("span",mt,"/"+c(e.title.toLowerCase()),1),o("span",ut,c(e.commandDesc),1)],42,ft))),128))])):(t(),i("div",pt,c(a.$t("No matching filters")),1))])):y.query?p((t(),i("div",wt,[s($,{ref:"listRef",items:y.results,"no-results-text":y.query?"No matches found":"Type to search","on-action":w.goToItem},{default:n(({item:e})=>[o("div",kt,["board"===e._resultType?(t(),i("div",Nt,[o("div",Ct,[o("div",$t,c((e.title||"?").charAt(0).toUpperCase()),1)]),o("div",Tt,[o("span",St,c(e.title),1),o("div",Mt,[o("span",Lt,c(w.resultTypeLabel(e)),1)])])])):(t(),i("div",It,[o("span",Bt,c(e.title),1),o("div",xt,[e.board?(t(),i("span",At,[d(c(e.board.title)+" ",1),e.stage&&e.stage.title?(t(),i(r,{key:0},[m[10]||(m[10]=d(" — ",-1)),o("span",Et,[s(C,{"icon-name":"stage"}),d(c(e.stage.title),1)])],64)):l("",!0)])):l("",!0),o("span",Pt,c(w.resultTypeLabel(e)),1)])]))]),m[11]||(m[11]=o("div",{class:"action-icon"},[o("svg",{width:"6",height:"9",viewBox:"0 0 6 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M3.34125 4.2957L0 0.95445L0.95445 0L5.25015 4.2957L0.95445 8.5914L0 7.63695L3.34125 4.2957Z",fill:"var(--fbs-secondary-text, #525866)"})])],-1))]),_:1},8,["items","no-results-text","on-action"])])),[[S,y.loading]]):(t(),i(r,{key:1},[o("div",bt,[o("div",gt,c(a.$t("Searching for")),1),o("div",_t,[(t(!0),i(r,null,h(w.scopeTags,e=>(t(),i("div",{key:e.key,class:f(["fbs_global_searching_suggestion",{active:y.scopeTag&&y.scopeTag.key===e.key}]),onClick:t=>y.scopeTag=e},c(e.label),11,vt))),128))])]),o("div",yt,[s(N,{"icon-name":"search","icon-class":"fbs_global_search_empty_icon","aria-hidden":"true"}),o("p",null,c(a.$t("Start typing to find a board or task")),1)])],64)),o("div",Ft,[y.activeTip?(t(),i("div",Vt,[o("span",qt,c(a.$t("Tip"))+":",1),o("span",Ut,c(y.activeTip),1)])):l("",!0),o("ul",Dt,[o("li",null,[m[12]||(m[12]=o("span",{class:"fbs_command_keys"},[o("span",{class:"fbs_command_key"},"↑"),o("span",{class:"fbs_command_key"},"↓")],-1)),o("span",Rt,c(a.$t("Navigate")),1)]),o("li",null,[m[13]||(m[13]=o("span",{class:"fbs_command_key"},"↵",-1)),o("span",Ot,c(a.$t("Select")),1)]),o("li",null,[m[14]||(m[14]=o("span",{class:"fbs_command_key"},"/",-1)),o("span",Wt,c(a.$t("Filter")),1)])])])]),_:1},8,["modelValue","onOpened","onClosed"])],64)}]]);let Ht=null;const zt=v("pinnedBoards",{state:()=>({pinnedBoards:[],loaded:!1,loading:!1,mutationVersion:0}),actions:{ensurePinnedBoards(e){if(this.loaded)return Promise.resolve(this.pinnedBoards);if(Ht)return Ht;this.loading=!0;const t=()=>{const i=this.mutationVersion;let s;try{s=e()}catch(a){s=Promise.reject(a)}return Promise.resolve(s).then(e=>i!==this.mutationVersion?t():(this.pinnedBoards=Array.isArray(null==e?void 0:e.pinnedBoards)?e.pinnedBoards:[],this.loaded=!0,this.pinnedBoards))};return Ht=t().finally(()=>{this.loading=!1,Ht=null}),Ht},upsertPinnedBoard(e){const t=Number(null==e?void 0:e.id);if(!Number.isFinite(t)||t<=0)return;this.mutationVersion+=1;const i={...e,id:t,is_pinned:!0},s=this.pinnedBoards.findIndex(e=>Number(e.id)===t);this.pinnedBoards=-1!==s?this.pinnedBoards.map((e,t)=>t===s?{...e,...i}:e):[...this.pinnedBoards,i]},removePinnedBoard(e){const t=Number(e);!Number.isFinite(t)||t<=0||(this.mutationVersion+=1,this.pinnedBoards=this.pinnedBoards.filter(e=>Number(e.id)!==t))}}}),Kt={name:"PinnedBoards",components:{BoardBackgroundPreview:Ne,Icons:ke},data:()=>({mutationLoading:!1,selectedBoardId:null}),computed:{...w(zt,{pinnedBoards:e=>e.pinnedBoards,pinnedBoardsLoading:e=>e.loading}),loading(){return this.pinnedBoardsLoading||this.mutationLoading}},mounted(){this.emitter.on("board-pin-state-changed",this.handleBoardPinStateChanged)},beforeUnmount(){this.emitter.off("board-pin-state-changed",this.handleBoardPinStateChanged)},methods:{...y(zt,["ensurePinnedBoards","upsertPinnedBoard","removePinnedBoard"]),handleDropdownVisible(e){e&&this.fetchPinnedBoards()},goToBoard(e){this.$router.push({name:"board",params:{id:e.id}})},fetchPinnedBoards(){return this.ensurePinnedBoards(()=>this.$get("projects/pinned-boards")).catch(e=>{this.handleError(e)})},plainText:e=>e?String(e).replace(/<[^>]*>/g,"").trim():"",plainDescription:e=>Ce((null==e?void 0:e.description)||""),handleBoardPinStateChanged({boardId:e,isPinned:t,board:i}){t&&i?this.upsertPinnedBoard(i):t||this.removePinnedBoard(e)},unpinBoard(e){this.mutationLoading=!0,this.selectedBoardId=e,this.$put("projects/"+e+"/unpin-board").then(()=>{const t=this.pinnedBoards.find(t=>Number(t.id)===Number(e));this.removePinnedBoard(e),this.emitter.emit("remove-pinned-board",e),this.emitter.emit("board-pin-state-changed",{boardId:e,wasPinned:!0,isPinned:!1,board:t})}).catch(e=>{this.handleError(e)}).finally(()=>{this.mutationLoading=!1,this.selectedBoardId=null})}}},Qt={class:"icon"},Zt={class:"fbs_board_list_item"},Gt={class:"fbs_board_list_item__content"},Yt={class:"fbs_board_list_item__title_row"},Xt=["title"],Jt=["title"],ei={class:"fbs_board_list_item__meta"},ti=["title","aria-label","onClick"],ii={class:"icon fbs_board_card__pin__icon"},si={class:"icon fbs_board_card__pin__icon_outline"};const ai=["aria-label"],ni={class:"fbs-my-profile-avatar"},oi=["src","alt"],li={class:"fbs-profile-menu-caret","aria-hidden":"true"},ri={class:"fbs-profile-menu-head"},ci={class:"fbs-profile-menu-head-avatar","aria-hidden":"true"},di=["src","alt"],hi={class:"fbs-profile-menu-identity"},fi=["title"],mi=["title"],ui={class:"fbs-profile-menu-item-label"},pi={class:"fbs-profile-menu-item-icon","aria-hidden":"true"},bi={class:"fbs-profile-menu-item-label"},gi={class:"fbs-profile-menu-item-icon","aria-hidden":"true"},_i={class:"fbs-profile-menu-item-label"},vi={class:"fbs-profile-menu-item-icon","aria-hidden":"true"},yi={class:"fbs-profile-menu-item-label"};const wi={class:"icon"},ki={class:"icon"},Ni={class:"icon"},Ci={class:"icon"};const $i={class:"fl_app"},Ti={key:0},Si={style:{"font-size":"16px",color:"black"}},Mi={class:"el-button fbs-primary-btn",href:"https://fluentboards.com/discount-deal/",rel:"noopener",target:"_blank"},Li={class:"fbs-global-menu-icons",ref:"global_menu_right"},Ii={class:"fbs-global-action-buttons"},Bi={class:"icon"},xi={class:"icon"},Ai=["aria-label","aria-expanded"];const Ei=ye({name:"DashboardApplication",inject:["eventBus"],components:{Icons:ke,GlobalSearch:jt,Notification:Xe,PinnedBoards:ye(Kt,[["render",function(l,f,m,b,_,v){const y=e("Icons"),w=oe,k=e("board-background-preview"),N=de,C=ce,$=re,T=u("loading");return t(),a($,{placement:"bottom-end",class:"fbs-pinned-boards",trigger:"click","popper-class":"fbs-pinned-boards-popper",onVisibleChange:v.handleDropdownVisible},{dropdown:n(()=>[p((t(),a(C,null,{default:n(()=>[l.pinnedBoards.length?(t(!0),i(r,{key:0},h(l.pinnedBoards,e=>(t(),a(N,{key:e.id,onClick:t=>v.goToBoard(e)},{default:n(()=>[p((t(),i("div",Zt,[s(k,{class:"fbs_board_list_item__cover",board:e,"hide-icon":!0},null,8,["board"]),o("div",Gt,[o("div",Yt,[o("h3",{title:v.plainText(e.title)},c(e.title),9,Xt)]),o("p",{class:"fbs_board_list_item__desc",title:v.plainDescription(e)},c(v.plainDescription(e)||l.$t("No description")),9,Jt)]),o("div",ei,[o("button",{type:"button",class:"fbs_board_card__pin fbs_board_card__pin--pinned",title:l.$t("board is pinned"),"aria-label":l.$t("board is pinned"),onClick:g(t=>v.unpinBoard(e.id),["stop"])},[o("span",ii,[s(y,{"icon-name":"pin-fill","aria-hidden":"true"})]),o("span",si,[s(y,{"icon-name":"pin","aria-hidden":"true"})])],8,ti)])])),[[T,v.loading&&_.selectedBoardId===e.id]])]),_:2},1032,["onClick"]))),128)):(t(),a(N,{key:1,disabled:""},{default:n(()=>[d(c(l.$t("No pinned board yet!")),1)]),_:1}))]),_:1})),[[T,v.loading&&!_.selectedBoardId]])]),default:n(()=>[s(w,{"aria-label":l.$t("Pinned Boards")},{default:n(()=>[d(c(l.$t("Pinned"))+" ",1),o("span",Qt,[s(y,{"icon-name":"arrow-down"})])]),_:1},8,["aria-label"])]),_:1},8,["onVisibleChange"])}]]),ProfileMenu:ye({name:"ProfileMenu",components:{Icons:ke},data(){var e;return{me:{...null==(e=this.appVars)?void 0:e.me}}},mounted(){this.emitter.on("profile-updated",this.updateProfile)},beforeUnmount(){this.emitter.off("profile-updated",this.updateProfile)},computed:{displayName(){return this.me.display_name||this.me.full_name||""}},methods:{updateProfile(e){Object.assign(this.me,e)},goTo(e){const t={name:e,params:{user_id:this.me.id}};this.$route.name===e&&String(this.$route.params.user_id)===String(this.me.id)||this.$router.push(t)},logout(){this.me.logout_url&&(window.location.href=this.me.logout_url)}}},[["render",function(r,d,h,f,m,u){var p;const b=e("Icons"),g=de,_=ce,v=re;return(null==(p=m.me)?void 0:p.id)?(t(),a(v,{key:0,placement:"bottom-end",class:"fbs-profile-menu",trigger:"click","popper-class":"fbs-profile-menu-popper"},{dropdown:n(()=>[s(_,{class:"fbs-profile-menu-list"},{default:n(()=>[o("li",ri,[o("span",ci,[o("img",{src:m.me.photo,alt:u.displayName},null,8,di)]),o("span",hi,[o("span",{class:"fbs-profile-menu-name",title:u.displayName},c(u.displayName),9,fi),m.me.email?(t(),i("span",{key:0,class:"fbs-profile-menu-email",title:m.me.email},c(m.me.email),9,mi)):l("",!0)])]),s(g,{class:"fbs-profile-menu-item",onClick:d[0]||(d[0]=e=>u.goTo("member-overview"))},{default:n(()=>[d[3]||(d[3]=o("span",{class:"fbs-profile-menu-item-icon","aria-hidden":"true"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[o("path",{d:"M10 10a3.333 3.333 0 1 0 0-6.667A3.333 3.333 0 0 0 10 10Zm0 1.667c-3.222 0-5.833 1.86-5.833 4.166 0 .46.373.834.833.834h10c.46 0 .833-.373.833-.834 0-2.306-2.611-4.166-5.833-4.166Z",stroke:"currentColor","stroke-width":"1.4","stroke-linejoin":"round"})])],-1)),o("span",ui,c(r.$t("Profile overview")),1)]),_:1}),s(g,{class:"fbs-profile-menu-item",onClick:d[1]||(d[1]=e=>u.goTo("member-account"))},{default:n(()=>[o("span",pi,[s(b,{"icon-name":"gear"})]),o("span",bi,c(r.$t("Account settings")),1)]),_:1}),s(g,{class:"fbs-profile-menu-item",onClick:d[2]||(d[2]=e=>u.goTo("member-tasks"))},{default:n(()=>[o("span",gi,[s(b,{"icon-name":"task"})]),o("span",_i,c(r.$t("My tasks")),1)]),_:1}),m.me.logout_url?(t(),a(g,{key:0,class:"fbs-profile-menu-item",onClick:u.logout},{default:n(()=>[o("span",vi,[s(b,{"icon-name":"log-out"})]),o("span",yi,c(r.$t("Log out")),1)]),_:1},8,["onClick"])):l("",!0)]),_:1})]),default:n(()=>[o("button",{type:"button",class:"fbs-profile-menu-trigger","aria-label":r.$t("Profile menu")},[o("span",ni,[o("img",{src:m.me.photo,alt:r.$t("My Profile")},null,8,oi),o("span",li,[s(b,{"icon-name":"arrow-down"})])])],8,ai)]),_:1})):l("",!0)}]]),ThemeMode:ye({name:"ThemeMode",components:{Icons:ke},data:()=>({themeMode:E.getCurrentTheme()}),computed:{resolvedTheme(){return this.themeMode===E.MODE_SYSTEM?E.getSystemTheme():this.themeMode}},mounted(){this.onThemeChanged=()=>{this.themeMode=E.getCurrentTheme()},window.addEventListener(P,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(P,this.onThemeChanged)},methods:{selectTheme(e){this.themeMode!==e&&(this.themeMode=e,E.apply(e))}}},[["render",function(i,r,d,h,m,u){const p=e("Icons"),b=oe,g=de,_=ce,v=re;return t(),a(v,{class:"fbs-theme-mode",trigger:"click",onCommand:u.selectTheme,"popper-class":"fbs-theme-mode-popper"},{dropdown:n(()=>[s(_,null,{default:n(()=>[s(g,{command:"light",class:f({"fbs-theme-mode-active":"light"===m.themeMode})},{default:n(()=>[o("span",ki,[s(p,{"icon-name":"sun"})]),o("span",null,c(i.$t("Light")),1),"light"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"]),s(g,{command:"dark",class:f({"fbs-theme-mode-active":"dark"===m.themeMode})},{default:n(()=>[o("span",Ni,[s(p,{"icon-name":"moon"})]),o("span",null,c(i.$t("Dark")),1),"dark"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"]),s(g,{command:"system",class:f({"fbs-theme-mode-active":"system"===m.themeMode})},{default:n(()=>[o("span",Ci,[s(p,{"icon-name":"system"})]),o("span",null,c(i.$t("System")),1),"system"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"])]),_:1})]),default:n(()=>[s(b,{text:"",size:"small",class:"fbs_topbar_icon_btn only-icon-btn","aria-label":i.$t("Theme mode")},{default:n(()=>[o("span",wi,[s(p,{"icon-name":"theme-mode"})])]),_:1},8,["aria-label"])]),_:1},8,["onCommand"])}]])},data:()=>({onlineStatus:!0,willRender:!0,isFullScreen:!1,isBeta:!1,isActiveWindow:!0,intervalTimer:null,activeWindowHasDataChangeTimeOut:null,hasInitializedConnectionStatus:!1,connectionStatusCheckId:0,isMobileNavigationOpen:!1,mobileNavigationLinkClickHandler:null,mobileNavigationTrigger:null,mobileNavigationFocusFrame:null,mobileNavigationInertElements:[]}),watch:{onlineStatus(e,t){this.hasInitializedConnectionStatus&&e!==t&&(e?this.$notify({title:this.$t("Online"),message:this.$t("You're back online."),type:"success"}):this.$notify({title:this.$t("Offline"),message:this.$t("You are offline. Changes made now will not be saved."),type:"error"}))}},computed:{isSettingsRoute(){var e,t,i,s;return(null==(t=null==(e=this.$route)?void 0:e.matched)?void 0:t.some(e=>"settings"===e.name))||(null==(s=null==(i=this.$route)?void 0:i.path)?void 0:s.startsWith("/settings"))},mobileNavigationLabel(){return this.isMobileNavigationOpen?this.$t("Close Navigation Menu"):this.$t("Open Navigation Menu")}},methods:{goToSettings(){this.isSettingsRoute||this.$router.push({name:"general-settings"})},async checkBackendConnection(){var e,t;const i=null==(t=null==(e=this.appVars)?void 0:e.rest)?void 0:t.url;if(!i)return!1;const s="undefined"!=typeof AbortController?new AbortController:null;let a=null;s&&(a=setTimeout(()=>s.abort(),3e3));try{return(await fetch(i,{method:"HEAD",cache:"no-store",credentials:"same-origin",headers:{"X-Requested-With":"XMLHttpRequest"},signal:s?s.signal:void 0})).ok}catch(n){return!1}finally{a&&clearTimeout(a)}},async updateConnectionStatus(e=null){const t=++this.connectionStatusCheckId;if("offline"===(null==e?void 0:e.type))return void(this.onlineStatus=!1);const i=await this.checkBackendConnection();t===this.connectionStatusCheckId&&(this.onlineStatus=i)},toggleFullScreen(){this.isFullScreen="yes"==this.isFullScreen?"no":"yes",this.Storage.set("full_screen",this.isFullScreen),"yes"===this.isFullScreen?(document.body.classList.add("fbs_full_screen"),document.documentElement.classList.remove("wp-toolbar")):(document.body.classList.remove("fbs_full_screen"),document.documentElement.classList.add("wp-toolbar"))},getMobileNavigationWrapper(){var e;return(null==(e=this.$el)?void 0:e.closest(".warp"))||document.querySelector(".warp.fconnector_app")},setMobileNavigationOpen(e){const t=this.getMobileNavigationWrapper(),i=null==t?void 0:t.querySelector(".fframe_menu_small_screen"),s=null==t?void 0:t.querySelector(".fframe_menu_overlay"),a=Boolean(e),n=this.isMobileNavigationOpen;if(this.isMobileNavigationOpen=a,i&&i.classList.toggle("fframe_menu_small_screen_open",a),s&&s.classList.toggle("active",a),document.body.style.overflow=a?"hidden":"",a&&!n){this.mobileNavigationTrigger=(null==t?void 0:t.querySelector(".fframe_handheld"))||null;const e=null==i?void 0:i.querySelector("[data-fbs-menu-close]");this.mobileNavigationFocusFrame=window.requestAnimationFrame(()=>{this.mobileNavigationFocusFrame=null,this.isMobileNavigationOpen&&(e&&e.focus({preventScroll:!0}),this.setMobileNavigationInert(!0))})}else if(!a&&n){this.cancelMobileNavigationFocusFrame(),this.setMobileNavigationInert(!1);const e=this.mobileNavigationTrigger;this.mobileNavigationTrigger=null,e&&document.contains(e)&&e.focus({preventScroll:!0})}},handleMobileNavigationKeydown(e){var t;if(!this.isMobileNavigationOpen)return;if("Escape"===e.key||"Esc"===e.key)return void this.setMobileNavigationOpen(!1);if("Tab"!==e.key)return;const i=null==(t=this.getMobileNavigationWrapper())?void 0:t.querySelector(".fframe_menu_small_screen");if(!i)return;const s=this.getMobileNavigationFocusable(i);if(!s.length)return void e.preventDefault();const a=s[0],n=s[s.length-1],o=document.activeElement;e.shiftKey?o!==a&&i.contains(o)||(e.preventDefault(),n.focus({preventScroll:!0})):o!==n&&i.contains(o)||(e.preventDefault(),a.focus({preventScroll:!0}))},getMobileNavigationFocusable:e=>Array.from(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(e=>e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement),setMobileNavigationInert(e){e?(this.restoreMobileNavigationInert(),this.mobileNavigationInertElements=this.getMobileNavigationInertTargets().map(e=>({el:e,inert:e.inert,ariaHidden:e.getAttribute("aria-hidden")})),this.mobileNavigationInertElements.forEach(({el:e})=>{e.inert=!0,e.setAttribute("aria-hidden","true")})):this.restoreMobileNavigationInert()},restoreMobileNavigationInert(){this.mobileNavigationInertElements.forEach(({el:e,inert:t,ariaHidden:i})=>{document.contains(e)&&(e.inert=t,null===i?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",i))}),this.mobileNavigationInertElements=[]},getMobileNavigationInertTargets(){const e=this.getMobileNavigationWrapper();if(!e)return[];const t=new Set,i=e.querySelector(".fframe_app"),s=e.querySelector(".fframe_menu_small_screen"),a=e.querySelector(".fframe_menu_overlay");i&&Array.from(i.children).forEach(e=>{e!==s&&e!==a&&t.add(e)});let n=e;for(;n&&n!==document.body;){const e=n.parentElement;if(!e)break;Array.from(e.children).forEach(e=>{e===n||["SCRIPT","STYLE"].includes(e.tagName)||t.add(e)}),n=e}return Array.from(t).filter(e=>e!==s&&e!==a&&!(s&&e.contains(s)))},cancelMobileNavigationFocusFrame(){null!==this.mobileNavigationFocusFrame&&(window.cancelAnimationFrame(this.mobileNavigationFocusFrame),this.mobileNavigationFocusFrame=null)},toggleMobileNavigation(){this.setMobileNavigationOpen(!this.isMobileNavigationOpen)},bindMobileNavigationLinks(){const e=this.getMobileNavigationWrapper();e&&(this.mobileNavigationLinkClickHandler=()=>{this.setMobileNavigationOpen(!1)},e.querySelectorAll(".fframe_menu_small_screen .fframe_menu_item a").forEach(e=>{e.addEventListener("click",this.mobileNavigationLinkClickHandler)}),e.querySelectorAll("[data-fbs-menu-overlay], [data-fbs-menu-close]").forEach(e=>{e.addEventListener("click",this.mobileNavigationLinkClickHandler)}))},unbindMobileNavigationLinks(){const e=this.getMobileNavigationWrapper();e&&this.mobileNavigationLinkClickHandler&&(e.querySelectorAll(".fframe_menu_small_screen .fframe_menu_item a").forEach(e=>{e.removeEventListener("click",this.mobileNavigationLinkClickHandler)}),e.querySelectorAll("[data-fbs-menu-overlay], [data-fbs-menu-close]").forEach(e=>{e.removeEventListener("click",this.mobileNavigationLinkClickHandler)}))},handleMobileNavigationResize(){this.isMobileNavigationOpen&&window.innerWidth>1133&&this.setMobileNavigationOpen(!1)},updateViewClass(){const e=document.querySelector(".fluent_boards_frontend"),t=document.getElementById("fluent-boards-app");if(e){const e=document.querySelector(".fframe_main-menu-items"),i=document.querySelector(".fframe_menu_small_screen"),s=t.offsetWidth;s<=530?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_mobile_view"),t.classList.remove("fbs_app_tablet_view","fbs_app_laptop_view")):s<=809?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_tablet_view"),t.classList.remove("fbs_app_mobile_view","fbs_app_laptop_view")):s<=1133?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_laptop_view"),t.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view")):(e.classList.remove("fbs_small_screen_menu_items"),i.classList.remove("fbs_small_screen_menu_items"),t.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view","fbs_app_laptop_view"))}},handleWindowVisibilityChange(){"visible"===document.visibilityState?(this.isActiveWindow||(this.eventBus.emit("has-board-data-changed"),this.isActiveWindow=!0),this.activeWindowHasDataChangeTimeOut&&clearTimeout(this.activeWindowHasDataChangeTimeOut)):this.activeWindowHasDataChangeTimeOut=setTimeout(()=>{this.isActiveWindow=!1},3e5)}},async mounted(){jQuery(".notice-warning, .notice-error").remove(),window.addEventListener("online",this.updateConnectionStatus),window.addEventListener("offline",this.updateConnectionStatus),window.addEventListener("resize",this.updateViewClass),window.addEventListener("resize",this.handleMobileNavigationResize),document.addEventListener("keydown",this.handleMobileNavigationKeydown),document.addEventListener("visibilitychange",this.handleWindowVisibilityChange),this.bindMobileNavigationLinks(),await this.updateConnectionStatus({type:"initial"}),this.hasInitializedConnectionStatus=!0,this.intervalTimer=setInterval(()=>{navigator.onLine&&!window.request_is_pending&&this.isActiveWindow&&(this.eventBus.emit("has-board-data-changed"),this.eventBus.emit("fetch-notification-number"))},3e5)},beforeUnmount(){document.removeEventListener("visibilitychange",this.handleWindowVisibilityChange),window.removeEventListener("online",this.updateConnectionStatus),window.removeEventListener("offline",this.updateConnectionStatus),window.removeEventListener("resize",this.updateViewClass),window.removeEventListener("resize",this.handleMobileNavigationResize),document.removeEventListener("keydown",this.handleMobileNavigationKeydown),this.cancelMobileNavigationFocusFrame(),document.body.style.overflow="",this.setMobileNavigationInert(!1),this.unbindMobileNavigationLinks(),this.intervalTimer&&clearInterval(this.intervalTimer)},created(){E.apply(E.getCurrentTheme()),this.isBeta=this.appVars.is_beta,this.isFullScreen=this.Storage.get("full_screen","no"),this.updateViewClass(),"yes"===this.isFullScreen?document.body.classList.add("fbs_full_screen"):document.body.classList.remove("fbs_full_screen")}},[["render",function(r,h,m,u,p,b){const g=pe,_=e("router-view"),v=e("pinned-boards"),y=e("global-search"),w=e("notification"),N=e("Icons"),C=oe,$=e("theme-mode"),T=e("profile-menu");return t(),i("div",$i,[p.isBeta?(t(),i("div",Ti,[s(g,{type:"warning",center:"",closable:!1,"close-text":!1},{default:n(()=>[o("p",Si,[d(c(r.$t("You are using FluentBoards Beta Version. We just launched special Lifetime Deal for Beta users"))+" ",1),o("a",Mi,c(r.$t("Get FluentBoards Pro")),1)])]),_:1})])):l("",!0),s(_),(t(),a(k,{to:"#fluent_app_actions"},[o("div",Li,[o("div",Ii,[s(v),s(y),s(w),r.$isAdmin()?(t(),a(C,{key:0,text:"",size:"small",class:f(["fbs_topbar_icon_btn only-icon-btn",{"fbs_topbar_icon_btn--active":b.isSettingsRoute}]),title:r.$t("Settings"),"aria-label":r.$t("Settings"),onClick:b.goToSettings},{default:n(()=>[o("span",Bi,[s(N,{"icon-name":"gear"})])]),_:1},8,["class","title","aria-label","onClick"])):l("",!0),s($),s(C,{text:"",size:"small",class:"fbs_topbar_icon_btn fbs_full_screen_btn only-icon-btn",title:r.$t("Toggle Full Screen Mode"),"aria-label":r.$t("Toggle Full Screen Mode"),onClick:b.toggleFullScreen},{default:n(()=>[o("span",xi,[s(N,{"icon-name":"fullscreen"})])]),_:1},8,["title","aria-label","onClick"]),o("button",{type:"button",class:f(["fframe_handheld",{fframe_handheld_open:p.isMobileNavigationOpen}]),"aria-label":b.mobileNavigationLabel,"aria-expanded":p.isMobileNavigationOpen?"true":"false","aria-controls":"fframe_mobile_menu","aria-haspopup":"true",onClick:h[0]||(h[0]=(...e)=>b.toggleMobileNavigation&&b.toggleMobileNavigation(...e))},[s(N,{class:"icon menu-icon","icon-name":"menu"}),s(N,{class:"icon close-icon","icon-name":"close"})],10,Ai),s(T)])],512)]))])}]]),Pi=L(),Fi=N(Ei),Vi=L();Fi.config.globalProperties.appVars=window.fluentAddonVars,Fi.config.globalProperties.appVars.isFrontView="front"===window.fluentAddonVars.render_in,window.Fuse=C,window.moment=F;const qi=()=>window.fluentAddonVars&&window.fluentAddonVars.is_rtl?"bottom-left":"bottom-right";Fi.mixin({data:()=>({Storage:te,hasPro:!!window.fluentAddonVars.has_pro,isTouchScreen:"ontouchstart"in window||navigator.maxTouchPoints>0}),methods:{$get:J.get,$post:J.post,$put:J.put,$del:J.delete,$uploadFile:J.uploadFile,formatNumber:(e,t=!1)=>!e&&t?"":(e||(e="0"),new Intl.NumberFormat("en-US").format(e)),$changeTitle(e=null){null!=e?jQuery("head title").text(e+" - FluentBoards"):jQuery("head title").text("FluentBoards")},$t:X,$_n:Y,$_x:G,$humanTimeDiff:Z,$handleError:Q,handleError:Q,convertToText:K,$validateEmail:z,smartDate:H,$smartDate:R,$checkOverdue:j,$formatDate:W,$smartDateRange:O,smartDateWithYear:R,taskGroupingByStages:D,sortTaskByPosition:U,$getPref:(e,t="")=>te.get(e,t),$setPref(e,t){te.set(e,t)},$getUpgradeUrl(e){return ee(this.appVars.upgrade_url,e)},$formatMinutes(e){let t=parseInt(e);if(!t)return"--";const i=Math.floor(t/60);return t%=60,i?t?`${i}h ${t}m`:`${i}h`:`${t}m`},$getTaskUrl:q,$getBoardUrl:V,$isAdmin(){let e=window.fluentAddonVars.me.fluent_boards_role;return"wordpress_admin"===e||"fluent_boards_admin"===e},$isMember:()=>"member"===window.fluentAddonVars.me.fluent_boards_role,$isBoardManager(e){const t=window.fluentAddonVars.me.fluent_boards_capabilities.find(t=>t.board_id==e);return!!t&&"board_admin"===t.role},$canCreateBoard:()=>!!window.fluentAddonVars.me.can_create_board}}),Fi.config.globalProperties.$notify=e=>{be({...e,position:qi(),style:{}})},Fi.config.globalProperties.$notify.success=e=>{be({...e,position:qi(),type:"success",style:{}})},Fi.config.globalProperties.$notify.error=e=>{be({...e,position:qi(),title:X("Error"),type:"error",style:{}})},Fi.config.globalProperties.$notify.warning=e=>{be({...e,position:qi(),title:X("Warning"),type:"warning",style:{}})},Fi.config.globalProperties.$confirm=ge.confirm,Fi.config.globalProperties.emitter=Pi;const Ui=$({routes:ae,history:T(),scrollBehavior:se}),Di=S();Di.use(M),Fi.use(Ui),Fi.use(_e),Fi.use(Di),Fi.provide("eventBus",Vi),Fi.directive("prevent-context-menu",ie);for(const[Ri,Oi]of Object.entries(ve))Fi.component(Ri,Oi);Fi.mount("#fluent-framework-app"),Ui.beforeEach((e,t,i)=>{window.fbsPreviousRoute=t,i()}),Ui.afterEach((e,t)=>{const i=e.meta.active_menu;jQuery(".fframe_menu li").removeClass("active_item"),jQuery(".fframe_menu li.fframe_item_"+i).addClass("active_item"),jQuery(".toplevel_page_fluent_frame li").removeClass("current"),jQuery(".toplevel_page_fluent_frame li.fluent_frame_"+i).addClass("current"),e.meta.title&&jQuery("head title").text(e.meta.title+" - FluentBoards")}); |