(function(){var t,e,r,n,i,o,s,a;this.taiga=a={},this.taigaContribPlugins=this.taigaContribPlugins||window.taigaContribPlugins||[],a.generateHash=function(t){return null==t&&(t=[]),t=_.map(t,function(t){return JSON.stringify(t)}),hex_sha1(t.join(":"))},a.generateUniqueSessionIdentifier=function(){var t,e;return t=(new Date).getTime(),e=Math.floor(150994944*Math.random()),a.generateHash([t,e])},a.sessionId=a.generateUniqueSessionIdentifier(),t=function(t,e,r,n,i,o,s,u,c){var l,p,f,d,h,g,m,v,y;return c.classNameFilter(/^(?:(?!ng-animate-disabled).)*$/),g=t.when,t.when=function(e,r){return r.resolve||(r.resolve={}),angular.extend(r.resolve,{languageLoad:["$q","$translate",function(t,e){var r;return r=t.defer(),e().then(function(){return r.resolve()}),r.promise}],projectLoaded:["$q","tgProjectService","$route",function(t,e,r){var n,i;return n=t.defer(),e.setSection(null!=(i=r.current.$$route)?i.section:void 0),r.current.params.pslug?e.setProjectBySlug(r.current.params.pslug).then(n.resolve):(e.cleanProject(),n.resolve()),n.promise}]}),g.call(t,e,r)},t.when("/",{templateUrl:"home/home.html",controller:"Home",controllerAs:"vm",loader:!0,title:"HOME.PAGE_TITLE",loader:!0,description:"HOME.PAGE_DESCRIPTION",joyride:"dashboard"}),t.when("/discover",{templateUrl:"discover/discover-home/discover-home.html",controller:"DiscoverHome",controllerAs:"vm",title:"PROJECT.NAVIGATION.DISCOVER",loader:!0}),t.when("/discover/search",{templateUrl:"discover/discover-search/discover-search.html",title:"PROJECT.NAVIGATION.DISCOVER",loader:!0,controller:"DiscoverSearch",controllerAs:"vm",reloadOnSearch:!1}),t.when("/projects/",{templateUrl:"projects/listing/projects-listing.html",access:{requiresLogin:!0},title:"PROJECTS.PAGE_TITLE",description:"PROJECTS.PAGE_DESCRIPTION",loader:!0,controller:"ProjectsListing",controllerAs:"vm"}),t.when("/project/:pslug/",{templateUrl:"projects/project/project.html",loader:!0,controller:"Project",controllerAs:"vm",section:"project-timeline"}),t.when("/project/:pslug/search",{templateUrl:"search/search.html",reloadOnSearch:!1,section:"search",loader:!0}),t.when("/project/:pslug/epics",{section:"epics",templateUrl:"epics/dashboard/epics-dashboard.html",loader:!0,controller:"EpicsDashboardCtrl",controllerAs:"vm"}),t.when("/project/:pslug/epic/:epicref",{templateUrl:"epic/epic-detail.html",loader:!0,section:"epics"}),t.when("/project/:pslug/backlog",{templateUrl:"backlog/backlog.html",loader:!0,section:"backlog",joyride:"backlog"}),t.when("/project/:pslug/kanban",{templateUrl:"kanban/kanban.html",loader:!0,section:"kanban",joyride:"kanban"}),t.when("/project/:pslug/taskboard/:sslug",{templateUrl:"taskboard/taskboard.html",loader:!0,section:"backlog"}),t.when("/project/:pslug/us/:usref",{templateUrl:"us/us-detail.html",loader:!0,section:"backlog-kanban"}),t.when("/project/:pslug/task/:taskref",{templateUrl:"task/task-detail.html",loader:!0,section:"backlog-kanban"}),t.when("/project/:pslug/wiki",{redirectTo:function(t){return"/project/"+t.pslug+"/wiki/home"}}),t.when("/project/:pslug/wiki-list",{templateUrl:"wiki/wiki-list.html",loader:!0,section:"wiki"}),t.when("/project/:pslug/wiki/:slug",{templateUrl:"wiki/wiki.html",loader:!0,section:"wiki"}),t.when("/project/:pslug/team",{templateUrl:"team/team.html",loader:!0,section:"team"}),t.when("/project/:pslug/issues",{templateUrl:"issue/issues.html",loader:!0,section:"issues"}),t.when("/project/:pslug/issue/:issueref",{templateUrl:"issue/issues-detail.html",loader:!0,section:"issues"}),t.when("/project/:pslug/admin/project-profile/details",{templateUrl:"admin/admin-project-profile.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/default-values",{templateUrl:"admin/admin-project-default-values.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/modules",{templateUrl:"admin/admin-project-modules.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/export",{templateUrl:"admin/admin-project-export.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/reports",{templateUrl:"admin/admin-project-reports.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/status",{templateUrl:"admin/admin-project-values-status.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/points",{templateUrl:"admin/admin-project-values-points.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/priorities",{templateUrl:"admin/admin-project-values-priorities.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/severities",{templateUrl:"admin/admin-project-values-severities.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/types",{templateUrl:"admin/admin-project-values-types.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/custom-fields",{templateUrl:"admin/admin-project-values-custom-fields.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/tags",{templateUrl:"admin/admin-project-values-tags.html",section:"admin"}),t.when("/project/:pslug/admin/memberships",{templateUrl:"admin/admin-memberships.html",section:"admin"}),t.when("/project/:pslug/admin/roles",{templateUrl:"admin/admin-roles.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/webhooks",{templateUrl:"admin/admin-third-parties-webhooks.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/github",{templateUrl:"admin/admin-third-parties-github.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/gitlab",{templateUrl:"admin/admin-third-parties-gitlab.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/bitbucket",{templateUrl:"admin/admin-third-parties-bitbucket.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/gogs",{templateUrl:"admin/admin-third-parties-gogs.html",section:"admin"}),t.when("/project/:pslug/admin/contrib/:plugin",{templateUrl:"contrib/main.html"}),t.when("/project/:pslug/transfer/:token",{templateUrl:"projects/transfer/transfer-page.html",loader:!0,controller:"Project",controllerAs:"vm"}),t.when("/user-settings/user-profile",{templateUrl:"user/user-profile.html"}),t.when("/user-settings/user-change-password",{templateUrl:"user/user-change-password.html"}),t.when("/user-settings/mail-notifications",{templateUrl:"user/mail-notifications.html"}),t.when("/change-email/:email_token",{templateUrl:"user/change-email.html"}),t.when("/cancel-account/:cancel_token",{templateUrl:"user/cancel-account.html"}),t.when("/user-settings/contrib/:plugin",{templateUrl:"contrib/user-settings.html"}),t.when("/profile",{templateUrl:"profile/profile.html",loader:!0,access:{requiresLogin:!0},controller:"Profile",controllerAs:"vm"}),t.when("/profile/:slug",{templateUrl:"profile/profile.html",loader:!0,controller:"Profile",controllerAs:"vm"}),t.when("/login",{templateUrl:"auth/login.html",title:"LOGIN.PAGE_TITLE",description:"LOGIN.PAGE_DESCRIPTION",disableHeader:!0,controller:"LoginPage"}),t.when("/register",{templateUrl:"auth/register.html",title:"REGISTER.PAGE_TITLE",description:"REGISTER.PAGE_DESCRIPTION",disableHeader:!0}),t.when("/forgot-password",{templateUrl:"auth/forgot-password.html",title:"FORGOT_PASSWORD.PAGE_TITLE",description:"FORGOT_PASSWORD.PAGE_DESCRIPTION",disableHeader:!0}),t.when("/change-password/:token",{templateUrl:"auth/change-password-from-recovery.html",title:"CHANGE_PASSWORD.PAGE_TITLE",description:"CHANGE_PASSWORD.PAGE_TITLE",disableHeader:!0}),t.when("/invitation/:token",{templateUrl:"auth/invitation.html",title:"INVITATION.PAGE_TITLE",description:"INVITATION.PAGE_DESCRIPTION",disableHeader:!0}),t.when("/external-apps",{templateUrl:"external-apps/external-app.html",title:"EXTERNAL_APP.PAGE_TITLE",description:"EXTERNAL_APP.PAGE_DESCRIPTION",controller:"ExternalApp",controllerAs:"vm",disableHeader:!0,mobileViewport:!0}),t.when("/blocked-project/:pslug/",{templateUrl:"projects/project/blocked-project.html",loader:!0}),t.when("/error",{templateUrl:"error/error.html"}),t.when("/not-found",{templateUrl:"error/not-found.html"}),t.when("/permission-denied",{templateUrl:"error/permission-denied.html"}),t.otherwise({templateUrl:"error/not-found.html"}),e.html5Mode({enabled:!0,requireBase:!1}),d={"Content-Type":"application/json","Accept-Language":window.taigaConfig.defaultLanguage||"en","X-Session-Id":a.sessionId},r.defaults.headers["delete"]=d,r.defaults.headers.patch=d,r.defaults.headers.post=d,r.defaults.headers.put=d,r.defaults.headers.get={"X-Session-Id":a.sessionId},r.useApplyAsync(!0),i.setSessionId(a.sessionId),l=function(t,e,r,n,i){var o;return o=function(o){var s,a;return 0===o.status||o.status===-1&&!o.config.cancelable?(n.closeAll(),i.error()):401===o.status&&e.url().indexOf("/login")===-1&&(s=e.url(),a=e.search(),a.force_next?e.url(r.resolve("login")).search("force_next",a.force_next):e.url(r.resolve("login")).search("next",s)),t.reject(o)},{responseError:o}},n.factory("authHttpIntercept",["$q","$location","$tgNavUrls","lightboxService","tgErrorHandlingService",l]),r.interceptors.push("authHttpIntercept"),h=function(t,e){return{request:function(t){return e.logRequest(),t},requestError:function(r){return e.logResponse(),t.reject(r)},responseError:function(r){return e.logResponse(),t.reject(r)},response:function(t){return e.logResponse(),t}}},n.factory("loaderIntercept",["$q","tgLoader",h]),r.interceptors.push("loaderIntercept"),y=function(t){var e;return e=function(e){var r;return 400===e.status&&e.data.version&&(r=angular.element("body").injector(),r.invoke(["$tgConfirm","$translate",function(t){return function(t,e){var r;return r=e.instant("ERROR.VERSION_ERROR"),t.notify("error",r,null,1e4)}}(this)])),t.reject(e)},{responseError:e}},n.factory("versionCheckHttpIntercept",["$q",y]),r.interceptors.push("versionCheckHttpIntercept"),p=function(t,e){var r,n,i;return r=function(){return e.block()},i=function(t){return t.data.blocked_code&&r(),t},n=function(e){return 451===e.status&&r(),t.reject(e)},{response:i,responseError:n}},n.factory("blockingIntercept",["$q","tgErrorHandlingService",p]),r.interceptors.push("blockingIntercept"),o.debugInfoEnabled(window.taigaConfig.debugInfo||!1),localStorage.userInfo&&(v=JSON.parse(localStorage.userInfo)),m=(null!=v?v.lang:void 0)||window.taigaConfig.defaultLanguage||"en",u.addPart("taiga"),s.useLoader("$translatePartialLoader",{urlTemplate:"/"+window._version+"/locales/{part}/locale-{lang}.json"}).useSanitizeValueStrategy("escapeParameters").addInterpolation("$translateMessageFormatInterpolation").preferredLanguage(m),s.fallbackLanguage(m),f=window.getDecorators(),_.each(f,function(t){return n.decorator(t.provider,t.decorator)})},e=function(t,e){var r;return moment.locale(t),"en"!==t&&ljs.load("/"+window._version+"/locales/moment-locales/"+t+".js"),r={defaultMessage:e.instant("COMMON.FORM_ERRORS.DEFAULT_MESSAGE"),type:{email:e.instant("COMMON.FORM_ERRORS.TYPE_EMAIL"),url:e.instant("COMMON.FORM_ERRORS.TYPE_URL"),urlstrict:e.instant("COMMON.FORM_ERRORS.TYPE_URLSTRICT"),number:e.instant("COMMON.FORM_ERRORS.TYPE_NUMBER"),digits:e.instant("COMMON.FORM_ERRORS.TYPE_DIGITS"),dateIso:e.instant("COMMON.FORM_ERRORS.TYPE_DATEISO"),alphanum:e.instant("COMMON.FORM_ERRORS.TYPE_ALPHANUM"),phone:e.instant("COMMON.FORM_ERRORS.TYPE_PHONE")},notnull:e.instant("COMMON.FORM_ERRORS.NOTNULL"),notblank:e.instant("COMMON.FORM_ERRORS.NOT_BLANK"),required:e.instant("COMMON.FORM_ERRORS.REQUIRED"),regexp:e.instant("COMMON.FORM_ERRORS.REGEXP"),min:e.instant("COMMON.FORM_ERRORS.MIN"),max:e.instant("COMMON.FORM_ERRORS.MAX"),range:e.instant("COMMON.FORM_ERRORS.RANGE"),minlength:e.instant("COMMON.FORM_ERRORS.MIN_LENGTH"),maxlength:e.instant("COMMON.FORM_ERRORS.MAX_LENGTH"),rangelength:e.instant("COMMON.FORM_ERRORS.RANGE_LENGTH"),mincheck:e.instant("COMMON.FORM_ERRORS.MIN_CHECK"),maxcheck:e.instant("COMMON.FORM_ERRORS.MAX_CHECK"),rangecheck:e.instant("COMMON.FORM_ERRORS.RANGE_CHECK"),equalto:e.instant("COMMON.FORM_ERRORS.EQUAL_TO"),linewidth:e.instant("COMMON.FORM_ERRORS.LINEWIDTH"),pikaday:e.instant("COMMON.FORM_ERRORS.PIKADAY")},checksley.updateMessages("default",r)},r=function(t,r,n,i,o,s,u,c,l,p,f,d){var h,g,m;return t.debug("Initialize application"),r.$on("$translatePartialLoaderStructureChanged",function(){return s.refresh()}),m={linewidth:function(t,e){var r,n;return r=a.nl2br(t).split("
"),n=_.every(r,function(t){return t.length\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+e+"$2")}}(this),r=function(t){return function(t){var e,r;return e=_.keys(t),r=[],_.forIn(t,function(t,n){if(A.call(e,n)<0&&_.isFunction(t))return r.push(n)}),_.bindAll(t,r)}}(this),n=function(t){return function(t,e,r){var n,i;return i=t.$eval(e),void 0!==i?r(i):(n=null,n=t.$watch(e,function(t){if(void 0!==t)return r(t),n?n():void 0}))}}(this),h=function(){var t,e,r,n,i,o,s,a;for(e=arguments[0],o=2<=arguments.length?R.call(arguments,1):[],t=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return P(e,t),e}(e),r=o.length-1;r>=0;r+=-1){i=o[r],a=i.prototype;for(s in a)n=a[s],t.prototype[s]=n}return t},C=function(t,e){return _.trim(t,e)},S=function(t){return t.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-")},O=function(t){return t?_.capitalize(t.replace(/-/g," ")):t},T=function(t,e){var r,n;return r=t.data("nextTextPosition"),(null==r||r>=e.length)&&(r=0),n=e[r],t.data("nextTextPosition",r+1),t.text(n)},l=function(t,e){var r,n,i,o;for(o={},r=0,i=t.length;re&&(n=n.substring(0,e+1),n=n.substring(0,Math.min(n.length,n.lastIndexOf(" "))),n+=r),n):t},b=function(t,e){var r,n,i;return null==e&&(e=1),isNaN(parseFloat(t))||!isFinite(t)?"-":0===t?"0 bytes":(i=["bytes","KB","MB","GB","TB","PB"],r=Math.floor(Math.log(t)/Math.log(1024)),r>5&&(r=5),n=(t/Math.pow(1024,r)).toFixed(e),n+" "+i[r])},$=function(t,e){var r;return e?(r=new RegExp("<(?!"+e+"s*/?)[^>]+>","gi"),String(t).replace(r,"")):String(t).replace(/<\/?[^>]+>/g,"")},v=function(t,e,r){var n;return n=new RegExp("<("+e+")>","gi"),t=t.replace(n,"<"+r+">"),n=new RegExp("","gi"),t=t.replace(n,"")},a=function(t){return function(t,e,r){return Object.defineProperty(t,e,{get:function(){var t;if(!_.isFunction(r))throw"defineImmutableProperty third param must be a function";if(t=r(),t&&_.isObject(t)&&void 0===t.size)throw"defineImmutableProperty must return immutable data";return t}})}}(this),_.mixin({removeKeys:function(t,e){return _.chain([e]).flatten().reduce(function(t,e){return delete t[e],t},t).value()},cartesianProduct:function(){return _.reduceRight(arguments,function(t,e){return _.flatten(_.map(t,function(t){return _.map(e,function(e){return[e].concat(t)})}),!0)},[[]])}}),p=function(t){return null!==t.match(/\.(jpe?g|png|gif|gifv|webm)/i)},f=function(t){return null!==t.match(/\.(pdf)/i)},m=function(t,e){var r;return r={},e.forEach(function(e,n){if(e!==t.get(n))return e.toJS?r[n]=e.toJS():r[n]=e}),r},t=["#fce94f","#edd400","#c4a000","#8ae234","#73d216","#4e9a06","#d3d7cf","#fcaf3e","#f57900","#ce5c00","#729fcf","#3465a4","#204a87","#888a85","#ad7fa8","#75507b","#5c3566","#ef2929","#cc0000","#a40000","#222222"],c=function(){return _.sample(t)},u=function(){return _.clone(t)},j=this.taiga,j.addClass=e,j.nl2br=g,j.bindMethods=r,j.bindOnce=n,j.mixOf=h,j.trim=C,j.slugify=S,j.unslugify=O,j.toggleText=T,j.groupBy=l,j.timeout=I,j.cancelTimeout=i,j.scopeDefer=y,j.toString=E,j.joinStr=d,j.truncate=w,j.debounce=o,j.debounceLeading=s,j.startswith=k,j.sizeFormat=b,j.stripTags=$,j.replaceTags=v,j.defineImmutableProperty=a,j.isImage=p,j.isPdf=f,j.patch=m,j.getRandomDefaultColor=c,j.getDefaulColorList=u}.call(this),function(){var t,e,r,n,i,o,s,a;o=this.taiga,n=this.taiga.groupBy,i=this.taiga.joinStr,a=this.taiga.trim,s=this.taiga.toString,e=function(){function t(){}return t.prototype.fillUsersAndRoles=function(t,e){var r,i;return r=_.filter(t,function(t){return function(t){return t.is_active}}(this)),this.scope.activeUsers=_.sortBy(r,"full_name_display"),this.scope.activeUsersById=n(this.scope.activeUsers,function(t){return t.id}),this.scope.users=_.sortBy(t,"full_name_display"),this.scope.usersById=n(this.scope.users,function(t){return t.id}),this.scope.roles=_.sortBy(e,"order"),i=_(this.scope.project.members).map("role").uniq().value(),this.scope.computableRoles=_(e).filter("computable").filter(function(t){return _.includes(i,t.id)}).value()},t.prototype.loadUsersAndRoles=function(){var t;return t=this.q.all([this.rs.projects.usersList(this.scope.projectId),this.rs.projects.rolesList(this.scope.projectId)]),t.then(function(t){return function(e){var r,n;return n=e[0],r=e[1],t.fillUsersAndRoles(n,r),e}}(this))},t}(),o.PageMixin=e,t=function(){function t(){}return t.prototype.selectFilter=function(t,e,r){var n,s,u;if(null==r&&(r=!1),u=this.location.search(),void 0!==u[t]&&"page"!==t&&(n=_.map(o.toString(u[t]).split(","),function(t){return a(t)}),n.push(o.toString(e)),n=_.compact(n),e=i(",",_.uniq(n))),!this.location.isInCurrentRouteParams(t,e))return s=r?this.location:this.location.noreload(this.scope),s.search(t,e)},t.prototype.replaceFilter=function(t,e,r){var n;if(null==r&&(r=!1),!this.location.isInCurrentRouteParams(t,e))return n=r?this.location:this.location.noreload(this.scope),n.search(t,e)},t.prototype.replaceAllFilters=function(t,e){var r;return null==e&&(e=!1),r=e?this.location:this.location.noreload(this.scope),r.search(t)},t.prototype.unselectFilter=function(t,e,r){var n,s,u,c;if(null==r&&(r=!1),u=this.location.search(),void 0!==u[t])return void 0!==e&&null!==e||delete u[t],c=_.map(o.toString(u[t]).split(","),function(t){return a(t)}),s=_.reject(c,function(t){return t===o.toString(e)}),s=_.compact(s),e=_.isEmpty(s)?null:i(",",_.uniq(s)),n=r?this.location:this.location.noreload(this.scope),n.search(t,e)},t.prototype.applyStoredFilters=function(t,e){var r;return!(!_.isEmpty(this.location.search())||(r=this.getFilters(t,e),!Object.keys(r).length))&&(this.location.search(r),this.location.replace(),!0)},t.prototype.storeFilters=function(t,e,r){var n,i;return i=t+":"+r,n=o.generateHash([t,i]),this.storage.set(n,e)},t.prototype.getFilters=function(t,e){var r,n;return n=t+":"+e,r=o.generateHash([t,n]),this.storage.get(r)||{}},t.prototype.formatSelectedFilters=function(t,e,r){var n,i;return i=r.split(","),n=_.filter(e,function(t){return i.indexOf(_.toString(t.id))!==-1}),_.map(n,function(e){return{id:e.id,key:t+":"+e.id,dataType:t,name:e.name,color:e.color}})},t}(),o.FiltersMixin=t,r=function(){function t(){}return t.prototype.changeQ=function(t){return this.replaceFilter("q",t),this.filtersReloadContent(),this.generateFilters()},t.prototype.removeFilter=function(t){return this.unselectFilter(t.dataType,t.id),this.filtersReloadContent(),this.generateFilters()},t.prototype.addFilter=function(t){return this.selectFilter(t.category.dataType,t.filter.id),this.filtersReloadContent(),this.generateFilters()},t.prototype.selectCustomFilter=function(t){return this.replaceAllFilters(t.filter),this.filtersReloadContent(),this.generateFilters()},t.prototype.saveCustomFilter=function(t){var e,r;return e={},r=this.location.search(),e.tags=r.tags,e.status=r.status,e.assigned_to=r.assigned_to,e.owner=r.owner,this.filterRemoteStorageService.getFilters(this.scope.projectId,this.storeCustomFiltersName).then(function(r){return function(n){return n[t]=e,r.filterRemoteStorageService.storeFilters(r.scope.projectId,n,r.storeCustomFiltersName).then(r.generateFilters)}}(this))},t.prototype.removeCustomFilter=function(t){return this.filterRemoteStorageService.getFilters(this.scope.projectId,this.storeCustomFiltersName).then(function(e){return function(r){return delete r[t.id],e.filterRemoteStorageService.storeFilters(e.scope.projectId,r,e.storeCustomFiltersName).then(e.generateFilters),e.generateFilters()}}(this))},t.prototype.generateFilters=function(){var t,e;return this.storeFilters(this.params.pslug,this.location.search(),this.storeFiltersName),e=this.location.search(),t={},t.project=this.scope.projectId,t.tags=e.tags,t.status=e.status,t.assigned_to=e.assigned_to,t.owner=e.owner,t.epic=e.epic,t.q=e.q,this.q.all([this.rs.userstories.filtersData(t),this.filterRemoteStorageService.getFilters(this.scope.projectId,this.storeCustomFiltersName)]).then(function(e){return function(r){var n,i,o,s,a,u,c,l,p;return o=r[0],i=r[1],c=_.map(o.statuses,function(t){return t.id=t.id.toString(),t}),l=_.map(o.tags,function(t){return t.id=t.name,t}),p=_.filter(l,function(t){return t.count>0}),n=_.map(o.assigned_to,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.full_name||"Unassigned",t}),a=_.map(o.owners,function(t){return t.id=t.id.toString(),t.name=t.full_name,t}),s=_.map(o.epics,function(t){return t.id?(t.id=t.id.toString(),t.name="#"+t.ref+" "+t.subject):(t.id="null",t.name="Not in an epic"),t}),e.selectedFilters=[],t.status&&(u=e.formatSelectedFilters("status",c,t.status),e.selectedFilters=e.selectedFilters.concat(u)),t.tags&&(u=e.formatSelectedFilters("tags",l,t.tags),e.selectedFilters=e.selectedFilters.concat(u)),t.assigned_to&&(u=e.formatSelectedFilters("assigned_to",n,t.assigned_to),e.selectedFilters=e.selectedFilters.concat(u)),t.owner&&(u=e.formatSelectedFilters("owner",a,t.owner),e.selectedFilters=e.selectedFilters.concat(u)),t.epic&&(u=e.formatSelectedFilters("epic",s,t.epic),e.selectedFilters=e.selectedFilters.concat(u)),e.filterQ=t.q,e.filters=[{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.STATUS"),dataType:"status",content:c},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.TAGS"),dataType:"tags",content:l,hideEmpty:!0,totalTaggedElements:p.length},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"),dataType:"assigned_to",content:n},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.CREATED_BY"),dataType:"owner",content:a},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.EPIC"),dataType:"epic",content:s}],e.customFilters=[],_.forOwn(i,function(t,r){return e.customFilters.push({id:r,name:r,filter:t})})}}(this))},t}(),o.UsFiltersMixin=r}.call(this),function(){var t;t=angular.module("taigaAdmin",[])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;f=this.taiga,l=this.taiga.debounce,p=angular.module("taigaAuth",["taigaResources"]),a=function(){function t(t,e,r,n){var i;t.isAuthenticated()&&(n.force_login||(i=r.resolve("home"),n.next&&(i=decodeURIComponent(n.next),e.search("next",null)),e.url(i)))}return t.$inject=["tgCurrentUserService","$location","$tgNavUrls","$routeParams"],t}(),p.controller("LoginPage",a),t=function(t){function e(t,r,n,i,o,s,a,u,c,l){var p;this.rootscope=t,this.storage=r,this.model=n,this.rs=i,this.http=o,this.urls=s,this.config=a,this.translate=u,this.currentUserService=c,this.themeService=l,e.__super__.constructor.call(this),p=this.getUser(),this._currentTheme=this._getUserTheme(),this.setUserdata(p)}return d(e,t),e.$inject=["$rootScope","$tgStorage","$tgModel","$tgResources","$tgHttp","$tgUrls","$tgConfig","$translate","tgCurrentUserService","tgThemeService"],e.prototype.setUserdata=function(t){return t?(this.userData=Immutable.fromJS(t.getAttrs()),this.currentUserService.setUser(this.userData)):this.userData=null},e.prototype._getUserTheme=function(){var t;return(null!=(t=this.rootscope.user)?t.theme:void 0)||this.config.get("defaultTheme")||"taiga"},e.prototype._setTheme=function(){var t;if(t=this._getUserTheme(),this._currentTheme!==t)return this._currentTheme=t,this.themeService.use(this._currentTheme)},e.prototype._setLocales=function(){var t,e;return t=(null!=(e=this.rootscope.user)?e.lang:void 0)||this.config.get("defaultLanguage")||"en",this.translate.preferredLanguage(t),this.translate.use(t)},e.prototype.getUser=function(){var t,e;return this.rootscope.user?this.rootscope.user:(e=this.storage.get("userInfo"))?(t=this.model.make_model("users",e),this.rootscope.user=t,this._setLocales(),this._setTheme(),t):(this._setTheme(),null)},e.prototype.setUser=function(t){return this.rootscope.auth=t,this.storage.set("userInfo",t.getAttrs()),this.rootscope.user=t,this.setUserdata(t),this._setLocales(),this._setTheme()},e.prototype.clear=function(){return this.rootscope.auth=null,this.rootscope.user=null,this.storage.remove("userInfo")},e.prototype.setToken=function(t){return this.storage.set("token",t)},e.prototype.getToken=function(){return this.storage.get("token")},e.prototype.removeToken=function(){return this.storage.remove("token")},e.prototype.isAuthenticated=function(){return null!==this.getUser()},e.prototype.refresh=function(){var t;return t=this.urls.resolve("user-me"),this.http.get(t).then(function(t){return function(e,r){var n;return n=e.data,n.token=t.getUser().auth_token,n=t.model.make_model("users",n),t.setUser(n),n}}(this))},e.prototype.login=function(t,e){var r;return r=this.urls.resolve("auth"),t=_.clone(t,!1),t.type=e?e:"normal",this.removeToken(),this.http.post(r,t).then(function(t){return function(e,r){var n;return n=t.model.make_model("users",e.data),t.setToken(n.auth_token),t.setUser(n),n}}(this))},e.prototype.logout=function(){return this.removeToken(),this.clear(),this.currentUserService.removeUser(),this._setTheme(),this._setLocales()},e.prototype.register=function(t,e,r){var n;return n=this.urls.resolve("auth-register"),t=_.clone(t,!1),t.type=e?e:"public","private"===e&&(t.existing=!!r&&r),this.removeToken(),this.http.post(n,t).then(function(t){return function(e){var r;return r=t.model.make_model("users",e.data),t.setToken(r.auth_token),t.setUser(r),r}}(this))},e.prototype.getInvitation=function(t){return this.rs.invitations.get(t)},e.prototype.acceptInvitiationWithNewUser=function(t){return this.register(t,"private",!1)},e.prototype.acceptInvitiationWithExistingUser=function(t){return this.register(t,"private",!0)},e.prototype.forgotPassword=function(t){var e;return e=this.urls.resolve("users-password-recovery"),t=_.clone(t,!1),this.removeToken(),this.http.post(e,t)},e.prototype.changePasswordFromRecovery=function(t){var e;return e=this.urls.resolve("users-change-password-from-recovery"),t=_.clone(t,!1),this.removeToken(),this.http.post(e,t)},e.prototype.changeEmail=function(t){var e;return e=this.urls.resolve("users-change-email"),t=_.clone(t,!1),this.http.post(e,t)},e.prototype.cancelAccount=function(t){var e;return e=this.urls.resolve("users-cancel-account"),t=_.clone(t,!1),this.http.post(e,t)},e}(f.Service),p.service("$tgAuth",t),u=function(t,e,r,n){var i,o;return i=n.get("auth/login-text.html",!0),o=function(){var n,o,s;return(o=t.get("publicRegisterEnabled"))?(s=e.resolve("register"),r.force_next&&(n=encodeURIComponent(r.force_next),s+="?next="+n),i({url:s})):""},{restrict:"AE",scope:{},template:o}},p.directive("tgPublicRegisterMessage",["$tgConfig","$tgNavUrls","$routeParams","$tgTemplate",u]),s=function(t,e,r,n,i,o,s,a,u){var c;return c=function(c,p,f){var d,h,g,m;return d=new checksley.Form(p.find("form.login-form")),i.next&&i.next!==o.resolve("login")?c.nextUrl=decodeURIComponent(i.next):c.nextUrl=o.resolve("home"),i.force_next&&(c.nextUrl=decodeURIComponent(i.force_next)),g=function(t){return s.setupConnection(),0===c.nextUrl.indexOf("http")?u.location.href=c.nextUrl:r.url(c.nextUrl)},h=function(t){return e.notify("light-error",a.instant("LOGIN_FORM.ERROR_AUTH_INCORRECT"))},c.onKeyUp=function(t){var e,r;if(e=angular.element(t.currentTarget),r=e.val(),c.iscapsLockActivated=!1,r!==r.toLowerCase())return c.iscapsLockActivated=!0},m=l(2e3,function(e){return function(e){var r,i,o;if(e.preventDefault(),d.validate())return r={username:p.find("form.login-form input[name=username]").val(),password:p.find("form.login-form input[name=password]").val() },i=n.get("loginFormType","normal"),o=t.login(r,i),o.then(g,h)}}(this)),p.on("submit","form",m),window.prerenderReady=!0,c.$on("$destroy",function(){return p.off()})},{link:c}},p.directive("tgLogin",["$tgAuth","$tgConfirm","$tgLocation","$tgConfig","$routeParams","$tgNavUrls","$tgEvents","$translate","$window",s]),c=function(t,e,r,n,i,o,s,a,u){var c;return c=function(c,p,f){var d,h,g,m;return i.get("publicRegisterEnabled")||(r.path(n.resolve("not-found")),r.replace()),c.data={},d=p.find("form").checksley({onlyOneErrorElement:!0}),o.next&&o.next!==n.resolve("login")?c.nextUrl=decodeURIComponent(o.next):c.nextUrl=n.resolve("home"),g=function(t){return s.trackEvent("auth","register","user registration",1),0===c.nextUrl.indexOf("http")?u.location.href=c.nextUrl:r.url(c.nextUrl)},h=function(t){var r;return t.data._error_message&&(r=a.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),e.notify("light-error",r)),d.setErrors(t.data)},m=l(2e3,function(e){return function(e){var r;if(e.preventDefault(),d.validate())return r=t.register(c.data),r.then(g,h)}}(this)),p.on("submit","form",m),c.$on("$destroy",function(){return p.off()}),window.prerenderReady=!0},{link:c}},p.directive("tgRegister",["$tgAuth","$tgConfirm","$tgLocation","$tgNavUrls","$tgConfig","$routeParams","$tgAnalytics","$translate","$window",c]),i=function(t,e,r,n,i){var o;return o=function(o,s,a){var u,c,p,f;return o.data={},u=s.find("form").checksley(),p=function(t){var o,s;return r.path(n.resolve("login")),s=i.instant("FORGOT_PASSWORD_FORM.SUCCESS_TITLE"),o=i.instant("FORGOT_PASSWORD_FORM.SUCCESS_TEXT"),e.success(s,o)},c=function(t){var r;return r=i.instant("FORGOT_PASSWORD_FORM.ERROR"),e.notify("light-error",r)},f=l(2e3,function(e){return function(e){var r;if(e.preventDefault(),u.validate())return r=t.forgotPassword(o.data),r.then(p,c)}}(this)),s.on("submit","form",f),o.$on("$destroy",function(){return s.off()}),window.prerenderReady=!0},{link:o}},p.directive("tgForgotPassword",["$tgAuth","$tgConfirm","$tgLocation","$tgNavUrls","$translate",i]),n=function(t,e,r,n,i,o){var s;return s=function(s,a,u){var c,p,f,d,h;return s.data={},null!=n.token?(s.tokenInParams=!0,s.data.token=n.token):(r.path(i.resolve("login")),h=o.instant("CHANGE_PASSWORD_RECOVERY_FORM.ERROR"),e.notify("light-error",h)),c=a.find("form").checksley(),f=function(t){return r.path(i.resolve("login")),h=o.instant("CHANGE_PASSWORD_RECOVERY_FORM.SUCCESS"),e.success(h)},p=function(t){return h=o.instant("CHANGE_PASSWORD_RECOVERY_FORM.ERROR"),e.notify("light-error",h)},d=l(2e3,function(e){return function(e){var r;if(e.preventDefault(),c.validate())return r=t.changePasswordFromRecovery(s.data),r.then(f,p)}}(this)),a.on("submit","form",d),s.$on("$destroy",function(){return a.off()})},{link:s}},p.directive("tgChangePasswordFromRecovery",["$tgAuth","$tgConfirm","$tgLocation","$routeParams","$tgNavUrls","$translate",n]),o=function(t,e,r,n,i,o,s,a){var u;return u=function(u,c,p){var f,d,h,g,m,v,y,b,S,k;return k=n.token,v=t.getInvitation(k),v.then(function(t){return u.invitation=t,u.publicRegisterEnabled=a.get("publicRegisterEnabled")}),v.then(null,function(t){var n;return r.path(i.resolve("login")),n=s.instant("INVITATION_LOGIN_FORM.NOT_FOUND"),e.notify("light-error",n)}),u.dataLogin={token:k},f=c.find("form.login-form").checksley({onlyOneErrorElement:!0}),g=function(t){var n;return o.trackEvent("auth","invitationAccept","invitation accept with existing user",1),r.path(i.resolve("project",{project:u.invitation.project_slug})),n=s.instant("INVITATION_LOGIN_FORM.SUCCESS",{project_name:u.invitation.project_name}),e.notify("success",n)},d=function(t){return e.notify("light-error",t.data._error_message)},b=l(2e3,function(e){return function(e){if(e.preventDefault(),f.validate())return v=t.acceptInvitiationWithExistingUser(u.dataLogin),v.then(g,d)}}(this)),c.on("submit","form.login-form",b),c.on("click",".button-login",b),u.dataRegister={token:k},y=c.find("form.register-form").checksley({onlyOneErrorElement:!0}),m=function(t){return o.trackEvent("auth","invitationAccept","invitation accept with new user",1),r.path(i.resolve("project",{project:u.invitation.project_slug})),e.notify("success","You've successfully joined this project","Welcome to "+_.escape(u.invitation.project_name))},h=function(t){var r;return t.data._error_message&&(r=s.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),e.notify("light-error",r)),y.setErrors(t.data)},S=l(2e3,function(e){return function(e){if(e.preventDefault(),y.validate())return v=t.acceptInvitiationWithNewUser(u.dataRegister),v.then(m,h)}}(this)),c.on("submit","form.register-form",S),c.on("click",".button-register",S),u.$on("$destroy",function(){return c.off()})},{link:u}},p.directive("tgInvitation",["$tgAuth","$tgConfirm","$tgLocation","$routeParams","$tgNavUrls","$tgAnalytics","$translate","$tgConfig",o]),r=function(t,e,r,n,i,o,s,a){var u;return u=function(e,u,c){var l,p,f,d;return e.data={},e.data.email_token=o.email_token,l=u.find("form").checksley(),f=function(e){var o;return r.isAuthenticated()?t.queryOne("users",r.getUser().id).then(function(t){return function(t){return r.setUser(t),i.path(s.resolve("home"))}}(this)):i.path(s.resolve("login")),o=a.instant("CHANGE_EMAIL_FORM.SUCCESS"),n.success(o)},p=function(t){var e;return e=a.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),n.notify("light-error",e)},d=function(){var t;if(l.validate())return t=r.changeEmail(e.data),t.then(f,p)},u.on("submit",function(t){return t.preventDefault(),d()}),u.on("click","a.button-change-email",function(t){return t.preventDefault(),d()}),e.$on("$destroy",function(){return u.off()})},{link:u}},p.directive("tgChangeEmail",["$tgRepo","$tgModel","$tgAuth","$tgConfirm","$tgLocation","$routeParams","$tgNavUrls","$translate",r]),e=function(t,e,r,n,i,o,s){var a;return a=function(t,e,a){var u,c,p,f;return t.data={},t.data.cancel_token=o.cancel_token,u=e.find("form").checksley(),p=function(t){var e;return r.logout(),i.path(s.resolve("home")),e=$translate.instant("CANCEL_ACCOUNT.SUCCESS"),n.success(e)},c=function(t){var e;return e=$translate.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),n.notify("error",e)},f=l(2e3,function(e){return function(e){var n;if(e.preventDefault(),u.validate())return n=r.cancelAccount(t.data),n.then(p,c)}}(this)),e.on("submit","form",f),t.$on("$destroy",function(){return e.off()})},{link:a}},p.directive("tgCancelAccount",["$tgRepo","$tgModel","$tgAuth","$tgConfirm","$tgLocation","$routeParams","$tgNavUrls",e])}.call(this),function(){var t;t=angular.module("taigaBacklog",[])}.call(this),function(){var t,e,r,n,i,o,s;o=this.taiga,r=this.taiga.groupBy,e=this.taiga.bindOnce,i=angular.module("taigaBase",[]),t=function(t,e){var r;return r=function(r,n,i){return e.onresize=function(){return t.$broadcast("resize")}},{link:r}},i.directive("tgMain",["$rootScope","$window",t]),s={home:"/",projects:"/projects",error:"/error","not-found":"/not-found","permission-denied":"/permission-denied",discover:"/discover","discover-search":"/discover/search",login:"/login","forgot-password":"/forgot-password","change-password":"/change-password/:token","change-email":"/change-email/:token","cancel-account":"/cancel-account/:token",register:"/register",invitation:"/invitation/:token","create-project":"/create-project",profile:"/profile","user-profile":"/profile/:username","blocked-project":"/blocked-project/:project",project:"/project/:project","project-backlog":"/project/:project/backlog","project-taskboard":"/project/:project/taskboard/:sprint","project-kanban":"/project/:project/kanban","project-issues":"/project/:project/issues","project-epics":"/project/:project/epics","project-search":"/project/:project/search","project-epics-detail":"/project/:project/epic/:ref","project-userstories-detail":"/project/:project/us/:ref","project-tasks-detail":"/project/:project/task/:ref","project-issues-detail":"/project/:project/issue/:ref","project-wiki":"/project/:project/wiki","project-wiki-list":"/project/:project/wiki-list","project-wiki-page":"/project/:project/wiki/:slug","project-team":"/project/:project/team","project-admin-home":"/project/:project/admin/project-profile/details","project-admin-project-profile-details":"/project/:project/admin/project-profile/details","project-admin-project-profile-default-values":"/project/:project/admin/project-profile/default-values","project-admin-project-profile-modules":"/project/:project/admin/project-profile/modules","project-admin-project-profile-export":"/project/:project/admin/project-profile/export","project-admin-project-profile-reports":"/project/:project/admin/project-profile/reports","project-admin-project-values-status":"/project/:project/admin/project-values/status","project-admin-project-values-points":"/project/:project/admin/project-values/points","project-admin-project-values-priorities":"/project/:project/admin/project-values/priorities","project-admin-project-values-severities":"/project/:project/admin/project-values/severities","project-admin-project-values-types":"/project/:project/admin/project-values/types","project-admin-project-values-custom-fields":"/project/:project/admin/project-values/custom-fields","project-admin-project-values-tags":"/project/:project/admin/project-values/tags","project-admin-memberships":"/project/:project/admin/memberships","project-admin-roles":"/project/:project/admin/roles","project-admin-third-parties-webhooks":"/project/:project/admin/third-parties/webhooks","project-admin-third-parties-github":"/project/:project/admin/third-parties/github","project-admin-third-parties-gitlab":"/project/:project/admin/third-parties/gitlab","project-admin-third-parties-bitbucket":"/project/:project/admin/third-parties/bitbucket","project-admin-third-parties-gogs":"/project/:project/admin/third-parties/gogs","project-admin-contrib":"/project/:project/admin/contrib/:plugin","user-settings-user-profile":"/user-settings/user-profile","user-settings-user-change-password":"/user-settings/user-change-password","user-settings-user-avatar":"/user-settings/user-avatar","user-settings-mail-notifications":"/user-settings/mail-notifications","user-settings-contrib":"/user-settings/contrib/:plugin"},n=function(t,e){return t.debug("Initialize navigation urls"),e.update(s)},i.run(["$log","$tgNavUrls",n])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g,m=[].slice,v=function(t,e){function r(){this.constructor=t}for(var n in e)y.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},y={}.hasOwnProperty;g=this.taiga,h=angular.module("taigaCommon",[]),o=function(t){return{get:function(){return{i18n:{previousMonth:t.instant("COMMON.PICKERDATE.PREV_MONTH"),nextMonth:t.instant("COMMON.PICKERDATE.NEXT_MONTH"),months:[t.instant("COMMON.PICKERDATE.MONTHS.JAN"),t.instant("COMMON.PICKERDATE.MONTHS.FEB"),t.instant("COMMON.PICKERDATE.MONTHS.MAR"),t.instant("COMMON.PICKERDATE.MONTHS.APR"),t.instant("COMMON.PICKERDATE.MONTHS.MAY"),t.instant("COMMON.PICKERDATE.MONTHS.JUN"),t.instant("COMMON.PICKERDATE.MONTHS.JUL"),t.instant("COMMON.PICKERDATE.MONTHS.AUG"),t.instant("COMMON.PICKERDATE.MONTHS.SEP"),t.instant("COMMON.PICKERDATE.MONTHS.OCT"),t.instant("COMMON.PICKERDATE.MONTHS.NOV"),t.instant("COMMON.PICKERDATE.MONTHS.DEC")],weekdays:[t.instant("COMMON.PICKERDATE.WEEK_DAYS.SUN"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.MON"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.TUE"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.WED"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.THU"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.FRI"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.SAT")],weekdaysShort:[t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SUN"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.MON"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.TUE"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.WED"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.THU"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.FRI"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SAT")]},isRTL:"true"===t.instant("COMMON.PICKERDATE.IS_RTL"),firstDay:parseInt(t.instant("COMMON.PICKERDATE.FIRST_DAY_OF_WEEK"),10),format:t.instant("COMMON.PICKERDATE.FORMAT")}}}},h.factory("tgDatePickerConfigService",["$translate",o]),l=function(t,e){var r;return r=function(){return t.getSelection?t.getSelection().toString():e.selection?e.selection.createRange().text:""},{get:r}},h.factory("$selectedText",["$window","$document",l]),n=function(t){var e,r;return r=function(t,e,r){if(e&&r&&e.get("my_permissions").indexOf(r)>-1)return t.removeClass("hidden")},e=function(e,n,i){var o,s,a;return n.addClass("hidden"),o=i.tgCheckPermission,a=e.$watch(function(){return t.project},function(){if(t.project)return r(n,t.project,o),a()}),s=i.$observe("tgCheckPermission",function(e){if(e)return r(n,t.project,e),s()}),e.$on("$destroy",function(){return n.off()})},{link:e}},n.$inject=["tgProjectService"],h.directive("tgCheckPermission",n),i=function(){var t,e;return e="tgClassPermission",t=function(t,r,n){var i,o,s;return i=function(t,e,n){var i;return i="!"===n[0],i&&(n=n.slice(1)),i&&t.my_permissions.indexOf(n)===-1?r.addClass(e):i||t.my_permissions.indexOf(n)===-1?r.removeClass(e):r.addClass(e)},o=function(r){var o,a,u,c;if(r){s(),a=t.$eval(n[e]),c=[];for(o in a)u=a[o],c.push(i(r,o,u));return c}},s=t.$watch("project",o)},{link:t}},h.directive("tgClassPermission",i),t=function(){var t,e,r,n;return e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,r=function(t){return function(t){var i;if(i=n.shift(),i(),n.length)return e(r)}}(this),n=[],t=function(){var t,i,o,s;for(s=[],i=0,o=arguments.length;i-1?t.resolve("project-backlog",r):e.is_kanban_activated&&e.my_permissions.indexOf("view_us")>-1?t.resolve("project-kanban",r):e.is_wiki_activated&&e.my_permissions.indexOf("view_wiki_pages")>-1?t.resolve("project-wiki",r):e.is_issues_activated&&e.my_permissions.indexOf("view_issues")>-1?t.resolve("project-issues",r):t.resolve("project",r)},{get:e}},h.factory("$projectUrl",["$tgNavUrls",a]),u=function(t){var e,r,n;return e=t.defer(),e.resolve(),r=e.promise,n={bindAdd:function(t){return function(e){return function(){var n;return n=1<=arguments.length?m.call(arguments,0):[],r=r.then(function(){return e.apply(t,n)})}}}(this),add:function(t){return function(t){return r=r?r.then(t):t(),n}}(this)}},h.factory("$tgQqueue",["$q",u]),c=function(t){function e(t,e,r,n){this.qqueue=t,this.repo=e,this.q=r,this.model=n}return v(e,t),e.$inject=["$tgQqueue","$tgRepo","$q","$tgModel"],e.prototype.setObject=function(t,e){this.scope=t,this.prop=e},e.prototype.clone=function(){var t,e;return t=_.cloneDeep(this.scope[this.prop]._attrs),e=this.model.make_model(this.scope[this.prop]._name,t)},e.prototype.getObj=function(){return this.scope[this.prop]},e.prototype.save=function(t){var e;return e=this.q.defer(),this.qqueue.add(function(r){return function(){var n,i,o,s,a;return s=r.getObj(),i=s.comment,s.comment="",n=r.clone(),o=_.omit(s._modifiedAttrs,["version"]),n=_.assign(n,o),t(n),i.length&&(n.comment=i),a=function(){return r.scope[r.prop]=n,e.resolve.apply(null,arguments)},r.repo.save(n).then(a,e.reject)}}(this)),e.promise},e}(g.Service),h.service("$tgQueueModelTransformation",c),f=function(t){return{get:function(e){return function(e,r){var n;return null==r&&(r=!1),n=t.get(e),r&&(n=_.template(n)),n}}(this)}},h.factory("$tgTemplate",["$templateCache",f]),r=function(){var t;return t="",{template:t}},h.directive("tgCapslock",[r]),s=function(){var t;return t='\n \n',{template:t}},h.directive("tgLightboxClose",[s]),p=function(){var t;return t='\n \n {{svgTitle}}\n \n \n',{scope:{svgIcon:"@",svgTitle:"@",svgTitleTranslate:"@",svgTitleTranslateValues:"="},template:t}},h.directive("tgSvg",[p]),e=function(t){return{restrict:"A",link:function(e,r){return t(function(){return r[0].focus()})}}},h.directive("tgAutofocus",["$timeout",e]),h.directive("tgPreloadImage",function(){var t,e,r;return e="loading...",r="
\n \n
",t=function(t,e){var r;return r=new Image,r.onload=e,r.src=t,r},{template:r,transclude:!0,replace:!0,link:function(r,n,i){var o,s,a;return o=n.find("img:last"),a=null,s=function(){if(n.find(".loading-spinner").remove(),o.show(),a)return clearTimeout(a),a=null},i.$observe("preloadSrc",function(r){return a&&clearTimeout(a),n.find(".loading-spinner").remove(),a=setTimeout(function(){return n.prepend(e)},200),o.hide(),t(r,s)})}}})}.call(this),function(){var t;t=angular.module("taigaEpics",[])}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}};o=this.taiga,i=this.taiga.startswith,r=this.taiga.bindMethods,n=angular.module("taigaEvents",[]),e=function(){function t(t,e,n,i,o,a){this.win=t,this.log=e,this.config=n,this.auth=i,this.liveAnnouncementService=o,this.rootScope=a,this.processMessage=s(this.processMessage,this),r(this)}return t.prototype.initialize=function(t){if(this.sessionId=t,this.subscriptions={},this.connected=!1,this.error=!1,this.pendingMessages=[],this.missedHeartbeats=0,this.heartbeatInterval=null,void 0===this.win.WebSocket)return this.log.info("WebSockets not supported on your browser")},t.prototype.setupConnection=function(){var t,e,r,n;if(this.stopExistingConnection(),n=this.config.get("eventsUrl"))return i(n,"ws:")||i(n,"wss:")||(t=this.win.location,r="https:"===t.protocol?"wss:":"ws:",e=_.trimStart(n,"/"),n=r+"//"+t.host+"/"+e),this.ws=new this.win.WebSocket(n),this.ws.addEventListener("open",this.onOpen),this.ws.addEventListener("message",this.onMessage),this.ws.addEventListener("error",this.onError),this.ws.addEventListener("close",this.onClose)},t.prototype.stopExistingConnection=function(){if(void 0!==this.ws)return this.ws.removeEventListener("open",this.onOpen),this.ws.removeEventListener("close",this.onClose),this.ws.removeEventListener("error",this.onError),this.ws.removeEventListener("message",this.onMessage),this.stopHeartBeatMessages(),this.ws.close(),delete this.ws},t.prototype.notifications=function(){return this.subscribe(null,"notifications",function(t){return function(e){return t.liveAnnouncementService.show(e.title,e.desc),t.rootScope.$digest()}}(this))},t.prototype.startHeartBeatMessages=function(){var t,e,r;if(!this.heartbeatInterval)return e=this.config.get("eventsMaxMissedHeartbeats",5),t=this.config.get("eventsHeartbeatIntervalTime",6e4),r=this.config.get("eventsReconnectTryInterval",1e4),this.missedHeartbeats=0,this.heartbeatInterval=setInterval(function(t){return function(){var r;try{if(t.missedHeartbeats>=e)throw new Error("Too many missed heartbeats PINGs.");return t.missedHeartbeats++,t.sendMessage({cmd:"ping"}),t.log.debug("HeartBeat send PING")}catch(n){return r=n,t.log.error("HeartBeat error: "+r.message),t.setupConnection()}}}(this),t),this.log.debug("HeartBeat enabled")},t.prototype.stopHeartBeatMessages=function(){if(this.heartbeatInterval)return clearInterval(this.heartbeatInterval),this.heartbeatInterval=null,this.log.debug("HeartBeat disabled")},t.prototype.processHeartBeatPongMessage=function(t){return this.missedHeartbeats=0,this.log.debug("HeartBeat recived PONG")},t.prototype.serialize=function(t){return _.isObject(t)?JSON.stringify(t):t},t.prototype.sendMessage=function(t){var e,r,n,i,o;if(this.pendingMessages.push(t),this.connected){for(n=_.map(this.pendingMessages,this.serialize),this.pendingMessages=[],o=[],e=0,r=n.length;e\n
<%- name %>
'),i=function(i,u,c){var l,p,f,d,h;return h=function(t){var e,o,a;return o={name:r.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED")},a=i.usersById[t.assigned_to],e=n.getAvatar(a),o.imgurl=e.url,o.bg=e.bg,a&&(o.name=a.full_name_display),u.find(".avatar").html(s(o)),u.find(".task-assignedto").attr("title",o.name)},l=u.controller(),d=i.$eval(c.tgRelatedTaskAssignedToInlineEdition),f=i.$eval(c.notAutoSave),p=!f,i.$watch(c.tgRelatedTaskAssignedToInlineEdition,function(){return d=i.$eval(c.tgRelatedTaskAssignedToInlineEdition),h(d)}),h(d),u.on("click",".task-assignedto",function(t){return e.$broadcast("assigned-to:add",d)}),a.bindOnce(i,"project",function(t){if(t.my_permissions.indexOf("modify_task")===-1)return u.unbind("click"),u.find("a").addClass("not-clickable")}),i.$on("assigned-to:added",o(2e3,function(e){return function(e,r,n){if(n.id===d.id)return n.assigned_to=r,p&&t.save(n).then(function(){return i.$emit("related-tasks:assigned-to-changed")}),h(n)}}(this))),i.$on("$destroy",function(){return u.off()})},{link:i}},s.directive("tgRelatedTaskAssignedToInlineEdition",["$tgRepo","$rootScope","$translate","tgAvatarService",t])}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=this.taiga,t=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e}(i.Service),o={auth:"/auth","auth-register":"/auth/register",invitations:"/invitations",users:"/users",by_username:"/users/by_username","users-password-recovery":"/users/password_recovery","users-change-password-from-recovery":"/users/change_password_from_recovery","users-change-password":"/users/change_password","users-change-email":"/users/change_email","users-cancel-account":"/users/cancel","user-stats":"/users/%s/stats","user-liked":"/users/%s/liked","user-voted":"/users/%s/voted","user-watched":"/users/%s/watched","user-contacts":"/users/%s/contacts","user-me":"/users/me",permissions:"/permissions","notify-policies":"/notify-policies","user-storage":"/user-storage",memberships:"/memberships","bulk-create-memberships":"/memberships/bulk_create",roles:"/roles",permissions:"/permissions",resolver:"/resolver",projects:"/projects","project-templates":"/project-templates","project-modules":"/projects/%s/modules","bulk-update-projects-order":"/projects/bulk_update_order","project-like":"/projects/%s/like","project-unlike":"/projects/%s/unlike","project-watch":"/projects/%s/watch","project-unwatch":"/projects/%s/unwatch","project-transfer-validate-token":"/projects/%s/transfer_validate_token","project-transfer-accept":"/projects/%s/transfer_accept","project-transfer-reject":"/projects/%s/transfer_reject","project-transfer-request":"/projects/%s/transfer_request","project-transfer-start":"/projects/%s/transfer_start","epic-statuses":"/epic-statuses","userstory-statuses":"/userstory-statuses",points:"/points","task-statuses":"/task-statuses","issue-statuses":"/issue-statuses","issue-types":"/issue-types", priorities:"/priorities",severities:"/severities",milestones:"/milestones",epics:"/epics","epic-upvote":"/epics/%s/upvote","epic-downvote":"/epics/%s/downvote","epic-watch":"/epics/%s/watch","epic-unwatch":"/epics/%s/unwatch","epic-related-userstories":"/epics/%s/related_userstories","epic-related-userstories-bulk-create":"/epics/%s/related_userstories/bulk_create",userstories:"/userstories","bulk-create-us":"/userstories/bulk_create","bulk-update-us-backlog-order":"/userstories/bulk_update_backlog_order","bulk-update-us-milestone":"/userstories/bulk_update_milestone","bulk-update-us-miles-order":"/userstories/bulk_update_sprint_order","bulk-update-us-kanban-order":"/userstories/bulk_update_kanban_order","userstories-filters":"/userstories/filters_data","userstory-upvote":"/userstories/%s/upvote","userstory-downvote":"/userstories/%s/downvote","userstory-watch":"/userstories/%s/watch","userstory-unwatch":"/userstories/%s/unwatch",tasks:"/tasks","bulk-create-tasks":"/tasks/bulk_create","bulk-update-task-taskboard-order":"/tasks/bulk_update_taskboard_order","task-upvote":"/tasks/%s/upvote","task-downvote":"/tasks/%s/downvote","task-watch":"/tasks/%s/watch","task-unwatch":"/tasks/%s/unwatch","task-filters":"/tasks/filters_data",issues:"/issues","bulk-create-issues":"/issues/bulk_create","issues-filters":"/issues/filters_data","issue-upvote":"/issues/%s/upvote","issue-downvote":"/issues/%s/downvote","issue-watch":"/issues/%s/watch","issue-unwatch":"/issues/%s/unwatch",wiki:"/wiki","wiki-restore":"/wiki/%s/restore","wiki-links":"/wiki-links","history/epic":"/history/epic","history/us":"/history/userstory","history/issue":"/history/issue","history/task":"/history/task","history/wiki":"/history/wiki/%s","attachments/epic":"/epics/attachments","attachments/us":"/userstories/attachments","attachments/issue":"/issues/attachments","attachments/task":"/tasks/attachments","attachments/wiki_page":"/wiki/attachments","custom-attributes/epic":"/epic-custom-attributes","custom-attributes/userstory":"/userstory-custom-attributes","custom-attributes/task":"/task-custom-attributes","custom-attributes/issue":"/issue-custom-attributes","custom-attributes-values/epic":"/epics/custom-attributes-values","custom-attributes-values/userstory":"/userstories/custom-attributes-values","custom-attributes-values/task":"/tasks/custom-attributes-values","custom-attributes-values/issue":"/issues/custom-attributes-values",webhooks:"/webhooks","webhooks-test":"/webhooks/%s/test",webhooklogs:"/webhooklogs","webhooklogs-resend":"/webhooklogs/%s/resend","epics-csv":"/epics/csv?uuid=%s","userstories-csv":"/userstories/csv?uuid=%s","tasks-csv":"/tasks/csv?uuid=%s","issues-csv":"/issues/csv?uuid=%s","timeline-profile":"/timeline/profile","timeline-user":"/timeline/user","timeline-project":"/timeline/project",search:"/search",exporter:"/exporter",importer:"/importer/load_dump",feedback:"/feedback",locales:"/locales",applications:"/applications","application-tokens":"/application-tokens","stats-discover":"/stats/discover"},r=function(t,e){return t.debug("Initialize api urls"),e.update(o)},e=function(t,e){var r,n,i,o,s;for(t.debug("Initialize resources"),o=_.toArray(arguments).slice(2),s=[],r=0,n=o.length;rn){n=c.length,s.name=i,s.value=c;break}return 0===n?s:s},d=function(t){var e,r,n;r=[];for(e in t)n=t[e],g.find("li."+e).show(),r.push(g.find("li."+e+" .num").html(n.length));return r},f=function(t){return g.find("a.active").removeClass("active"),g.find("li."+t.name+" a").addClass("active"),u=!1,a=t.name},m={epics:r.get("search-epics"),issues:r.get("search-issues"),tasks:r.get("search-tasks"),userstories:r.get("search-userstories"),wikipages:r.get("search-wikipages")},h=function(r){var i,o,s,a,u;return o=n.find(".search-result-table").children(),s=o.scope(),s&&(s.$destroy(),o.remove()),a=t.$new(),a[r.name]=r.value,u=angular.element.parseHTML(l(m[r.name])),i=e(u)(a),n.find(".search-result-table").html(i)},t.$watch("searchResults",function(t){var e;if(p=t)return e=c(t),d(t),h(e),f(e)}),t.$watch("searchTerm",function(t){if(void 0!==t)return i.search("text",t)}),n.on("click",".search-filter li > a",function(e){var r,n,i,o;return e.preventDefault(),o=angular.element(e.currentTarget),i=o.parent().data("name"),n=p?p[i]:[],r={name:i,value:n},t.$apply(function(){return h(r),f(r)})})},o=function(t,e,r){var i,o;return i=e.controller(),s(t,e,r,i),o=n.text,t.$watch("projectId",function(e){if(null!=e)return t.searchTerm=o})},{link:o}},u.directive("tgSearch",["$log","$compile","$templateCache","$routeParams","$tgLocation",r])}.call(this),function(){var t;t=angular.module("taigaTaskboard",[])}.call(this),function(){var t;t=angular.module("taigaTasks",[])}.call(this),function(){var t;t=angular.module("taigaTeam",[])}.call(this),function(){var t;t=angular.module("taigaUserSettings",[])}.call(this),function(){var t;t=angular.module("taigaUserStories",[])}.call(this),function(){var t;t=angular.module("taigaWiki",[])}.call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;r=this.taiga,e=angular.module("taigaCommon"),t=function(t){function e(t,e,r,n,i,o){var s;this.rootscope=t,this.log=e,this.config=r,this.win=n,this.doc=i,this.location=o,this.initialized=!1,s=this.config.get("analytics",{}),this.accountId=s.accountId,this.pageEvent=s.pageEvent||"$routeChangeSuccess",this.trackRoutes=s.trackRoutes||!0,this.ignoreFirstPageLoad=s.ignoreFirstPageLoad||!1}return n(e,t),e.$inject=["$rootScope","$log","$tgConfig","$window","$document","$location"],e.prototype.initialize=function(){return this.accountId?(this.injectAnalytics(),this.win.ga("create",this.accountId,"auto"),this.win.ga("require","displayfeatures"),this.trackRoutes&&!this.ignoreFirstPageLoad&&this.win.ga("send","pageview",this.getUrl()),this.trackRoutes&&this.rootscope.$on(this.pageEvent,function(t){return function(){return t.trackPage(t.getUrl(),"Taiga")}}(this)),this.initialized=!0):void this.log.debug("Analytics: no acount id provided. Disabling.")},e.prototype.getUrl=function(){return this.location.path()},e.prototype.injectAnalytics=function(){var t;return(t=function(t,e,r,n,i,o,s){t.GoogleAnalyticsObject=i,t[i]=t[i]||function(){(t[i].q=t[i].q||[]).push(arguments)},t[i].l=1*new Date,o=e.createElement(r),s=e.getElementsByTagName(r)[0],o.async=1,o.src=n,s.parentNode.insertBefore(o,s)})(window,document,"script","//www.google-analytics.com/analytics.js","ga")},e.prototype.trackPage=function(t,e){if(this.initialized&&this.win.ga)return e=e||this.doc[0].title,this.win.ga("send","pageview",{page:t,title:e})},e.prototype.trackEvent=function(t,e,r,n){if(this.initialized&&this.win.ga)return this.win.ga("send","event",t,e,r,n)},e}(r.Service),e.service("$tgAnalytics",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(t){var e;return t.debugInfo||(jQuery.fn.scope=function(){return this.data("scope")}),e=function(e,r){if(!t.debugInfo)return r.data("scope",e).addClass("tg-scope")},{link:e}},e.directive("tgBindScope",["$tgConfig",t])}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){return e.$watch(n.tgCompileHtml,function(n,i){return r.html(n),t(r.contents())(e)})},{link:e}},t.$inject=["$compile"],angular.module("taigaCommon").directive("tgCompileHtml",t)}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g,m,v,y,b,S,k,j,I;I=this.taiga,k=this.taiga.bindOnce,j=angular.module("taigaCommon"),n=function(t){var e,r;return r=function(e,r,n){var i,o,s;return s=t.instant("BACKLOG.SPRINTS.DATE"),o=moment(r).format(s),i=moment(n).format(s),e.html(o+"-"+i)},e=function(t,e,n){var i,o,s;return o=n.tgDateRange.split(","),i=o[0],s=o[1],k(t,i,function(n){return k(t,s,function(t){return r(e,n,t)})})},{link:e}},j.directive("tgDateRange",["$translate",n]),i=function(t,e){var r;return r=function(r,n,i,o){var s,a,u;return a=null,s=function(){var t;return t=e.get(),_.merge(t,{field:n[0],onSelect:function(t){return function(t){return a=t}}(this),onOpen:function(t){return function(){if(null!=a)return n.picker.setDate(a)}}(this)}),n.picker=new Pikaday(t)},u=t.$on("$translateChangeEnd",function(t){return function(t){return s()}}(this)),r.$watch(i.ngModel,function(t){if(null==t||n.picker||s(),null!=t)return n.picker.setDate(t)}),r.$on("$destroy",function(){return n.off(),u()})},{link:r,require:"ngModel"}},j.directive("tgDateSelector",["$rootScope","tgDatePickerConfigService",i]),m=function(){var t,e;return e=function(t,e,r){return t.hasClass(".current-progress")?t.css("width",e+"%"):(t.find(".current-progress").css("width",r+"%"),t.find(".number").html(e+" %"))},t=function(t,r,n){return k(t,n.tgSprintProgressbar,function(t){var n,i,o,s;return n=t.closed_points,o=t.total_points,i=0,0!==o&&(i=Math.round(100*(n/o))),s=0,0!==o&&(s=Math.round(98*(n/o))),e(r,i,s)}),t.$on("$destroy",function(){return r.off()})},{link:t}},j.directive("tgSprintProgressbar",m),r=function(t,e,r,n,i){var o;return o=function(t,e,o){return k(t,o.ngModel,function(e){var o,s;if(null!=e)return o=i.getAvatar(e.owner_extra_info),t.owner=e.owner_extra_info||{full_name_display:r.instant("COMMON.EXTERNAL_USER")},t.owner.avatar=o.url,t.owner.bg=o.bg,t.url=(null!=(s=t.owner)?s.is_active:void 0)?n.resolve("user-profile",{username:t.owner.username}):"",t.date=moment(e.created_date).format(r.instant("COMMON.DATETIME"))}),t.$on("$destroy",function(){return e.off()})},{link:o,restrict:"EA",require:"ngModel",scope:!0,templateUrl:"common/components/created-by.html"}},j.directive("tgCreatedByDisplay",["$tgTemplate","$compile","$translate","$tgNavUrls","tgAvatarService",r]),b=function(t,e,r,n,i){var o;return o=function(t,e,o){var s,a;return a=o.tgUserId,t.user=t.usersById[a]||{full_name_display:r.instant("COMMON.EXTERNAL_USER")},s=i.getAvatar(t.usersById[a]||null),t.user.avatar=s.url,t.user.bg=s.bg,t.url=t.user.is_active?n.resolve("user-profile",{username:t.user.username}):"",t.$on("$destroy",function(){return e.off()})},{link:o,restrict:"EA",scope:!0,templateUrl:"common/components/user-display.html"}},j.directive("tgUserDisplay",["$tgTemplate","$compile","$translate","$tgNavUrls","tgAvatarService",b]),S=function(t,e,r,n,i,o,s){var a;return a=function(r,i,o,a){var u,c,l,p;return c=function(){var t,e;return(null!=(t=r.project)&&null!=(e=t.my_permissions)?e.indexOf(o.requiredPerm):void 0)!==-1},p=function(i){var o;return o=n.save(function(t){return t.watchers=i,t}),o.then(function(){return i=_.map(i,function(t){return r.usersById[t]}),l(i),t.$broadcast("object:updated")}),o.then(null,function(){return e.notify("error")})},u=function(i){var o;return o=n.save(function(t){return t.watchers=i,t}),o.then(function(){var e,i;return e=n.getObj(),i=_.map(e.watchers,function(t){return r.usersById[t]}),l(i),t.$broadcast("object:updated")}),o.then(null,function(){return item.revert(),e.notify("error")})},l=function(t){return r.watchers=t,r.isEditable=c()},i.on("click",".js-delete-watcher",function(t){var n,i,o,l;if(t.preventDefault(),c())return i=angular.element(t.currentTarget),l=i.data("watcher-id"),o=s.instant("COMMON.WATCHERS.TITLE_LIGHTBOX_DELETE_WARTCHER"),n=r.usersById[l].full_name_display,e.askOnDelete(o,n).then(function(t){return function(t){var e;return t.finish(),e=_.clone(a.$modelValue.watchers,!1),e=_.pull(e,l),u(e)}}(this))}),r.$on("watcher:added",function(t,e){var r;return r=_.clone(a.$modelValue.watchers,!1),r.push(e),r=_.uniq(r),p(r)}),r.$watch(o.ngModel,function(t){var e;if(null!=t)return e=_.map(t.watchers,function(t){return r.usersById[t]}),e=_.filter(e,function(t){return!!t}),l(e)}),r.$on("$destroy",function(){return i.off()})},{scope:!0,templateUrl:"common/components/watchers.html",link:a,require:"ngModel"}},j.directive("tgWatchers",["$rootScope","$tgConfirm","$tgRepo","$tgQueueModelTransformation","$tgTemplate","$compile","$translate",S]),t=function(t,e,r,n,i,o,s,a,u,c){var l,p;return p=o.get("common/components/assigned-to.html",!0),l=function(r,o,l,f){var d,h,g;return d=function(){var t,e;return(null!=(t=r.project)&&null!=(e=t.my_permissions)?e.indexOf(l.requiredPerm):void 0)!==-1},g=function(r){var s,a,u;return a=f.$modelValue.clone(),a.assigned_to=r,s=n().target(o).start(),u=i.save(function(t){return t.assigned_to=r,t}),u.then(function(){return s.finish(),h(i.getObj()),t.$broadcast("object:updated")}),u.then(null,function(){return e.notify("error"),s.finish()}),u},h=function(t){var e,n,i,l,f,h,g;return e=c.getAvatar(null!=t?t.assigned_to_extra_info:void 0),n=null,null!=(null!=t?t.assigned_to:void 0)?(l=t.assigned_to_extra_info.full_name_display,g=!1,n=e.bg):(l=s.instant("COMMON.ASSIGNED_TO.ASSIGN"),g=!0),h=null!=t?t.is_iocaine:void 0,i={fullName:l,avatar:e.url,bg:n,isUnassigned:g,isEditable:d(),isIocaine:h,fullNameVisible:!(g&&!u.isAuthenticated())},f=a(p(i))(r),o.html(f)},o.on("click",".user-assigned",function(e){if(e.preventDefault(),d())return r.$apply(function(){return t.$broadcast("assigned-to:add",f.$modelValue)})}),o.on("click",".assign-to-me",function(t){if(t.preventDefault(),d())return f.$modelValue.assigned_to=u.getUser().get("id"),g(u.getUser().get("id"))}),o.on("click",".remove-user",function(t){var r;if(t.preventDefault(),d())return r=s.instant("COMMON.ASSIGNED_TO.CONFIRM_UNASSIGNED"),e.ask(r).then(function(t){return function(t){return t.finish(),f.$modelValue.assigned_to=null,g(null)}}(this))}),r.$on("assigned-to:added",function(t,e,r){if(r.id===f.$modelValue.id)return g(e)}),r.$watch(l.ngModel,function(t){return h(t)}),r.$on("$destroy",function(){return o.off()})},{link:l,require:"ngModel"}},j.directive("tgAssignedTo",["$rootScope","$tgConfirm","$tgRepo","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$translate","$compile","tgCurrentUserService","tgAvatarService",t]),e=function(t,e,r){var n,i;return i=r.get("common/components/block-button.html"),n=function(r,n,i,o){var s;return s=function(){return r.project.my_permissions.indexOf("modify_us")!==-1},r.$watch(i.ngModel,function(t){if(t)return s()&&n.find(".item-block").addClass("editable"),t.is_blocked?(n.find(".item-block").removeClass("is-active"),n.find(".item-unblock").addClass("is-active")):(n.find(".item-block").addClass("is-active"),n.find(".item-unblock").removeClass("is-active"))}),n.on("click",".item-block",function(e){return e.preventDefault(),t.$broadcast("block",o.$modelValue)}),n.on("click",".item-unblock",function(r){var i,s;return r.preventDefault(),i=e().target(n.find(".item-unblock")).start(),s=function(){return i.finish()},t.$broadcast("unblock",o.$modelValue,s)}),r.$on("$destroy",function(){return n.off()})},{link:n,restrict:"EA",require:"ngModel",template:i}},j.directive("tgBlockButton",["$rootScope","$tgLoading","$tgTemplate",e]),o=function(t,e,r,n,i){var o,s;return s=i.get("common/components/delete-button.html"),o=function(i,o,s,a){return s.onDeleteGoToUrl?s.onDeleteTitle?(o.on("click",".button-delete",function(t){var o,u;return u=s.onDeleteTitle,o=a.$modelValue.subject,r.askOnDelete(u,o).then(function(t){return function(t){var o;return o=e.remove(a.$modelValue),o.then(function(){var e;return t.finish(),e=i.$eval(s.onDeleteGoToUrl),n.path(e)}),o.then(null,function(){return t.finish(!1),r.notify("error")})}}(this))}),i.$on("$destroy",function(){return o.off()})):t.error("DeleteButtonDirective requires on-delete-title set in scope."):t.error("DeleteButtonDirective requires on-delete-go-to-url set in scope.")},{link:o,restrict:"EA",require:"ngModel",template:s}},j.directive("tgDeleteButton",["$log","$tgRepo","$tgConfirm","$tgLocation","$tgTemplate",o]),s=function(t,e,r,n,i,o,s,a,u){var c,l,p,f;return f=a.get("common/components/editable-description.html"),l=a.get("common/components/editable-description-msg-edit-mode.html"),p=a.get("common/components/editable-description-msg-read-mode.html"),c=function(e,a,c,f){var d,h,g;return a.find(".edit-description").hide(),a.find(".view-description .edit").hide(),e.$on("object:updated",function(){return a.find(".edit-description").hide(),a.find(".view-description").show()}),h=function(){return e.project.my_permissions.indexOf(c.requiredPerm)!==-1},g=function(e){var n,o;return n=i().target(a.find(".save-container")).start(),o=s.save(function(t){return t.description=e,t}),o.then(function(){return r.notify("success"),t.$broadcast("object:updated"),a.find(".edit-description").hide(),a.find(".view-description").show()}),o.then(null,function(){return r.notify("error")}),o["finally"](function(){return n.finish()})},d=function(){return e.item.revert(),a.find(".edit-description").hide(),a.find(".view-description").show()},a.on("mouseup",".view-description",function(t){var e;if(e=angular.element(t.target),h()&&!e.is("a")&&!o.get().length)return a.find(".edit-description").show(),a.find(".view-description").hide(),a.find("textarea").focus()}),a.on("click","a",function(t){var e,r;if(r=angular.element(t.target),e=r.attr("href"),0===e.indexOf("#"))return t.preventDefault(),$("body").scrollTop($(e).offset().top)}),a.on("click",".save",function(t){var r;return t.preventDefault(),r=e.item.description,g(r)}),a.on("keydown","textarea",function(t){if(27===t.keyCode)return e.$applyAsync(function(){var t,e;return e=u.instant("COMMON.CONFIRM_CLOSE_EDIT_MODE_TITLE"),t=u.instant("COMMON.CONFIRM_CLOSE_EDIT_MODE_MESSAGE"),r.ask(e,null,t).then(function(t){return d(),t.finish()})})}),e.$watch(c.ngModel,function(t){if(t)return e.item=t,h()?(a.find(".view-description .edit").show(),a.find(".view-description .us-content").addClass("editable"),e.noDescriptionMsg=n(l)(e)):e.noDescriptionMsg=n(p)(e)}),e.$on("$destroy",function(){return a.off()})},{link:c,restrict:"EA",require:"ngModel",template:f}},j.directive("tgEditableDescription",["$rootScope","$tgRepo","$tgConfirm","$compile","$tgLoading","$selectedText","$tgQueueModelTransformation","$tgTemplate","$translate",s]),a=function(t,e){var r;return r=function(r,n,i,o){var s,a;return s=function(){return n.find("textarea").is(":visible")&&o.$modelValue.id},a=function(r,n){if(t.validate(r))return e.addAttachment(o.$modelValue.project,o.$modelValue.id,n,r).then(function(t){return I.isImage(t.getIn(["file","name"]))?"!["+t.getIn(["file","name"])+"]("+t.getIn(["file","url"])+")":"["+t.getIn(["file","name"])+"]("+t.getIn(["file","url"])+")"})},n.on("dragover",function(t){var e;return e=n.find("textarea").focus(),!1}),n.on("drop",function(t){var e,r,i,u;if(t.stopPropagation(),t.preventDefault(),s())return e=t.dataTransfer||t.originalEvent&&t.originalEvent.dataTransfer,i=n.find("textarea"),i.addClass("in-progress"),u=o.$modelValue._name,"userstories"===u?u="us":"tasks"===u?u="task":"issues"===u?u="issue":"wiki"===u&&(u="wiki_page"),r=_.map(e.files,function(t){return a(t,u)}),Promise.all(r).then(function(t){return i=n.find("textarea"),$.markItUp({replaceWith:t.join(" ")}),i.removeClass("in-progress")})})},{link:r,restrict:"EA",require:"ngModel"}},j.directive("tgEditableWysiwyg",["tgAttachmentsService","tgAttachmentsFullService",a]),c=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemEpicStatus),k(t,"epicStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemEpicStatus",c),g=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemUsStatus),k(t,"usStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemUsStatus",g),d=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemTaskStatus),k(t,"taskStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemTaskStatus",d),u=function(t,e,r){var n,i;return i=t.get("common/components/list-item-assigned-to-avatar.html",!0),n=function(t,n,o){return k(t,"usersById",function(s){var a,u,c,l;return c=t.$eval(o.tgListitemAssignedto),u={name:e.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED")},l=s[c.assigned_to],a=r.getAvatar(l),u.imgurl=a.url,u.bg=a.bg,l&&(u.name=l.full_name_display),n.html(i(u))})},{link:n}},j.directive("tgListitemAssignedto",["$tgTemplate","$translate","tgAvatarService",u]),l=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemIssueStatus),k(t,"issueStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemIssueStatus",l),h=function(){var t;return t=function(t,e,r){var n;return n=function(t,r){var n,i;return i=t[r.type],n=e.find(".level"),n.css("background-color",i.color),n.attr("title",i.name)},k(t,"issueTypeById",function(e){var i;return i=t.$eval(r.tgListitemType),n(e,i)}),t.$watch(r.tgListitemType,function(e){return n(t.issueTypeById,e)})},{link:t,templateUrl:"common/components/level.html"}},j.directive("tgListitemType",h),p=function(){var t;return t=function(t,e,r){var n;return n=function(t,r){var n,i;return i=t[r.priority],n=e.find(".level"),n.css("background-color",i.color),n.attr("title",i.name)},k(t,"priorityById",function(e){var i;return i=t.$eval(r.tgListitemPriority),n(e,i)}),t.$watch(r.tgListitemPriority,function(e){return n(t.priorityById,e)})},{link:t,templateUrl:"common/components/level.html"}},j.directive("tgListitemPriority",p),f=function(){var t;return t=function(t,e,r){var n;return n=function(t,r){var n,i;return i=t[r.severity],n=e.find(".level"),n.css("background-color",i.color),n.attr("title",i.name)},k(t,"severityById",function(e){var i;return i=t.$eval(r.tgListitemSeverity),n(e,i)}),t.$watch(r.tgListitemSeverity,function(e){return n(t.severityById,e)})},{link:t,templateUrl:"common/components/level.html"}},j.directive("tgListitemSeverity",f),y=function(t){var e,r,n;return n=t.get("common/components/progress-bar.html",!0),r=function(t,e){return t.html(n({percentage:e}))},e=function(t,e,n){var i;return i=angular.element(e),t.$watch(n.tgProgressBar,function(t){return t=_.max([0,t]),t=_.min([100,t]),r(e,t)}),t.$on("$destroy",function(){return e.off()})},{link:e}},j.directive("tgProgressBar",["$tgTemplate",y]),v=function(t){var e;return e=function(t,e,r){return r.$observe("i18nSectionName",function(e){return t.sectionName=e}),t.$on("$destroy",function(){return e.off()})},{link:e,templateUrl:"common/components/main-title.html",scope:{projectName:"=projectName"}}},j.directive("tgMainTitle",["$translate",v])}.call(this),function(){var t,e,r,n,i,o,s,a,u=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;s=this.taiga,a=this.taiga.timeout,n=this.taiga.cancelTimeout,i=this.taiga.debounce,r=this.taiga.bindMethods,e={success:{title:"NOTIFICATION.OK",message:"NOTIFICATION.SAVED"},error:{title:"NOTIFICATION.WARNING",message:"NOTIFICATION.WARNING_TEXT"},"light-error":{title:"NOTIFICATION.WARNING",message:"NOTIFICATION.WARNING_TEXT"}},t=function(t){function o(t,e,n,i){this.q=t,this.lightboxService=e,this.loading=n,this.translate=i,r(this)}return u(o,t),o.$inject=["$q","lightboxService","$tgLoading","$translate"],o.prototype.hide=function(t){if(t)return this.lightboxService.close(t),t.off(".confirm-dialog")},o.prototype.ask=function(t,e,r,n){var o,s;return null==n&&(n=".lightbox-generic-ask"),o=this.q.defer(),s=angular.element(n),t&&s.find(".title").text(t),e&&s.find(".subtitle").text(e),r&&s.find(".message").text(r),s.on("click.confirm-dialog",".button-green",i(2e3,function(t){return function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=t.loading().target(n).start(),o.resolve({finish:function(e){if(null==e&&(e=!0),r.finish(),e)return t.hide(s)}})}}(this))),s.on("click.confirm-dialog",".button-red",function(t){return function(e){return e.preventDefault(),o.reject(),t.hide(s)}}(this)),this.lightboxService.open(s),o.promise},o.prototype.askOnDelete=function(t,e){return this.ask(t,this.translate.instant("NOTIFICATION.ASK_DELETE"),e)},o.prototype.askChoice=function(t,e,r,n,o,s){var a,u,c;return null==s&&(s=".lightbox-ask-choice"),u=this.q.defer(),c=angular.element(s),c.find(".title").text(t),c.find(".subtitle").text(e),n?c.find(".replacement").text(n):c.find(".replacement").remove(),o?c.find(".warning").text(o):c.find(".warning").remove(),a=c.find(".choices"),a.html(""),_.each(r,function(t,e){return t=_.escape(t),a.append(angular.element(""))}),c.on("click.confirm-dialog","a.button-green",i(2e3,function(t){return function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=t.loading().target(n).start(),u.resolve({selected:a.val(),finish:function(e){if(null==e&&(e=!0),r.finish(),e)return t.hide(c)}})}}(this))),c.on("click.confirm-dialog",".button-red",function(t){return function(e){return e.preventDefault(),u.reject(),t.hide(c)}}(this)),this.lightboxService.open(c),u.promise},o.prototype.error=function(t){var e,r;return e=this.q.defer(),r=angular.element(".lightbox-generic-error"),r.find(".title").html(t),r.on("click.confirm-dialog",".button-green",function(t){return function(n){return n.preventDefault(),e.resolve(),t.hide(r)}}(this)),r.on("click.confirm-dialog",".close",function(t){return function(n){return n.preventDefault(),e.resolve(),t.hide(r)}}(this)),this.lightboxService.open(r),e.promise},o.prototype.success=function(t,e,r){var n,i,o,a,u;return n=this.q.defer(),o=angular.element(".lightbox-generic-success"),o.find("img").remove(),o.find("svg").remove(),r&&("img"===r.type?i=$("").addClass("lb-icon").attr("src",r.name):"svg"===r.type&&(i=document.createElement("div"),s.addClass(i,"icon"),s.addClass(i,r.name),s.addClass(i,"lb-icon"),a=document.createElementNS("http://www.w3.org/2000/svg","svg"),u=document.createElementNS("http://www.w3.org/2000/svg","use"),u.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+r.name),i.appendChild(a).appendChild(u)),i&&o.find("section").prepend(i)),t&&o.find(".title").html(t),e&&o.find(".message").html(e),o.on("click.confirm-dialog",".button-green",function(t){return function(e){return e.preventDefault(),n.resolve(),t.hide(o)}}(this)),o.on("click.confirm-dialog",".close",function(t){return function(e){return e.preventDefault(),n.resolve(),t.hide(o)}}(this)),this.lightboxService.open(o),n.promise},o.prototype.loader=function(t,e){var r;return r=angular.element(".lightbox-generic-loading"),t&&r.find(".title").html(t),e&&r.find(".message").html(e),{start:function(t){return function(){return t.lightboxService.open(r)}}(this),stop:function(t){return function(){return t.lightboxService.close(r)}}(this),update:function(t){return function(t,e,n,i){return e&&r.find(".title").html(e),n&&r.find(".message").html(n),i?(r.find(".spin").addClass("hidden"),r.find(".progress-bar-wrapper").removeClass("hidden"),r.find(".progress-bar-wrapper > .bar").width(i+"%"),r.find(".progress-bar-wrapper > span").html(i+"%").css("left",i-9+"%")):(r.find(".spin").removeClass("hidden"),r.find(".progress-bar-wrapper").addClass("hidden"))}}(this)}},o.prototype.notify=function(t,r,i,o){var s,u,c;if(c=".notification-message-"+t,u=angular.element(c),!u.hasClass("active"))return i?u.find("h4").html(i):u.find("h4").html(this.translate.instant(e[t].title)),r?u.find("p").html(r):u.find("p").html(this.translate.instant(e[t].message)),s=angular.element("body"),s.find(".notification-message .notification-light").removeClass("active").addClass("inactive"), s.find(c).removeClass("inactive").addClass("active"),this.tsem&&n(this.tsem),o||(o="error"===t||"light-error"===t?3500:1500),this.tsem=a(o,function(t){return function(){return s.find(c).removeClass("active").addClass("inactive").one("animationend",function(){return $(this).removeClass("inactive")}),delete t.tsem}}(this)),u.on("click",".icon-close, .close",function(t){return function(t){return s.find(c).removeClass("active").addClass("inactive")}}(this))},o}(s.Service),o=angular.module("taigaCommon"),o.service("$tgConfirm",t)}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h=function(t,e){function r(){this.constructor=t}for(var n in e)g.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},g={}.hasOwnProperty;d=this.taiga,u=this.taiga.bindMethods,c=this.taiga.bindOnce,l=this.taiga.debounce,p=d.generateHash,f=angular.module("taigaCommon"),o="text",i="multiline",n="date",a="url",s=[{key:o,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_TEXT"},{key:i,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_MULTI"},{key:n,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_DATE"},{key:a,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_URL"}],e=function(t){function e(t,e,r,n,i,o){this.scope=t,this.rootscope=e,this.repo=r,this.rs=n,this.confirm=i,this.q=o,u(this),this.type=null,this.objectId=null,this.projectId=null,this.customAttributes=[],this.customAttributesValues=null}return h(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgResources","$tgConfirm","$q"],e.prototype.initialize=function(t,e){return this.project=this.scope.project,this.type=t,this.objectId=e,this.projectId=this.scope.projectId},e.prototype.loadCustomAttributesValues=function(){return this.objectId?this.rs.customAttributesValues[this.type].get(this.objectId).then(function(t){return function(e){return t.customAttributes=t.project[t.type+"_custom_attributes"],t.customAttributesValues=e,e}}(this)):this.customAttributesValues},e.prototype.getAttributeValue=function(t){var e;return e=_.clone(t,!1),e.value=this.customAttributesValues.attributes_values[t.id],e},e.prototype.updateAttributeValue=function(t){var e,r,n;return n=function(t){return function(){return t.rootscope.$broadcast("custom-attributes-values:edit")}}(this),r=function(t){return function(e){return t.confirm.notify("error"),t.q.reject()}}(this),e=_.clone(this.customAttributesValues.attributes_values,!0),e[t.id]=t.value,this.customAttributesValues.attributes_values=e,this.customAttributesValues.id=this.objectId,this.repo.save(this.customAttributesValues).then(n,r)},e}(d.Controller),r=function(t,r){var n,i,o,s;return o=t.get("custom-attributes/custom-attributes-values.html",!0),n=function(t){return p(["custom-attributes-collapsed",t])},i=function(t,e,i,o){var s,a,u;return s=o[0],a=o[1],u=n(i.type),t.collapsed=r.get(u)||!1,c(t,i.ngModel,function(t){return s.initialize(i.type,t.id),s.loadCustomAttributesValues()}),t.toggleCollapse=function(){return t.collapsed=!t.collapsed,r.set(u,t.collapsed)},t.$on("$destroy",function(){return e.off()})},s=function(t,e){return o({requiredEditionPerm:e.requiredEditionPerm})},{require:["tgCustomAttributesValues","ngModel"],controller:e,controllerAs:"ctrl",restrict:"AE",scope:!0,link:i,template:s}},f.directive("tgCustomAttributesValues",["$tgTemplate","$tgStorage","$translate",r]),t=function(t,e,r,i,o){var s,a,u;return a=t.get("custom-attributes/custom-attribute-value.html",!0),u=t.get("custom-attributes/custom-attribute-value-edit.html",!0),s=function(t,s,c,p){var f,d,h,g,m,v;return h=i.instant("COMMON.PICKERDATE.FORMAT"),g=function(e,i){var c,l,p,f,g;return null==i&&(i=!1),g=e.type===n&&e.value?moment(e.value,"YYYY-MM-DD").format(h):e.value,p=d(),c={id:e.id,name:e.name,description:e.description,value:g,isEditable:p,type:e.type},!p||!i&&g?(f=a(c),f=r(f)(t),s.html(f)):(f=u(c),f=r(f)(t),s.html(f),e.type===n?(l=o.get(),_.merge(l,{field:s.find("input[name=value]")[0],onSelect:function(t){return function(t){var e;return e=t}}(this),onOpen:function(t){return function(){if("undefined"!=typeof selectedDate&&null!==selectedDate)return s.picker.setDate(selectedDate)}}(this)}),s.picker=new Pikaday(l)):void 0)},d=function(){var e,r;return e=t.project.my_permissions,r=c.requiredEditionPerm,e.indexOf(r)>-1},v=l(2e3,function(e){return function(e){var r,i;if(e.preventDefault(),r=s.find("form").checksley(),r.validate())return i=s.find("input[name=value], textarea[name='value']"),f.value=i.val(),f.type===n&&moment(f.value,h).isValid()&&(f.value=moment(f.value,h).format("YYYY-MM-DD")),t.$apply(function(){return p.updateAttributeValue(f).then(function(){return g(f,!1)})})}}(this)),m=function(){return s.find("input[name='value'], textarea[name='value']").focus().select()},f=t.$eval(c.tgCustomAttributeValue),g(f),s.on("click",".js-value-view-mode span a",function(t){return t.stopPropagation()}),s.on("click",".js-value-view-mode",function(){if(d()&&!e.get().length)return g(f,!0),m()}),s.on("click",".js-edit-description",function(t){return t.preventDefault(),g(f,!0),m()}),s.on("keyup","input[name=value], textarea[name='value']",function(t){return 13===t.keyCode&&"textarea"!==t.currentTarget.type?v(t):27===t.keyCode?g(f,!1):void 0}),s.on("submit","form",v),s.on("click",".js-save-description",v),t.$on("$destroy",function(){return s.off()})},{link:s,require:"^tgCustomAttributesValues",restrict:"AE"}},f.directive("tgCustomAttributeValue",["$tgTemplate","$selectedText","$compile","$translate","tgDatePickerConfigService",t])}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}};o=this.taiga,n=this.taiga.groupBy,i=angular.module("taigaCommon"),e=function(t,e,r,n,i){var o;return o=function(e,r,o,s){return e.$watch(o.ngModel,function(o){var a;if(o)return a=t.create(r,o,e.project),a.onSelectedPointForRole=function(t,r,n){return o.points=n,a.render(),e.$apply(function(){return s.$setViewValue(o)})},a.render=function(){var t,r,o,s;return t={totalPoints:this.calculateTotalPoints(),roles:this.calculateRoles(),editable:this.isEditable,loading:!1},o="common/estimation/us-estimation-points-per-role.html",s=n.get(o,!0),r=s(t),r=i(r)(e),this.$el.html(r)},a.render()}),e.$on("$destroy",function(){return r.off()})},{link:o,restrict:"EA",require:"ngModel"}},i.directive("tgLbUsEstimation",["$tgEstimationsService","$rootScope","$tgRepo","$tgTemplate","$compile",e]),r=function(t,e,r,n,i,o,s){var a;return a=function(r,a,u,c){var l;return l=function(t){var e,r;return r=o.save(function(e){return function(e){return e.points=t,e}}(this)),e=function(t){return function(){return s.notify("error")}}(this),r.then(null,e)},r.$watchCollection(function(){return c.$modelValue&&c.$modelValue.points},function(){var o,s;if(s=c.$modelValue)return o=t.create(a,s,r.project),o.onSelectedPointForRole=function(t,r,n){return o.loading=t,o.render(),l(n).then(function(){return o.loading=!1,e.$broadcast("object:updated"),o.render()})},o.render=function(){var t,e,s,a;return t={totalPoints:this.calculateTotalPoints(),roles:this.calculateRoles(),editable:this.isEditable,loading:o.loading},s="common/estimation/us-estimation-points-per-role.html",a=n.get(s,!0),e=a(t),e=i(e)(r),this.$el.html(e)},o.render()}),r.$on("$destroy",function(){return a.off()})},{link:a,restrict:"EA",require:"ngModel"}},i.directive("tgUsEstimation",["$tgEstimationsService","$rootScope","$tgRepo","$tgTemplate","$compile","$tgQueueModelTransformation","$tgConfirm",r]),t=function(t,e,r,i,o){var a,u,c;return c=t.get("common/estimation/us-estimation-points.html",!0),a=function(){function t(t,e,r){this.$el=t,this.us=e,this.project=r,this.bindClickEvents=s(this.bindClickEvents,this),this.isEditable=this.project.my_permissions.indexOf("modify_us")!==-1,this.roles=this.project.roles,this.points=this.project.points,this.loading=!1,this.pointsById=n(this.points,function(t){return t.id}),this.onSelectedPointForRole=function(t,e){},this.render=function(){}}return t.prototype.save=function(t,n){var s;return s=i.defer(),o.add(function(t){return function(){var n,i;return i=function(){return s.resolve(),t.render()},n=function(){return r.notify("error"),t.us.revert(),t.render(),s.reject()},e.save(t.us).then(i,n)}}(this)),s.promise},t.prototype.calculateTotalPoints=function(){var t,e;return e=_.map(this.us.points,function(t){return function(e,r){var n;return null!=(n=t.pointsById[e])?n.value:void 0}}(this)),0===e.length?"?":(t=_.filter(e,function(t){return null!=t}),0===t.length?"?":_.reduce(t,function(t,e){return t+e}))},t.prototype.calculateRoles=function(){var t,e;return t=_.filter(this.project.roles,"computable"),e=_.map(t,function(t){return function(e){var r,n;return r=t.us.points[e.id],n=t.pointsById[r],e=_.clone(e,!0),e.points=null!=n&&null!=n.name?n.name:"?",e}}(this))},t.prototype.bindClickEvents=function(){return this.$el.on("click",".total.clickable",function(t){return function(e){var r,n;return e.preventDefault(),e.stopPropagation(),n=angular.element(e.currentTarget),r=n.data("role-id"),t.renderPointsSelector(r,n),n.siblings().removeClass("active"),n.addClass("active")}}(this)),this.$el.on("click",".point",function(t){return function(e){var r,n,i,o;return e.preventDefault(),e.stopPropagation(),o=angular.element(e.currentTarget),i=o.data("role-id"),r=o.data("point-id"),t.$el.find(".popover").popover().close(),n=_.clone(t.us.points,!0),n[i]=r,t.onSelectedPointForRole(i,r,n)}}(this))},t.prototype.renderPointsSelector=function(t,e){var r,n,i,o,s;if(o=_.map(this.points,function(e){return function(r){return r=_.clone(r,!0),r.selected=e.us.points[t]!==r.id,r}}(this)),i=5,r=_.some(o,function(t){return function(t){return t.name.length>i}}(this)),n=c({points:o,roleId:t,horizontal:r}),this.$el.find(".popover").popover().close(),this.$el.find(".pop-points-open").remove(),null!=e?this.$el.find(e).append(n):this.$el.append(n),this.$el.find(".pop-points-open").popover().open(function(){return $(this).removeClass("active").closest("li").removeClass("active")}),this.$el.find(".pop-points-open").show(),s=this.$el.find(".pop-points-open"),s.offset().top+s.height()>document.body.clientHeight)return s.addClass("pop-bottom")},t}(),u=function(t,e,r){var n;return t.unbind("click"),n=new a(t,e,r),n.isEditable&&n.bindClickEvents(),n},{create:u}},i.factory("$tgEstimationsService",["$tgTemplate","$tgRepo","$tgConfirm","$q","$tgQqueue",t])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l;a=this.taiga,n=angular.module("taigaCommon"),r=function(){return function(t,e){return t===[null,void 0]?e:t}},n.filter("default",r),l=function(t){return function(e){return e?t.instant("COMMON.YES"):t.instant("COMMON.NO")}},n.filter("yesNo",["$translate",l]),c=function(){return a.unslugify},n.filter("unslugify",c),i=function(){return function(t,e){return t?moment(t).format(e):""}},n.filter("momentFormat",i),o=function(){return function(t,e){return t?moment(t).fromNow(e||!1):""}},n.filter("momentFromNow",o),s=function(t){return function(){return t.taiga.sizeFormat}}(this),n.filter("sizeFormat",s),u=function(){var t,e;return e=function(t){return t.toJS()},t=_.memoize(e),function(e){return e instanceof Immutable.List?t(e):e}},n.filter("toMutable",u),t=function(t){return function(e,r){var n;return(null!=r?r.startsWith("#"):void 0)?(n=r.substr(1),_.filter(e,function(t){return function(t){return String(t.ref).startsWith(n)}}(this))):t(e,r)}},n.filter("byRef",["filterFilter",t]),e=function(){return function(t,e){var r,n,i,o,s,a,u,c;for(t=new String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),e=e||0,a="#",n=0,i=0,r=0,c=255,u=[0,1,2],o=0,s=u.length;o=a.get("max_memberships_private_projects"),i&&n?(e="private-space-members",r=a.get("max_memberships_private_projects")):i?e="private-space":n&&(e="private-members",r=a.get("max_memberships_private_projects"))):(o=!s.canCreatePublicProjects().valid,n=null!==a.get("max_memberships_public_projects")&&t.headers.memberships>=a.get("max_memberships_public_projects"),o&&n?(e="public-space-members",r=a.get("max_memberships_public_projects")):o?e="public-space":n&&(e="public-members",r=a.get("max_memberships_public_projects"))),{key:e,values:{max_memberships:r,members:t.headers.memberships}})},c.on("click",".import-project-button",function(t){return t.preventDefault(),c.find("input.import-file").val(""),c.find("input.import-file").trigger("click")}),c.on("change","input.import-file",function(u){var c,l,f,d;if(u.preventDefault(),c=u.target.files[0])return l=e.loader(i.instant("PROJECT.IMPORT.UPLOADING_FILE")),d=function(t){return s.loadProjects().then(function(){var o,s,a,u;return l.stop(),202===t.status?(u=i.instant("PROJECT.IMPORT.ASYNC_IN_PROGRESS_TITLE"),s=i.instant("PROJECT.IMPORT.ASYNC_IN_PROGRESS_MESSAGE"),e.success(u,s)):(o={project:t.data.slug},r.path(n.resolve("project-admin-project-profile-details",o)),a=i.instant("PROJECT.IMPORT.SYNC_SUCCESS"),e.notify("success",a))})},f=function(t){return a.refresh().then(function(){var r,n,s;return s=p(t),l.stop(),s?o.create("tg-lb-import-error",{"class":"lightbox lightbox-import-error"},s):(r=i.instant("PROJECT.IMPORT.ERROR"),429===t.status?r=i.instant("PROJECT.IMPORT.ERROR_TOO_MANY_REQUEST"):(null!=(n=t.data)?n._error_message:void 0)&&(r=i.instant("PROJECT.IMPORT.ERROR_MESSAGE",{error_message:t.data._error_message})),e.notify("error",r))})},l.start(),t.projects["import"](c,l.update).then(d,f)})},{link:u}},r.directive("tgImportProjectButton",["$tgResources","$tgConfirm","$location","$tgNavUrls","$translate","tgLightboxFactory","tgCurrentUserService","$tgAuth",t]),e=function(t){var e;return e=function(e,r,n){return t.open(r),e.close=function(){t.close(r)}},{templateUrl:"common/lightbox/lightbox-import-error.html",link:e}},e.$inject=["lightboxService"],r.directive("tgLbImportError",e)}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g,m=function(t,e){function r(){this.constructor=t}for(var n in e)v.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},v={}.hasOwnProperty,y=[].indexOf||function(t){for(var e=0,r=this.length;e5},n=d(r),n=i(n)(t),s.find(".ticket-watchers").html(n)},u=function(){return r.stop(),e.close(s)},t.$on("watcher:add",function(t,n){var i;return f=n,i=c(),l(i),e.open(s).then(function(){return s.find("input").focus(),r.init(s)})}),t.$watch("usersSearch",function(t){var e;if(null!=t)return e=c(t),l(e),s.find("input").focus()}),s.on("click",".user-list-single",p(200,function(e){var r;return u(),e.preventDefault(),r=angular.element(e.currentTarget),t.$apply(function(){return t.usersSearch=null,t.$broadcast("watcher:added",r.data("user-id"))})})),s.on("click",".close",function(e){return e.preventDefault(),u(),t.$apply(function(){return t.usersSearch=null})}),t.$on("$destroy",function(){return s.off()})},{templateUrl:"common/lightbox/lightbox-users.html",link:s}},f.directive("tgLbWatchers",["$tgRepo","lightboxService","lightboxKeyboardNavigationService","$tgTemplate","$compile","tgAvatarService",c]),a=function(t,e,r){var n;return n=function(e,r,n){return t.open(r)},{templateUrl:"common/lightbox/lightbox-leave-project-warning.html",link:n,scope:!0}},f.directive("tgLightboxLeaveProjectWarning",["lightboxService",a])}.call(this),function(){var t,e,r,n,i,o;i=this.taiga,n=this.taiga.sizeFormat,o=this.taiga.timeout,r=angular.module("taigaCommon"),e=function(t,e){var r;return r=function(e,r,n){return t.onStart(function(){return $(document.body).addClass("loader-active"),r.addClass("active")}),t.onEnd(function(){return $(document.body).removeClass("loader-active"),r.removeClass("active")})},{link:r}},r.directive("tgLoader",["tgLoader","$rootScope",e]),t=function(t){var e,r,n,i,s,a,u,c;return r={minTime:300},i=!1,c=0,a=0,n=0,s=function(e){var s,u,l;return null==e&&(e=!1),c&&(l=0,e||(u=(new Date).getTime(),s=u-c,s",function(){var r;return r={settings:{target:null,scope:null,classes:[],timeout:0,template:null},target:function(t){return r.settings.target=t,r},scope:function(t){return r.settings.scope=t,r},template:function(t){return r.settings.template=t,r},removeClasses:function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],r.settings.classes=t,r},timeout:function(t){return r.settings.timeout=t,r},start:function(){var t,n;return t=r.settings.target,r.settings.classes.map(function(e){return t.removeClass(e)}),t.hasClass("loading")||r.settings.template||(r.settings.template=t.html()),n=setTimeout(function(){if(!t.hasClass("loading"))return t.addClass("loading"),t.html(e)},r.settings.timeout),r.settings.timeoutId=n,r},finish:function(){var e,n,i;return n=r.settings.target,i=r.settings.timeoutId,i&&(clearTimeout(i),e=r.settings.classes,e.map(function(t){return r.settings.target.addClass(t)}),n.html(r.settings.template),n.removeClass("loading"),r.settings.scope&&t(n.contents())(r.settings.scope)),r}}}},e.$inject=["$compile"],r.factory("$tgLoading",e),t=function(t){var e;return e=function(e,r,n){var i,o;return i=null,o=r.html(),e.$watch(n.tgLoading,function(n){return function(n){return n?i=t().target(r).timeout(100).template(o).scope(e).start():i?i.finish():void 0}}(this))},{priority:99999,link:e}},r.directive("tgLoading",["$tgLoading",t])}.call(this),function(){var t,e,r,n,i,o;o=this.taiga,r=this.taiga.bindOnce,n=this.taiga.debounce,i=angular.module("taigaCommon"),e=function(t,e){var i,o;return o=e.get("common/popover/popover-us-status.html",!0),i=function(e,i,s){var a,u,c;return a=i.controller(),u=function(t){var r,n,o;if(o=i.find(".us-status"),n=i.find(".us-status .us-status-bind"),r=e.usStatusById,r[t.status])return n.text(r[t.status].name),o.css("color",r[t.status].color)},i.on("click",".us-status",function(t){return t.preventDefault(),t.stopPropagation(),i.find(".pop-status").popover().open()}),i.on("click",".status",n(2e3,function(r){var n,o;return r.preventDefault(),r.stopPropagation(),n=angular.element(r.currentTarget),o=e.$eval(s.tgUsStatus),o.status=n.data("status-id"),u(o),i.find(".pop-status").popover().close(),e.$apply(function(){return t.save(o).then(function(){return e.$eval(s.onUpdate)})})})),e.$on("userstories:loaded",function(){return u(e.$eval(s.tgUsStatus))}),e.$on("$destroy",function(){return i.off()}),c=e.$eval(s.tgUsStatus),u(c),r(e,"project",function(t){var r;if(r=o({statuses:t.us_statuses}),i.append(r),e.project.my_permissions.indexOf("modify_us")===-1)return i.unbind("click"),i.find("a").addClass("not-clickable")})},{link:i}},i.directive("tgUsStatus",["$tgRepo","$tgTemplate",e]),t=function(t,e){var r,i,s;return i=e.get("common/popover/popover-related-task-status.html",!0),s=function(t,e,r){var n,i;if(i=t.find(".us-status"),n=t.find(".task-status .task-status-bind"), r[e.status])return n.text(r[e.status].name),i.css("color",r[e.status].color)},r=function(e,r,a){var u,c,l,p;return u=r.controller(),p=e.$eval(a.tgRelatedTaskStatus),l=e.$eval(a.notAutoSave),c=!l,r.on("click",".task-status",function(t){return t.preventDefault(),t.stopPropagation(),r.find(".pop-status").popover().open()}),r.on("click",".status",n(2e3,function(n){var i;if(n.preventDefault(),n.stopPropagation(),i=angular.element(n.currentTarget),p.status=i.data("status-id"),r.find(".pop-status").popover().close(),s(r,p,e.taskStatusById),c)return e.$apply(function(){return t.save(p).then(function(){return e.$eval(a.onUpdate),e.$emit("related-tasks:status-changed")})})})),e.$watch(a.tgRelatedTaskStatus,function(){return p=e.$eval(a.tgRelatedTaskStatus),s(r,p,e.taskStatusById)}),o.bindOnce(e,"project",function(t){if(r.append(i({statuses:t.task_statuses})),s(r,p,e.taskStatusById),t.my_permissions.indexOf("modify_task")===-1)return r.unbind("click"),r.find("a").addClass("not-clickable")}),e.$on("$destroy",function(){return r.off()})},{link:r}},i.directive("tgRelatedTaskStatus",["$tgRepo","$tgTemplate",t]),$.fn.popover=function(){var t,e,r,n,i,o;return t=this,i=function(e){return function(){var e,r,n,i,o,s,a,u,c,l;return t.css({display:"block",visibility:"hidden"}),i=$(window).scrollTop(),e=i+$(window).height(),o=$(window).width(),n=o,r=0,c=t.offset().top,s=c+t.height(),l=t.width(),a=t.offset().left,u=t.offset().left+l,t.css({display:"none",visibility:"visible"}),s<=e&&c>=i&&a>=r&&u<=n}}(this),n=function(e){return function(e){return e&&e.call(t),t.fadeOut(function(){return t.removeClass("active").removeClass("fix")}),t.off("popup:close")}}(this),r=function(t){return function(){return $(".popover.active").each(function(){return $(this).trigger("popup:close")})}}(this),o=function(o){return function(o){return t.hasClass("active")?e():(r(),i()||t.addClass("fix"),t.fadeIn(function(){return t.addClass("active"),$(document.body).off("popover"),$(document.body).one("click.popover",function(){return r()})}),t.on("popup:close",function(t){return n(o)}))}}(this),e=function(e){return function(){return t.trigger("popup:close")}}(this),{open:o,close:e,closeAll:r}}}.call(this),function(){var t,e,r;r=this.taiga,e=angular.module("taigaCommon"),t=function(t,e){var r;return this.config=e,r=this.config.get("ravenConfig",null),r?(t.debug("Using the RavenJS exception handler."),Raven.config(r).install(),function(e,r){return t.error.apply(t,arguments),Raven.captureException(e)}):(t.debug("Using the default logging exception handler."),function(e,r){return t.error.apply(t,arguments)})},e.factory("$exceptionHandler",["$log","$tgConfig",t])}.call(this),function(){var e,r,n,i,o,s,a,u=[].indexOf||function(t){for(var e=0,r=this.length;e\n \n style="border-left: 5px solid <%- tag[1] %>"\n <% } %>\n title="<%- tag[0] %>"><%- tag[0] %>\n<% }) %>'),kanban:_.template('<% _.each(tags, function(tag) { %>\n \n style="border-color: <%- tag[1] %>"\n <% } %>\n title="<%- tag[0] %>" />\n<% }) %>'),taskboard:_.template('<% _.each(tags, function(tag) { %>\n \n style="border-color: <%- tag[1] %>"\n <% } %>\n title="<%- tag[0] %>" />\n<% }) %>')},t=function(t,r,n,i){var o;return o=function(t){var i,o;return o=e[n.tgColorizeTagsType],i=o({tags:t}),r.html(i)},t.$watch(n.tgColorizeTags,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:t}},o.directive("tgColorizeTags",e),r=function(e,r,n){var o,s,c,l,p;return s=13,o=188,p=r.get("common/tag/lb-tag-line-tags.html",!0),c=null,l=function(e,r,o,l){var f,d,h,g,m,v,y,b;return b=_.has(o,"withoutColors"),g=function(i,o){var s,a,u;return null==o&&(o=[]),s=b?null:o[t],a={tags:_.map(i,function(t){return{name:t,style:s?"border-left: 5px solid "+s:""}})},u=n(p(a))(e),r.find(".tags-container").html(u)},y=function(){return r.find(".save").removeClass("hidden")},h=function(){return r.find(".save").addClass("hidden")},m=function(){return r.find("input").val(""),c.close()},f=function(t){var r;if(t=a(t.toLowerCase()),0!==t.length)return r=_.clone(l.$modelValue,!1),null==r&&(r=[]),u.call(r,t)<0&&r.push(t),e.$apply(function(){return l.$setViewValue(r)}),h()},d=function(t){var r;if(t=a(t.toLowerCase()),0!==t.length)return r=_.clone(l.$modelValue,!1),r=_.pull(r,t),e.$apply(function(){return l.$setViewValue(r)})},v=function(){var t;return t=r.find("input").val(),f(t),m()},r.on("keypress","input",function(t){var e;return e=angular.element(t.currentTarget),t.keyCode===s?(t.preventDefault(),v()):","===String.fromCharCode(t.keyCode)?(t.preventDefault(),v()):e.val().length?y():h()}),r.on("click",".save",function(t){return t.preventDefault(),v()}),r.on("click",".remove-tag",function(t){var e,r;return t.preventDefault(),e=angular.element(t.currentTarget),r=e.siblings(".tag-name").text(),d(r)}),i(e,"project",function(t){var e;return e=r.find("input"),c=new Awesomplete(e[0],{list:_.keys(t.tags_colors)}),e.on("awesomplete-selectcomplete",function(){return f(e.val()),e.val("")})}),e.$watch(o.ngModel,function(t){var r,n;return n=(null!=(r=e.project)?r.tags_colors:void 0)||[],g(t,n)}),e.$on("$destroy",function(){return r.off()})},{link:l,require:"ngModel",templateUrl:"common/tag/lb-tag-line.html"}},o.directive("tgLbTagLine",["$tgResources","$tgTemplate","$compile",r])}.call(this),function(){var t,e,r,n,i=[].indexOf||function(t){for(var e=0,r=this.length;e",{"class":"preview"}),g=function(){return m.parents(".markdown").find(".preview").remove(),m.parents(".markItUp").show()},o.$on("markdown-editor:submit",function(){return g()}),h=null,S=!1,_=function(){var t,n;if(!S)return S=!0,n=m.parents(".markdown"),t=m.parents(".markItUp"),e.mdrender.render(o.project.id,f.$modelValue).then(function(e){var i,a;return i=l({data:e.data}),i=s(i)(o),n.append(i),t.hide(),S=!1,a=m.closest(".markdown"),a.on("mouseup.preview",".preview",function(t){var e;if(t.preventDefault(),e=angular.element(t.target),e.is("a")||!r.get().length)return a.off(".preview"),g()})})},j=function(t,e){var r,n,i,o;return t.createTextRange?(n=t.createTextRange(),n.move("character",e),n.select()):t.selectionStart&&(t.focus(),t.setSelectionRange(e,e)),o=t.value.split("\n").length,r=t.value.slice(0,+(e-1)+1||9e9).split("\n").length,i=r/o,c.scrollTop(i*c[0].scrollHeight-c.height()/2)},d=function(t,e,r){var n,i,o,s,a,u;for(u=t.value.split("\n"),r?u[e]=r+u[e]:u[e]="",n=0,o=i=0,s=u.length;i>>)/gi,n=0,e=[];n=r.exec(t.textarea.value);)e.push(n.index);return t.donotparse=e},E=function(t){var e,r,n,o,s,a,u,c;for(o=/<<>>/gi,e=0;;){if(s=o.exec(t.textarea.value),!s)break;if(n=s.index,i.call(t.donotparse,n)<0){e=s.index;break}}return c=t.textarea.value,u=c.substring(a,e).replace("<<<","").replace(">>>",""),u=u.replace("(","%28").replace(")","%29"),u=u.replace("[","%5B").replace("]","%5D"),c=c.substring(0,a)+u+c.substring(e+3,c.length),t.textarea.value=c,t.donotparse=void 0}},v=function(t,e){var r,n,i,o,s;for(r="",o=$.trim(t.selection||t.placeHolder).length,n=i=0,s=o-1;0<=s?i<=s:i>=s;n=0<=s?++i:--i)r+=e;return"\n"+r+"\n"},k=function(){var t;return t={nameSpace:"markdown",onShiftEnter:{keepDefault:!1,openWith:"\n\n"},onEnter:{keepDefault:!1,replaceWith:function(){if(!$(".textcomplete-dropdown").is(":visible"))return"\n"},afterInsert:function(t){var e,r,n,i,o,s,a,u,c;if(i=t.textarea.value.split("\n"),e=t.caretPosition>0?t.textarea.value.slice(0,+(t.caretPosition-1)+1||9e9).split("\n").length:1,a=t.textarea.value.slice(t.caretPosition).split("\n")[0],n=i[e-1],s=n.match(/^(\s*- ).*/),s&&(r=n.match(/^(\s*)\-\s$/),r?(u=e-1,c=null):(u=e,c=""+s[1]),o=d(t.textarea,u,c)),s=n.match(/^(\s*\* ).*/),s&&(r=n.match(/^(\s*\* )$/),r?(u=e-1,c=null):(u=e,c=""+s[1]),o=d(t.textarea,u,c)),s=n.match(/^(\s*)(\d+)\.\s/),s&&(r=n.match(/^(\s*)(\d+)\.\s$/),r?(u=e-1,c=null):(u=e,c=s[1]+(parseInt(s[2],10)+1)+". "),o=d(t.textarea,u,c)),o)return j(t.textarea,o)}},markupSet:[{name:a.instant("COMMON.WYSIWYG.H1_BUTTON"),key:"1",placeHolder:a.instant("COMMON.WYSIWYG.H1_SAMPLE_TEXT"),closeWith:function(t){return v(t,"=")}},{name:a.instant("COMMON.WYSIWYG.H2_BUTTON"),key:"2",placeHolder:a.instant("COMMON.WYSIWYG.H2_SAMPLE_TEXT"),closeWith:function(t){return v(t,"-")}},{name:a.instant("COMMON.WYSIWYG.H3_BUTTON"),key:"3",openWith:"### ",placeHolder:a.instant("COMMON.WYSIWYG.H3_SAMPLE_TEXT")},{separator:"---------------"},{name:a.instant("COMMON.WYSIWYG.BOLD_BUTTON"),key:"B",openWith:"**",closeWith:"**",placeHolder:a.instant("COMMON.WYSIWYG.BOLD_BUTTON_SAMPLE_TEXT")},{name:a.instant("COMMON.WYSIWYG.ITALIC_SAMPLE_TEXT"),key:"I",openWith:"_",closeWith:"_",placeHolder:a.instant("COMMON.WYSIWYG.ITALIC_SAMPLE_TEXT")},{name:a.instant("COMMON.WYSIWYG.STRIKE_BUTTON"),key:"S",openWith:"~~",closeWith:"~~",placeHolder:a.instant("COMMON.WYSIWYG.STRIKE_SAMPLE_TEXT")},{separator:"---------------"},{name:a.instant("COMMON.WYSIWYG.BULLETED_LIST_BUTTON"),openWith:"- ",placeHolder:a.instant("COMMON.WYSIWYG.BULLETED_LIST_SAMPLE_TEXT")},{name:a.instant("COMMON.WYSIWYG.NUMERIC_LIST_BUTTON"),openWith:function(t){return t.line+". "},placeHolder:a.instant("COMMON.WYSIWYG.NUMERIC_LIST_SAMPLE_TEXT")},{separator:"---------------"},{name:a.instant("COMMON.WYSIWYG.PICTURE_BUTTON"),key:"P",openWith:"![",closeWith:'](<<<[![Url:!:http://]!]>>> "[![Title]!]")',placeHolder:a.instant("COMMON.WYSIWYG.PICTURE_SAMPLE_TEXT"),beforeInsert:function(t){return y(t)},afterInsert:function(t){return E(t)}},{name:a.instant("COMMON.WYSIWYG.LINK_BUTTON"),key:"L",openWith:"[",closeWith:'](<<<[![Url:!:http://]!]>>> "[![Title]!]")',placeHolder:a.instant("COMMON.WYSIWYG.LINK_SAMPLE_TEXT"),beforeInsert:function(t){return y(t)},afterInsert:function(t){return E(t)}},{separator:"---------------"},{name:a.instant("COMMON.WYSIWYG.QUOTE_BLOCK_BUTTON"),openWith:"> ",placeHolder:a.instant("COMMON.WYSIWYG.QUOTE_BLOCK_SAMPLE_TEXT")},{name:a.instant("COMMON.WYSIWYG.CODE_BLOCK_BUTTON"),openWith:"```\n",placeHolder:a.instant("COMMON.WYSIWYG.CODE_BLOCK_SAMPLE_TEXT"),closeWith:"\n```"},{separator:"---------------"},{name:a.instant("COMMON.WYSIWYG.PREVIEW_BUTTON"),call:_,className:"preview-icon"}],afterInsert:function(t){var e;return e=angular.element(t.textarea),f.$setViewValue(e.val())}},m.markItUpRemove().markItUp(t).textcomplete([{cache:!0,match:/(^|\s)#([a-z0-9]+)$/i,search:function(t,r){var i,s,a;return t=n.slugify(t),a=["issues","tasks","userstories","epics"],s=["ref","subject"],i=function(e){return function(e){var r,i,o;for(r=0,i=s.length;r=0)return!0;return!1}}(this),h&&h.abort(),h=e.search["do"](o.project.id,t),h.then(function(t){return function(t){var e,n,o,s;if(t.count<1||t.count===t.wikipages.length)return r([]);for(o=[],e=0,n=a.length;e0?o.push(r(t[s].filter(i),!0)):o.push(void 0);return o}}(this)),r([])},replace:function(t){return"$1#"+t.ref+" "},template:function(t,e){return"#"+t.ref+" - "+t.subject}},{cache:!0,match:/(^|\s)@([a-z0-9\-\._]{2,})$/i,search:function(t,e){var r,i;return i=n.slugify(t),r=["username","full_name","full_name_display"],e(o.project.members.length<1?[]:o.project.members.filter(function(t){return function(t){var e,o,s;for(e=0,o=r.length;e=0)return!0;return!1}}(this)))},replace:function(t){return"$1@"+t.username+" "},template:function(t){return t.username+" - "+t.full_name_display}},{cache:!0,match:/(^|\s)\[\[([a-z0-9\-]+)$/i,search:function(t,r){return t=n.slugify(t),e.search["do"](o.project.id,t).then(function(e){return function(e){return e.count<1&&r([]),e.count<1||!e.wikipages||e.wikipages.length<=0?r([]):r(e.wikipages.filter(function(e){return n.slugify(e.slug).indexOf(t)>=0}),!0),r([])}}(this))},replace:function(t){return"$1[["+t.slug+"]]"},template:function(t,e){return t.slug}}],{debounce:200})},k(),I=t.$on("$translateChangeEnd",k),m.on("keypress",function(t){return o.$apply()}),o.$on("$destroy",function(){return c.off(),I()})},{link:c,require:"ngModel"}},r.directive("tgMarkitup",["$rootScope","$tgResources","$selectedText","$tgTemplate","$compile","$translate","tgProjectService",t])}.call(this),function(){var t,e,r,n,i;i=this.taiga,e=this.taiga.bindOnce,r=this.taiga.debounce,n=angular.module("taigaBacklog"),t=function(t,e,n,i,o,s,a){var u;return u=function(n,u,c){var l,p,f,d,h,g,m;return d=!1,l=!0,p=null,g=function(){return p&&p.reset(),n.sprint={project:null,name:null,estimated_start:null,estimated_finish:null}},m=r(2e3,function(r){return function(r){var c,f,h,g,m,v,y;return r.preventDefault(),y=angular.element(r.currentTarget),g=a.instant("COMMON.PICKERDATE.FORMAT"),v=u.find(".submit-button"),p=u.find("form").checksley(),p.validate()?(d=!1,h=angular.copy(n.sprint),c=null,l?(h.estimated_start=moment(h.estimated_start,g).format("YYYY-MM-DD"),h.estimated_finish=moment(h.estimated_finish,g).format("YYYY-MM-DD"),m=t.create("milestones",h),c="sprintform:create:success"):(h.setAttr("estimated_start",moment(h.estimated_start,g).format("YYYY-MM-DD")),h.setAttr("estimated_finish",moment(h.estimated_finish,g).format("YYYY-MM-DD")),m=t.save(h),c="sprintform:edit:success"),f=s().target(v).start(),m.then(function(t){return f.finish(),l&&(n.sprintsCounter+=1),i.$broadcast(c,t),o.close(u)}),m.then(null,function(t){return f.finish(),p.setErrors(t),t._error_message?e.notify("light-error",t._error_message):t.__all__?e.notify("light-error",t.__all__[0]):void 0})):(d=!0,void u.find(".last-sprint-name").addClass("disappear"))}}(this)),h=function(){var r,s;return s=a.instant("LIGHTBOX.DELETE_SPRINT.TITLE"),r=n.sprint.name,e.askOnDelete(s,r).then(function(r){return function(r){var s,a;return a=function(){return r.finish(),n.milestonesCounter-=1,o.close(u),i.$broadcast("sprintform:remove:success",n.sprint)},s=function(){return r.finish(!1),e.notify("error")},t.remove(n.sprint).then(a,s)}}(this))},f=function(){var t,e;return t=_.filter(n.sprints,function(t){return!t.closed}),e=_.sortBy(t,function(t){return moment(t.estimated_finish,"YYYY-MM-DD").format("X")}),e[e.length-1]},n.$on("sprintform:create",function(t,e){var r,i,s,c,d,h;return g(),p=u.find("form").checksley(),p.reset(),l=!0,d=a.instant("COMMON.PICKERDATE.FORMAT"),n.sprint.project=e,n.sprint.name=null,n.sprint.slug=null,s=f(),i=moment(),s?i=moment(s.estimated_finish):n.sprint.estimated_start&&(i=moment(n.sprint.estimated_start)),n.sprint.estimated_start=i.format(d),r=moment().add(2,"weeks"),s?r=moment(s.estimated_finish).add(2,"weeks"):n.sprint.estimated_finish&&(r=moment(n.sprint.estimated_finish)),n.sprint.estimated_finish=r.format(d),c=u.find(".last-sprint-name"),null!=(null!=s?s.name:void 0)&&(h=a.instant("LIGHTBOX.ADD_EDIT_SPRINT.LAST_SPRINT_NAME",{lastSprint:s.name}),c.html(h)),u.find(".delete-sprint").addClass("hidden"),h=a.instant("LIGHTBOX.ADD_EDIT_SPRINT.TITLE"),u.find(".title").text(h),h=a.instant("COMMON.CREATE"),u.find(".button-green").text(h),o.open(u),u.find(".sprint-name").focus(),u.find(".last-sprint-name").removeClass("disappear")}),n.$on("sprintform:edit",function(t,e){var r,i,s;return g(),l=!1,i=a.instant("COMMON.PICKERDATE.FORMAT"),n.$apply(function(){return n.sprint=e,n.sprint.estimated_start=moment(n.sprint.estimated_start).format(i),n.sprint.estimated_finish=moment(n.sprint.estimated_finish).format(i)}),u.find(".delete-sprint").removeClass("hidden"),r=a.instant("BACKLOG.EDIT_SPRINT"),u.find(".title").text(r),s=a.instant("COMMON.SAVE"),u.find(".button-green").text(s),o.open(u),u.find(".sprint-name").focus().select(),u.find(".last-sprint-name").addClass("disappear")}),u.on("keyup",".sprint-name",function(t){return u.find(".sprint-name").val().length>0||d?u.find(".last-sprint-name").addClass("disappear"):u.find(".last-sprint-name").removeClass("disappear")}),u.on("submit","form",m),u.on("click",".delete-sprint",function(t){return t.preventDefault(),h()}),n.$on("$destroy",function(){return u.off()}),g()},{link:u}},n.directive("tgLbCreateEditSprint",["$tgRepo","$tgConfirm","$tgResources","$rootScope","lightboxService","$tgLoading","$translate",t])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g,m,v=function(t,e){function r(){this.constructor=t}for(var n in e)y.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},y={}.hasOwnProperty;h=this.taiga,p=this.taiga.mixOf,m=this.taiga.toggleText,d=this.taiga.scopeDefer,u=this.taiga.bindOnce,l=this.taiga.groupBy,g=this.taiga.timeout,a=this.taiga.bindMethods,c=this.taiga.generateHash,f=angular.module("taigaBacklog"),t=function(t){function e(t,e,r,n,i,o,s,u,c,l,p,f,d,h,g,m,v,y,_){var b;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=u,this.appMetaService=c,this.navUrls=l,this.events=p,this.analytics=f,this.translate=d,this.loading=h,this.rs2=g,this.modelTransform=m,this.errorHandlingService=v,this.storage=y,this.filterRemoteStorageService=_,a(this),this.backlogOrder={},this.milestonesOrder={},this.page=1,this.disablePagination=!1,this.firstLoadComplete=!1,this.scope.userstories=[],this.applyStoredFilters(this.params.pslug,"backlog-filters")||(this.scope.sectionName=this.translate.instant("BACKLOG.SECTION_NAME"),this.showTags=!1,this.activeFilters=!1,this.scope.showGraphPlaceholder=null,this.initializeEventHandlers(),b=this.loadInitialData(),b.then(function(t){return function(){var e,r;if(t.firstLoadComplete=!0,r=t.translate.instant("BACKLOG.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.translate.instant("BACKLOG.PAGE_DESCRIPTION",{projectName:t.scope.project.name,projectDescription:t.scope.project.description}),t.appMetaService.setAll(r,e),t.rs.userstories.getShowTags(t.scope.projectId))return t.showTags=!0,t.scope.$broadcast("showTags",t.showTags)}}(this)),b.then(null,this.onInitialDataError.bind(this)))}return v(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","tgAppMetaService","$tgNavUrls","$tgEvents","$tgAnalytics","$translate","$tgLoading","tgResources","$tgQueueModelTransformation","tgErrorHandlingService","$tgStorage","tgFilterRemoteStorageService"],e.prototype.storeCustomFiltersName="backlog-custom-filters",e.prototype.storeFiltersName="backlog-filters",e.prototype.backlogOrder={},e.prototype.milestonesOrder={},e.prototype.filtersReloadContent=function(){return this.loadUserstories(!0)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("usform:bulk:success",function(t){return function(){return t.loadUserstories(!0),t.loadProjectStats(),t.confirm.notify("success"),t.analytics.trackEvent("userstory","create","bulk create userstory on backlog",1)}}(this)),this.scope.$on("sprintform:create:success",function(t){return function(){return t.loadSprints(),t.loadProjectStats(),t.confirm.notify("success"),t.analytics.trackEvent("sprint","create","create sprint on backlog",1)}}(this)),this.scope.$on("usform:new:success",function(t){return function(){return t.loadUserstories(!0),t.loadProjectStats(),t.rootscope.$broadcast("filters:update"),t.confirm.notify("success"),t.analytics.trackEvent("userstory","create","create userstory on backlog",1)}}(this)),this.scope.$on("sprintform:edit:success",function(t){return function(){return t.loadProjectStats()}}(this)),this.scope.$on("sprintform:remove:success",function(t){return function(e,r){return t.loadSprints(),t.loadProjectStats(),t.loadUserstories(!0),r.closed&&t.loadClosedSprints(),t.rootscope.$broadcast("filters:update")}}(this)),this.scope.$on("usform:edit:success",function(t){return function(e,r){var n;return n=_.findIndex(t.scope.userstories,function(t){return t.id===r.id}),t.scope.userstories[n]=r,t.rootscope.$broadcast("filters:update")}}(this)),this.scope.$on("sprint:us:move",this.moveUs),this.scope.$on("sprint:us:moved",function(t){return function(){return t.loadSprints(),t.loadProjectStats()}}(this)),this.scope.$on("backlog:load-closed-sprints",this.loadClosedSprints),this.scope.$on("backlog:unload-closed-sprints",this.unloadClosedSprints)},e.prototype.initializeSubscription=function(){var t,e;return t="changes.project."+this.scope.projectId+".userstories",this.events.subscribe(this.scope,t,function(t){return function(e){return t.loadAllPaginatedUserstories(),t.loadSprints()}}(this)),e="changes.project."+this.scope.projectId+".milestones",this.events.subscribe(this.scope,e,function(t){return function(e){return t.loadSprints()}}(this))},e.prototype.toggleShowTags=function(){return this.scope.$apply(function(t){return function(){return t.showTags=!t.showTags,t.rs.userstories.storeShowTags(t.scope.projectId,t.showTags)}}(this))},e.prototype.toggleActiveFilters=function(){return this.activeFilters=!this.activeFilters},e.prototype.loadProjectStats=function(){return this.rs.projects.stats(this.scope.projectId).then(function(t){return function(e){var r;return t.scope.stats=e,r=e.total_points?e.total_points:e.defined_points,r?t.scope.stats.completedPercentage=Math.round(100*e.closed_points/r):t.scope.stats.completedPercentage=0,t.scope.showGraphPlaceholder=!(null!=e.total_points&&null!=e.total_milestones),e}}(this))},e.prototype.setMilestonesOrder=function(t){var e,r,n,i,o;for(i=[],r=0,n=t.length;r1&&(L=_.map(R,function(t){return{us_id:t.id,order:w[t.id]}}))):F=0,k=[],l=S=0,h=e.length;S1&&n!==E)a=k.concat(L),M=this.rs.userstories.bulkUpdateMilestone(P,n,a);else if(e.length>1)a=k.concat(L),M=this.rs.userstories.bulkUpdateBacklogOrder(P,a);else{for(x={},U=0,y=L.length;U=n&&t<=r})},e}(p(h.Controller,h.PageMixin,h.FiltersMixin,h.UsFiltersMixin)),f.controller("BacklogController",t),e=function(t,e,r){var n,i,o,s,a,u,c,l;return n=_.template('
<%- text %>
'),o=function(t,e,i,o){var s,a,u,c;return u=function(){var r,n,i,o,a,u,l,p,f,d;if(null!=t.stats&&null!=t.stats.total_points&&0!==t.stats.total_points){if(c(),p=t.stats,f=p.total_points,r=p.assigned_points,!t.userstories)return;for(u=t.userstories,l=[],i=o=0,a=u.length;of){n=e.find(".backlog-table-body .us-item-row")[i],s(n);break}l.push(void 0)}return l}},c=function(){return e.find(".doom-line").remove()},s=function(t){var e;return e=r.instant("BACKLOG.DOOMLINE"),$(t).before(n({text:e}))},a=function(){var t;return t=e.find(".backlog-table-body .us-item-row"),_.map(t,function(t){return angular.element(t)})},t.$on("userstories:loaded",u),t.$watch("stats",u)},a=function(e,r,n,i){var o,s,a,u,c,p,f;return s=function(){var t;return t=r.find(".backlog-table-body input:checkbox:checked"),_.map(t,function(t){var r;return t=$(t).closest(".tg-scope"),r=t.scope(),r.us.milestone=e.sprints[0].id,r.us})},p=function(n,o){var s,a,u;return u=_(e.userstories),e.userstories=u.without.apply(u,n).value(),s=_.map(n,function(t,e){return t.total_points}),a=_.reduce(s,function(t,e){return t+e}),o.user_stories=_.union(o.user_stories,n),o.total_points+=a,t.saveAll(n).then(function(){return i.loadSprints(), i.loadProjectStats()}),r.find(".move-to-sprint").hide()},u=function(t){return p(t,e.currentSprint)},c=function(t){return p(t,e.sprints[0])},f=!1,a=null,o=function(t){var n,i;return a=t.closest(".us-item-row"),t.closest(".us-item-row").toggleClass("ui-multisortable-multiple"),n=r.find(".move-to-sprint"),i=r.find(".backlog-table-body input:checkbox:checked"),i.length>0&&e.sprints.length>0?n.show():n.hide()},$(window).on("keydown.shift-pressed keyup.shift-pressed",function(t){return f=!!t.shiftKey,!0}),r.on("change",".backlog-table-body input:checkbox",function(t){var e,r,n,i,s;return a&&f&&(r=[],e=$(t.currentTarget).closest(".us-item-row"),n=a.nextAll(),i=a.prevAll(),_.some(n,function(t){return t===e[0]})?r=a.nextUntil(e):_.some(i,function(t){return t===e[0]})&&(r=a.prevUntil(e)),_.map(r,function(t){var e;return e=$(t).find("input:checkbox"),e.prop("checked",!0),o(e)})),s=angular.element(t.currentTarget),s.closest(".us-item-row").toggleClass("is-checked"),o(s)}),r.on("click","#move-to-latest-sprint",function(t){return function(t){var r;return r=s(),e.$apply(_.partial(c,r))}}(this)),r.on("click","#move-to-current-sprint",function(t){return function(t){var r;return r=s(),e.$apply(_.partial(u,r))}}(this)),r.on("click","#show-tags",function(t){return t.preventDefault(),i.toggleShowTags(),l(i)})},l=function(t){var e,n;return e=angular.element("#show-tags"),t.showTags?(e.addClass("active"),n=r.instant("BACKLOG.TAGS.HIDE"),e.text(n)):(e.removeClass("active"),n=r.instant("BACKLOG.TAGS.SHOW"),e.text(n))},u=function(t,e,r){var n;return n=e.find("sidebar.backlog-filter"),n.addClass("active"),r.activeFilters=!0},c=function(t,n,i){var o,s,a,u;return a=n.find("sidebar.backlog-filter"),a.one("transitionend",function(){return g(150,function(){return e.$broadcast("resize"),$(".burndown").css("visibility","visible")})}),u=angular.element("#show-filters-button"),$(".burndown").css("visibility","hidden"),a.toggleClass("active"),u.toggleClass("active"),o=r.instant("BACKLOG.FILTERS.HIDE"),s=r.instant("BACKLOG.FILTERS.SHOW"),m(u,[o,s]),i.toggleActiveFilters()},s=function(t,e,r,n){return t.filtersSearch={},e.on("click","#show-filters-button",function(r){return r.preventDefault(),t.$apply(function(){return c(t,e,n)})})},i=function(t,e,r,n){var i,c;return i=e.controller(),a(t,e,r,i),s(t,e,r,i),o(t,e,r,i),c=i.location.search(),(c.status||c.tags||c.q||c.assigned_to||c.owner)&&u(t,e,i),t.$on("showTags",function(){return l(i)}),t.$on("$destroy",function(){return e.off(),$(window).off(".shift-pressed")})},{link:i}},f.directive("tgBacklog",["$tgRepo","$rootScope","$translate",e]),s=function(t,e,r,n){var i,o;return o=e.get("backlog/us-role-points-popover.html",!0),i=function(e,i,s){return u(e,"project",function(t){var n,s;return s=_.filter(t.roles,"computable"),n=_.size(s),n>1?i.append(r(o({roles:s}))(e)):(i.find(".icon-arrow-down").remove(),i.find(".header-points").addClass("not-clickable"))}),e.$on("uspoints:select",function(t,e,r){return i.find(".popover").popover().close(),i.find(".header-points").html(r+"/Total")}),e.$on("uspoints:clear-selection",function(t,e){var r;return i.find(".popover").popover().close(),r=n.instant("COMMON.FIELDS.POINTS"),i.find(".header-points").text(r)}),i.on("click",function(t){var e;return e=angular.element(t.target),(e.is("span")||e.is("div"))&&t.stopPropagation(),i.find(".popover").popover().open()}),i.on("click",".clear-selection",function(e){return e.preventDefault(),e.stopPropagation(),t.$broadcast("uspoints:clear-selection")}),i.on("click",".role",function(e){var r,n;return e.preventDefault(),e.stopPropagation(),n=angular.element(e.currentTarget),r=n.scope(),t.$broadcast("uspoints:select",n.data("role-id"),n.text())}),e.$on("$destroy",function(){return i.off()})},{link:i}},f.directive("tgUsRolePointsSelector",["$rootScope","$tgTemplate","$compile","$translate",s]),o=function(t,e,r){var n,i;return i=r.get("common/estimation/us-points-roles-popover.html",!0),n=function(e,n,o){var s,a,u,c,l,p,f;return s=n.controller(),f=null,p=null,c=null,u=null,e.$on("uspoints:select",function(t,r,n){var i;return i=e.$eval(o.tgBacklogUsPoints),p=r,u.render()}),e.$on("uspoints:clear-selection",function(t){var r;return r=e.$eval(o.tgBacklogUsPoints),p=null,u.render()}),e.$watch(o.tgBacklogUsPoints,function(i){var o;if(i)return u=t.create(n,i,e.project),o=u.calculateRoles(),0===o.length?(n.find(".icon-arrow-bottom").remove(),n.find("a.us-points").addClass("not-clickable")):1===o.length&&(p=_.keys(i.points)[0]),u.isEditable&&a(),u.onSelectedPointForRole=function(t,e,r){return i.points=r,u.render(),this.save(t,e).then(function(){return s.loadProjectStats()})},u.render=function(){var t,e,n,i,s,a,u,c,l;return l=this.calculateTotalPoints(),null==p||1===o.length?(u=l,c=l):(i=this.us.points[p],s=this.pointsById[i],u=s.name+" / "+l+"",c=s.name+" / "+l),t={totalPoints:l,roles:this.calculateRoles(),editable:this.isEditable,text:u,title:c},n="common/estimation/us-estimation-total.html",a=r.get(n,!0),e=a(t),this.$el.html(e)},u.render()}),l=function(){var t,e;return e=u.calculateRoles(),t=i({roles:e}),n.append(t),n.find(".pop-role").popover().open(function(){return $(this).remove()})},a=function(){return n.on("click","a.us-points",function(t){var r;return t.preventDefault(),t.stopPropagation(),r=e.$eval(o.tgBacklogUsPoints),f=p,null!=p?u.renderPointsSelector(p):l()}),n.on("click",".role",function(t){var r,i,s;return t.preventDefault(),t.stopPropagation(),i=angular.element(t.currentTarget),s=e.$eval(o.tgBacklogUsPoints),f=i.data("role-id"),r=n.find(".pop-role"),r.find("a").removeClass("active"),r.find("a[data-role-id='"+f+"']").addClass("active"),u.renderPointsSelector(f)})},e.$on("$destroy",function(){return n.off()})},{link:n}},f.directive("tgBacklogUsPoints",["$tgEstimationsService","$tgRepo","$tgTemplate",o]),i=function(t){var e,r,n;return e=function(){return $(".js-burndown-graph").removeClass("shown"),$(".js-toggle-burndown-visibility-button").removeClass("active"),$(".js-burndown-graph").removeClass("open")},n=function(t){return $(".js-toggle-burndown-visibility-button").addClass("active"),t?$(".js-burndown-graph").addClass("shown"):$(".js-burndown-graph").addClass("open")},r=function(r,i,o){var s,a,u;return s=!0,a=c(["is-burndown-grpahs-collapsed"]),r.isBurndownGraphCollapsed=t.get(a)||!1,u=function(){return r.isBurndownGraphCollapsed?e(s):n(s),s=!1},r.$watch("showGraphPlaceholder",function(){if(null!=r.showGraphPlaceholder)return r.isBurndownGraphCollapsed=r.isBurndownGraphCollapsed||r.showGraphPlaceholder,u()}),i.on("click",".js-toggle-burndown-visibility-button",function(){return r.isBurndownGraphCollapsed=!r.isBurndownGraphCollapsed,t.set(a,r.isBurndownGraphCollapsed),u()}),r.$on("$destroy",function(){return i.off()})},{link:r}},f.directive("tgToggleBurndownVisibility",["$tgStorage",i]),r=function(t){var e,r;return r=function(e,r){var n,i,o,s,a,u,c,l,p,f,d;return f=e.width(),e.height(f/6),a=function(){l=[];for(var t=0,e=r.milestones.length-1;0<=e?t<=e:t>=e;0<=e?t++:t--)l.push(t);return l}.apply(this),o=[],d=_.map(r.milestones,function(t){return 0}),o.push({data:_.zip(a,d),lines:{fillColor:"rgba(0,0,0,0)"},points:{show:!1}}),u=_.map(r.milestones,function(t){return t.optimal}),o.push({data:_.zip(a,u),lines:{fillColor:"rgba(120,120,120,0.2)"}}),s=_.filter(_.map(r.milestones,function(t){return t.evolution}),function(t){return null!=t}),o.push({data:_.zip(a,s),lines:{fillColor:"rgba(102,153,51,0.3)"}}),n=_.map(r.milestones,function(t){return-t["team-increment"]-t["client-increment"]}),o.push({data:_.zip(a,n),lines:{fillColor:"rgba(255,51,51,0.3)"}}),p=_.map(r.milestones,function(t){return-t["team-increment"]}),o.push({data:_.zip(a,p),lines:{fillColor:"rgba(153,51,51,0.3)"}}),i=["rgba(0,0,0,1)","rgba(120,120,120,0.2)","rgba(102,153,51,1)","rgba(153,51,51,1)","rgba(255,51,51,1)"],c={grid:{borderWidth:{top:0,right:1,left:0,bottom:0},borderColor:"#ccc",hoverable:!0},xaxis:{ticks:r.milestones.length,axisLabel:t.instant("BACKLOG.CHART.XAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5,tickFormatter:function(t,e){return""}},yaxis:{axisLabel:t.instant("BACKLOG.CHART.YAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5},series:{shadowSize:0,lines:{show:!0,fill:!0},points:{show:!0,fill:!0,radius:4,lineWidth:2}},colors:i,tooltip:!0,tooltipOpts:{content:function(e,n,i,o){var s;return 1===o.seriesIndex?(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.OPTIMAL",s)):2===o.seriesIndex?(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.REAL",s)):3===o.seriesIndex?(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.INCREMENT_CLIENT",s)):(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.INCREMENT_TEAM",s))}}},e.empty(),e.plot(o,c).data("plot")},e=function(t,e,n){var i;return i=angular.element(e),t.$watch("stats",function(e){if(null!=t.stats)return r(i,t.stats),t.$on("resize",function(){return r(i,t.stats)})}),t.$on("$destroy",function(){return e.off()})},{link:e}},f.directive("tgBurndownBacklogGraph",["$translate",r]),n=function(t,e){var r,n,i,o;return o=t.get("backlog/progress-bar.html",!0),i=function(t,r,n,i){var s;return s=o({projectPointsPercentaje:n,closedPointsPercentaje:i}),s=e(s)(t),r.html(s)},r=function(t){var e;return e=_.max([0,t]),e=_.min([100,e]),Math.round(e)},n=function(t,e,n){var o;return o=angular.element(e),t.$watch(n.tgBacklogProgressBar,function(n){var o,s,a,u,c;if(null!=n)return c=n.total_points?n.total_points:n.defined_points,a=n.defined_points,o=n.closed_points,a>c?(u=100*c/a,s=100*o/a):(u=100,s=100*o/c),u=r(u-3),s=r(s-3),i(t,e,u,s)}),t.$on("$destroy",function(){return e.off()})},{link:n}},f.directive("tgBacklogProgressBar",["$tgTemplate","$compile",n])}.call(this),function(){var t,e,r,n,i;i=this.taiga,e=this.taiga.bindOnce,n=angular.module("taigaBacklog"),r=function(t){return $(t).scope().$destroy(),$(t).off(),$(t).remove()},t=function(){var t;return t=function(t,n,i){return e(t,"project",function(e){var i,o,s;if(e.my_permissions.indexOf("modify_us")>-1)return o=!1,i=dragula([n[0],$(".empty-backlog")[0]],{copySortSource:!1,copy:!1,isContainer:function(t){return t.classList.contains("sprint-table")},moves:function(t){return!!$(t).hasClass("row")}}),i.on("drag",function(t,e){var r,n;return n=$(t).parent(),o=n.hasClass("backlog-table-body"),$(document.body).addClass("drag-active"),r=$(t).find("input[type='checkbox']").is(":checked"),window.dragMultiple.start(t,e)}),i.on("cloned",function(t){return $(t).addClass("backlog-us-mirror")}),i.on("dragend",function(e){var n,i,s,a,u,c,l,p;return u=$(e).parent(),$(".doom-line").remove(),u=$(e).parent(),a=u.hasClass("backlog-table-body")||u.hasClass("empty-backlog"),c=o||a?o===a:$(e).scope().sprint.id===u.scope().sprint.id,n=window.dragMultiple.stop(),$(document.body).removeClass("drag-active"),l=null,i=n.length?n[0]:e,a?s=$(i).index(".backlog-table-body .row"):(s=$(i).index(),l=u.scope().sprint.id),c?p=n.length?_.map(n,function(t){return t=$(t).scope().us}):[$(e).scope().us]:(p=n.length?_.map(n,function(t){return t=$(t).scope().us}):[$(e).scope().us],n.length?_.each(n,function(t){return r(t)}):r(e)),t.$emit("sprint:us:move",p,s,l)}),s=autoScroll([window],{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&i.dragging}}),t.$on("$destroy",function(){return n.off(),i.destroy()})})},{link:t}},n.directive("tgBacklogSortable",t)}.call(this),function(){var t,e,r,n,i;i=this.taiga,n=angular.module("taigaBacklog"),t=function(t,e){var r,n,i,o;return i=50,n={duration:500,easing:"linear"},o=function(t){return function(t){var e,r;return r=t.find(".sprint-table"),e=t.find(".compact-sprint"),e.toggleClass("active"),r.toggleClass("open")}}(this),r=function(t,r,i){return t.$watch(i.tgBacklogSprint,function(e){return e=t.$eval(i.tgBacklogSprint),e.closed?r.addClass("sprint-closed"):o(r)}),r.on("click",".sprint-name > .compact-sprint",function(t){return t.preventDefault(),o(r),r.find(".sprint-table").slideToggle(n)}),r.on("click",".edit-sprint",function(r){var n;return r.preventDefault(),n=t.$eval(i.tgBacklogSprint),e.$broadcast("sprintform:edit",n)}),t.$on("$destroy",function(){return r.off()})},{link:r}},n.directive("tgBacklogSprint",["$tgRepo","$rootScope",t]),e=function(t,e,r,n){var i,o;return o=e.get("backlog/sprint-header.html"),i=function(e,i,s,a){var u,c,l,p;return l=n.instant("BACKLOG.SPRINTS.DATE"),u=function(){return e.project.my_permissions.indexOf("modify_milestone")!==-1},c=function(){return e.project.my_permissions.indexOf("view_milestones")!==-1},p=function(n){var s,a,p,f,d,h,g;return h=t.resolve("project-taskboard",{project:e.project.slug,sprint:n.slug}),d=moment(n.estimated_start).format(l),f=moment(n.estimated_finish).format(l),p=d+"-"+f,a={name:n.name,taskboardUrl:h,estimatedDateRange:p,closedPoints:n.closed_points||0,totalPoints:n.total_points||0,isVisible:c(),isEditable:u()},g=e.$new(),_.assign(g,a),s=r(o)(g),i.html(s)},e.$watch(s.ngModel,function(t){return p(t)}),e.$on("sprintform:edit:success",function(){return p(a.$modelValue)}),e.$on("$destroy",function(){return i.off()})},{link:i,restrict:"EA",require:"ngModel"}},n.directive("tgBacklogSprintHeader",["$tgNavUrls","$tgTemplate","$compile","$translate",e]),r=function(t,e,r){var n,i;return n=!0,i=function(i,o,s){var a,u;return u=$("
"),o.after(u),a=null,o.on("click",function(r){return r.preventDefault(),n=!n,a=e().target(u).start(),n?t.$broadcast("backlog:unload-closed-sprints"):t.$broadcast("backlog:load-closed-sprints")}),i.$on("$destroy",function(){return o.off()}),i.$on("closed-sprints:reloaded",function(t){return function(t,e){var n,i;return a.finish(),n=e.length>0?"BACKLOG.SPRINTS.ACTION_HIDE_CLOSED_SPRINTS":"BACKLOG.SPRINTS.ACTION_SHOW_CLOSED_SPRINTS",i=r.instant(n),o.find(".text").text(i)}}(this))},{link:i}},n.directive("tgBacklogToggleClosedSprintsVisualization",["$rootScope","$tgLoading","$translate",r])}.call(this),function(){var t,e,r,n,i,o,s,a,u;s=this.taiga,n=this.taiga.mixOf,u=this.taiga.toggleText,o=this.taiga.scopeDefer,e=this.taiga.bindOnce,r=this.taiga.groupBy,a=this.taiga.timeout,i=angular.module("taigaTaskboard"),t=function(t){var e,r;return r=function(e,r){var n,i,o,s;return s=e.width(),e.height(240),i=_.map(r,function(t){return moment(t.day)}),n=[],n.unshift({data:_.zip(i,_.map(r,function(t){return t.optimal_points})),lines:{fillColor:"rgba(120,120,120,0.2)"}}),n.unshift({data:_.zip(i,_.map(r,function(t){return t.open_points})),lines:{fillColor:"rgba(102,153,51,0.3)"}}),o={grid:{borderWidth:{top:0,right:1,left:0,bottom:0},borderColor:"#ccc",hoverable:!0},xaxis:{tickSize:[1,"day"],min:i[0],max:_.last(i),mode:"time",daysNames:i,axisLabel:t.instant("TASKBOARD.CHARTS.XAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5},yaxis:{min:0,axisLabel:t.instant("TASKBOARD.CHARTS.YAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5},series:{shadowSize:0,lines:{show:!0,fill:!0},points:{show:!0,fill:!0,radius:4,lineWidth:2}},colors:["rgba(102,153,51,1)","rgba(120,120,120,0.2)"],tooltip:!0,tooltipOpts:{content:function(e,r,n,i){var o,s;return o=moment(r).format(t.instant("TASKBOARD.CHARTS.DATE")),s=Math.round(n),1===i.seriesIndex?t.instant("TASKBOARD.CHARTS.OPTIMAL",{formattedDate:o,roundedValue:s}):t.instant("TASKBOARD.CHARTS.REAL",{formattedDate:o,roundedValue:s})}}},e.empty(),e.plot(n,o).data("plot")},e=function(t,e,n){var i;return i=angular.element(e),t.$on("resize",function(){if(t.stats)return r(i,t.stats.days)}),t.$on("taskboard:graph:toggle-visibility",function(){return e.parent().toggleClass("open"),a(100,function(){if(t.stats)return r(i,t.stats.days)})}),t.$watch("stats",function(e){if(null!=t.stats)return r(i,t.stats.days)}),t.$on("$destroy",function(){return e.off()})},{link:e}},i.directive("tgSprintGraph",["$translate",t])}.call(this),function(){var t,e,r,n,i,o,s,a=[].indexOf||function(t){for(var e=0,r=this.length;e0}),n=_.map(o.assigned_to,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.full_name||"Unassigned",t}),s=_.map(o.owners,function(t){return t.id=t.id.toString(),t.name=t.full_name,t}),e.selectedFilters=[],t.status&&(a=e.formatSelectedFilters("status",u,t.status),e.selectedFilters=e.selectedFilters.concat(a)),t.tags&&(a=e.formatSelectedFilters("tags",c,t.tags),e.selectedFilters=e.selectedFilters.concat(a)),t.assigned_to&&(a=e.formatSelectedFilters("assigned_to",n,t.assigned_to),e.selectedFilters=e.selectedFilters.concat(a)),t.owner&&(a=e.formatSelectedFilters("owner",s,t.owner),e.selectedFilters=e.selectedFilters.concat(a)),e.filterQ=t.q,e.filters=[{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.STATUS"),dataType:"status",content:u},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.TAGS"),dataType:"tags",content:c,hideEmpty:!0,totalTaggedElements:l.length},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"),dataType:"assigned_to",content:n},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.CREATED_BY"),dataType:"owner",content:s}],e.customFilters=[],_.forOwn(i,function(t,r){return e.customFilters.push({id:r,name:r,filter:t})})}}(this))},e.prototype._setMeta=function(){var t,e,r;return e=this.translate.instant("BACKLOG.SPRINTS.DATE"),r=this.translate.instant("TASKBOARD.PAGE_TITLE",{projectName:this.scope.project.name,sprintName:this.scope.sprint.name}),t=this.translate.instant("TASKBOARD.PAGE_DESCRIPTION",{projectName:this.scope.project.name,sprintName:this.scope.sprint.name,startDate:moment(this.scope.sprint.estimated_start).format(e),endDate:moment(this.scope.sprint.estimated_finish).format(e),completedPercentage:this.scope.stats.completedPercentage||"0",completedPoints:this.scope.stats.completedPointsSum||"--",totalPoints:this.scope.stats.totalPointsSum||"--",openTasks:this.scope.stats.openTasks||"--",totalTasks:this.scope.stats.total_tasks||"--"}),this.appMetaService.setAll(r,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("taskform:bulk:success",function(t){return function(e,r){return t.refreshTagsColors().then(function(){return t.taskboardTasksService.add(r)}),t.analytics.trackEvent("task","create","bulk create task on taskboard",1)}}(this)),this.scope.$on("taskform:new:success",function(t){return function(e,r){return t.refreshTagsColors().then(function(){return t.taskboardTasksService.add(r)}),t.analytics.trackEvent("task","create","create task on taskboard",1)}}(this)),this.scope.$on("taskform:edit:success",function(t){return function(e,r){return t.refreshTagsColors().then(function(){return t.taskboardTasksService.replaceModel(r)})}}(this)),this.scope.$on("taskboard:task:move",this.taskMove),this.scope.$on("assigned-to:added",this.onAssignedToChanged)},e.prototype.onAssignedToChanged=function(t,e,r){var n;return r.assigned_to=e,this.taskboardTasksService.replaceModel(r),n=this.repo.save(r),n.then(null,function(){return console.log("FAIL")})},e.prototype.initializeSubscription=function(){var t,e;return t="changes.project."+this.scope.projectId+".tasks",this.events.subscribe(this.scope,t,function(t){return function(e){return t.loadTaskboard()}}(this)),e="changes.project."+this.scope.projectId+".userstories",this.events.subscribe(this.scope,e,function(t){return function(e){return t.refreshTagsColors(),t.loadSprintStats(),t.loadSprint()}}(this))},e.prototype.loadProject=function(){return this.rs.projects.get(this.scope.projectId).then(function(t){return function(e){return e.is_backlog_activated||t.errorHandlingService.permissionDenied(),t.scope.project=e,t.scope.pointsList=_.sortBy(e.points,"order"),t.scope.pointsById=o(e.points,function(t){return t.id}),t.scope.roleById=o(e.roles,function(t){return t.id}),t.scope.taskStatusList=_.sortBy(e.task_statuses,"order"),t.scope.usStatusList=_.sortBy(e.us_statuses,"order"),t.scope.usStatusById=o(e.us_statuses,function(t){return t.id}),t.scope.$emit("project:loaded",e),t.fillUsersAndRoles(e.members,e.roles),e}}(this))},e.prototype.loadSprintStats=function(){return this.rs.sprints.stats(this.scope.projectId,this.scope.sprintId).then(function(t){return function(e){var r,n,i,o;return o=_.reduce(_.values(e.total_points),function(t,e){return t+e},0),r=_.reduce(_.values(e.completed_points),function(t,e){return t+e},0),n=o-r,i=e.total_tasks-e.completed_tasks,t.scope.stats=e,t.scope.stats.totalPointsSum=o,t.scope.stats.completedPointsSum=r,t.scope.stats.remainingPointsSum=n,t.scope.stats.remainingTasks=i,e.totalPointsSum?t.scope.stats.completedPercentage=Math.round(100*e.completedPointsSum/e.totalPointsSum):t.scope.stats.completedPercentage=0,t.scope.stats.openTasks=e.total_tasks-e.completed_tasks,e}}(this))},e.prototype.refreshTagsColors=function(){return this.rs.projects.tagsColors(this.scope.projectId).then(function(t){return function(e){return t.scope.project.tags_colors=e._attrs}}(this))},e.prototype.loadSprint=function(){return this.rs.sprints.get(this.scope.projectId,this.scope.sprintId).then(function(t){return function(e){return t.scope.sprint=e,t.scope.userstories=_.sortBy(e.user_stories,"sprint_order"),t.taskboardTasksService.setUserstories(t.scope.userstories),e}}(this))},e.prototype.loadTasks=function(){var t;return t={include_attachments:!0},t=_.merge(t,this.location.search()),this.rs.tasks.list(this.scope.projectId,this.scope.sprintId,null,t).then(function(t){return function(e){return t.taskboardTasksService.init(t.scope.project,t.scope.usersById),t.taskboardTasksService.set(e)}}(this))},e.prototype.loadTaskboard=function(){return this.q.all([this.refreshTagsColors(),this.loadSprintStats(),this.loadSprint().then(function(t){return function(){return t.loadTasks()}}(this))])},e.prototype.loadInitialData=function(){var t,e;return t={pslug:this.params.pslug,sslug:this.params.sslug},e=this.repo.resolve(t).then(function(t){return function(e){return t.scope.projectId=e.project,t.scope.sprintId=e.milestone,t.initializeSubscription(),e}}(this)),e.then(function(t){return function(){return t.loadProject()}}(this)).then(function(t){return function(){return t.generateFilters(),t.loadTaskboard().then(function(){return t.setRolePoints()})}}(this))},e.prototype.showPlaceHolder=function(t,e){return!(this.taskboardTasksService.tasksRaw.length||this.scope.taskStatusList[0].id!==t||this.scope.userstories.length&&this.scope.userstories[0].id!==e)},e.prototype.editTask=function(t){var e;return e=this.taskboardTasksService.getTask(t),e=e.set("loading",!0),this.taskboardTasksService.replace(e),this.rs.tasks.getByRef(e.getIn(["model","project"]),e.getIn(["model","ref"])).then(function(t){return function(r){return t.rs2.attachments.list("task",e.get("id"),e.getIn(["model","project"])).then(function(n){return t.rootscope.$broadcast("taskform:edit",r,n.toJS()),e=e.set("loading",!1),t.taskboardTasksService.replace(e)})}}(this))},e.prototype.taskMove=function(t,e,r,n,i,o){var s,a,u,c;return e=this.taskboardTasksService.getTaskModel(e.get("id")),s=this.taskboardTasksService.move(e.id,n,i,o),u={status__is_archived:!1,include_attachments:!0},a={headers:{"set-orders":JSON.stringify(s.set_orders)}},c=this.repo.save(e,!0,u,a,!0).then(function(t){return function(e){var r;return r=e[1],r&&r["taiga-info-order-updated"]&&(o=JSON.parse(r["taiga-info-order-updated"]),t.taskboardTasksService.assignOrders(o)),t.loadSprintStats()}}(this))},e.prototype.addNewTask=function(t,e){switch(t){case"standard":return this.rootscope.$broadcast("taskform:new",this.scope.sprintId,null!=e?e.id:void 0);case"bulk":return this.rootscope.$broadcast("taskform:bulk",this.scope.sprintId,null!=e?e.id:void 0)}},e.prototype.toggleFold=function(t){return this.taskboardTasksService.toggleFold(t)},e.prototype.changeTaskAssignedTo=function(t){var e;return e=this.taskboardTasksService.getTaskModel(t),this.rootscope.$broadcast("assigned-to:add",e)},e.prototype.setRolePoints=function(){var t,e,r,n;return t=_.filter(this.scope.project.roles,"computable"),r=function(e){return function(e){return e=parseInt(e,10),_.find(t,function(t){return t.id===e})}}(this),e=function(t){return function(e){var r;return r=parseInt(e,10),_.find(t.scope.project.points,function(t){return t.id===e})}}(this),n=_.reduce(this.scope.userstories,function(t){return function(t,n,i){ return _.forOwn(n.points,function(n,i){var o,s;return s=r(i),o=e(n),t[s.id]||(t[s.id]=s,t[s.id].points=0),t[s.id].points+=o.value}),t}}(this),{}),this.scope.pointsByRole=Object.keys(n).map(function(t){return n[t]})},e}(s(c.Controller,c.PageMixin,c.FiltersMixin)),a.controller("TaskboardController",t),e=function(t){var e;return e=function(e,r,n){var i,o;return i=r.controller(),r.on("click",".toggle-analytics-visibility",function(e){var r;return e.preventDefault(),r=angular.element(e.currentTarget),r.toggleClass("active"),t.$broadcast("taskboard:graph:toggle-visibility")}),o=r.find(".taskboard-table-body"),o.on("scroll",function(t){var e,n;return n=angular.element(t.currentTarget),e=r.find(".taskboard-table-header .taskboard-table-inner"),e.css("left",-1*n.scrollLeft())}),e.$on("$destroy",function(){return r.off()})},{link:e}},a.directive("tgTaskboard",["$rootScope",e]),r=function(t){var e,r,n;return e=40,n=300,r=function(r,i,o){var s,a,u,c,l;return r.$on("sprint:zoom0",function(t){return function(){return u()}}(this)),r.$on("sprint:task:moved",function(t){return function(){return u()}}(this)),r.$watch("usTasks",function(){if(r.project)return r.statusesFolded=t.tasks.getStatusColumnModes(r.project.id),r.usFolded=t.tasks.getUsRowModes(r.project.id,r.sprintId),u()}),r.foldStatus=function(e){return r.statusesFolded[e.id]=!r.statusesFolded[e.id],t.tasks.storeStatusColumnModes(r.projectId,r.statusesFolded),u()},r.foldUs=function(e){return e?r.usFolded[e.id]=!r.usFolded[e.id]:r.usFolded[null]=!r.usFolded[null],t.tasks.storeUsRowModes(r.projectId,r.sprintId,r.usFolded),u()},s=function(t){return function(t,n){var i,o,s;return i=t?r.usTasks.getIn([t.toString(),n.toString()]).size:r.usTasks.getIn(["null",n.toString()]).size,r.statusesFolded[n]?(i&&r.usFolded[t]?(o=Math.round(Math.sqrt(i)),s=e*o):s=e,s):0}}(this),l=function(t){return function(t,e){var o;return o=i.find(".squish-status-"+t),e?o.css("max-width",e):"0"===r.ctrl.zoomLevel?o.css("max-width",148):o.css("max-width",n)}}(this),c=function(t){return function(){var t,e,r;return t=[],e=i.find(".task-colum-name"),t=_.map(e,function(t){return $(t).outerWidth(!0)}),r=_.reduce(t,function(t,e){return t+e}),i.find(".taskboard-table-inner").css("width",r)}}(this),a=function(t){return function(t){var e;return e=s(null,t),_.forEach(r.userstories,function(r){var n;if(n=s(r.id,t),n>e)return e=n}),l(t,e)}}(this),u=function(t){return function(){_.forEach(r.taskStatusList,function(t){return a(t.id)}),c()}}(this)},{link:r}},a.directive("tgTaskboardSquishColumn",["$tgResources",r])}.call(this),function(){var t,e,r,n,i,o,s,a;s=this.taiga,n=this.taiga.mixOf,a=this.taiga.toggleText,o=this.taiga.scopeDefer,e=this.taiga.bindOnce,r=this.taiga.groupBy,i=angular.module("taigaBacklog"),t=function(t,e,r,n){var i;return i=function(t,e,i){var o;return o=t.$watch("usTasks",function(i){var s,a,u,c,l,p,f,d,h;if(i&&i.size&&(o(),t.project.my_permissions.indexOf("modify_task")>-1))return f=null,p=null,l=null,h=e,c=function(){var t;return t=n.instant("BACKLOG.SORTABLE_FILTER_ERROR"),$tgConfirm.notify("error",t)},a=function(t){return t.scope().$destroy(),t.off(),t.remove()},s=_.map(e.find(".task-column"),function(t){return t}),u=dragula(s,{copySortSource:!1,copy:!1,mirrorContainer:e[0],accepts:function(t,e){return!$(e).hasClass("taskboard-userstory-box")},moves:function(t){return $(t).is("tg-card")}}),u.on("drag",function(t){if(f=$(t).parent().scope(),e.hasClass("active-filters"))return c(),setTimeout(function(){return u.cancel(!0)},0),!1}),u.on("dragend",function(e){var n,i,o,s,u,c,d;return d=$(e).parent(),l=$(e),i=l.scope().task,n=l.index(),p=d.scope(),c=f.us?f.us.id:null,u=f.st.id,s=p.us?p.us.id:null,o=p.st.id,o===u&&s===c||a(l),t.$apply(function(){return r.$broadcast("taskboard:task:move",i,i.getIn(["model","status"]),s,o,n)})}),d=autoScroll([$(".taskboard-table-body")[0]],{margin:100,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&u.dragging}}),t.$on("$destroy",function(){return e.off(),u.destroy()})})},{link:i}},i.directive("tgTaskboardSortable",["$tgRepo","$tgResources","$rootScope","$translate",t])}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga.groupBy,t=function(t){function e(){this.reset()}return r(e,t),e.$inject=[],e.prototype.reset=function(){return this.tasksRaw=[],this.foldStatusChanged={},this.usTasks=Immutable.Map()},e.prototype.init=function(t,e){return this.project=t,this.usersById=e},e.prototype.resetFolds=function(){return this.foldStatusChanged={},this.refresh()},e.prototype.toggleFold=function(t){return this.foldStatusChanged[t]=!this.foldStatusChanged[t],this.refresh()},e.prototype.add=function(t){return this.tasksRaw=this.tasksRaw.concat(t),this.refresh()},e.prototype.set=function(t){return this.tasksRaw=t,this.refreshRawOrder(),this.refresh()},e.prototype.setUserstories=function(t){return this.userstories=t},e.prototype.refreshRawOrder=function(){var t,e,r,n,i;for(this.order={},r=this.tasksRaw,n=[],t=0,e=r.length;t1)for(s=0,l=d.length;s1)for(o=0,c=f.length;o
")})}}(this),i&&!i.is_archived&&(t.$on("redraw:wip",n),t.$on("kanban:us:move",n),t.$on("usform:new:success",n),t.$on("usform:bulk:success",n)),t.$on("$destroy",function(){return e.off()})},{link:t}},l.directive("tgKanbanWipLimit",o)}.call(this),function(){var t,e,r,n,i,o,s,a,u;s=this.taiga,n=this.taiga.mixOf,u=this.taiga.toggleText,o=this.taiga.scopeDefer,e=this.taiga.bindOnce,r=this.taiga.groupBy,a=this.taiga.timeout,i=angular.module("taigaKanban"),t=function(t,e,r){var n;return n=function(t,e,n){var i;return i=t.$watch("usByStatus",function(n){var o,s,a,u,c,l,p,f;if(n&&n.size&&(i(),t.project.my_permissions.indexOf("modify_us")>-1))return l=null,c=null,u=null,f=e,s=function(t){return t.scope().$destroy(),t.off(),t.remove()},o=_.map(e.find(".task-column"),function(t){return t}),a=dragula(o,{copySortSource:!1,copy:!1,mirrorContainer:f[0],moves:function(t){return $(t).is("tg-card")}}),a.on("drag",function(t){return l=$(t).parent().scope()}),a.on("dragend",function(e){var n,i,o,a,p;return p=$(e).parent(),u=$(e),i=u.scope().us,n=u.index(),c=p.scope(),o=c.s.id,a=l.s.id,o!==a&&s(u),t.$apply(function(){return r.$broadcast("kanban:us:move",i,i.getIn(["model","status"]),o,n)})}),p=autoScroll(o,{margin:100,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&a.dragging}}),t.$on("$destroy",function(){return e.off(),a.destroy()})})},{link:n}},i.directive("tgKanbanSortable",["$tgRepo","$tgResources","$rootScope",t])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p=function(t,e){function r(){this.constructor=t}for(var n in e)f.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},f={}.hasOwnProperty;c=this.taiga,a=this.taiga.mixOf,l=this.taiga.toString,s=this.taiga.joinStr,o=this.taiga.groupBy,i=this.taiga.bindOnce,n=this.taiga.bindMethods,u=angular.module("taigaEpics"),t=function(t){function e(t,e,r,i,o,s,a,u,c,l,p,f,d,h,g,m){var v;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=i,this.rs=o,this.rs2=s,this.params=a,this.q=u,this.location=c,this.log=l,this.appMetaService=p,this.analytics=f,this.navUrls=d,this.translate=h,this.modelTransform=g,this.errorHandlingService=m,n(this),this.scope.epicRef=this.params.epicref,this.scope.sectionName=this.translate.instant("EPIC.SECTION_NAME"),this.initializeEventHandlers(),v=this.loadInitialData(),v.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),v.then(null,this.onInitialDataError.bind(this))}return p(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgAnalytics","$tgNavUrls","$translate","$tgQueueModelTransformation","tgErrorHandlingService"],e.prototype._setMeta=function(){var t,e,r;return r=this.translate.instant("EPIC.PAGE_TITLE",{epicRef:"#"+this.scope.epic.ref,epicSubject:this.scope.epic.subject,projectName:this.scope.project.name}),t=this.translate.instant("EPIC.PAGE_DESCRIPTION",{epicStatus:(null!=(e=this.scope.statusById[this.scope.epic.status])?e.name:void 0)||"--",epicDescription:angular.element(this.scope.epic.description_html||"").text()}),this.appMetaService.setAll(r,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on epic",1)}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadEpic()}}(this)),this.scope.$on("custom-attributes-values:edit",function(t){return function(){return t.rootscope.$broadcast("object:updated")}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;return t={project:this.scope.project.slug},this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-epics",t)},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.immutableProject=Immutable.fromJS(e._attrs),t.scope.$emit("project:loaded",e),t.scope.statusList=e.epic_statuses,t.scope.statusById=o(e.epic_statuses,function(t){return t.id}),e}}(this))},e.prototype.loadEpic=function(){return this.rs.epics.getByRef(this.scope.projectId,this.params.epicref).then(function(t){return function(e){var r,n,i;if(t.scope.epic=e,t.scope.immutableEpic=Immutable.fromJS(e._attrs),t.scope.epicId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"epic"),null!=(null!=(n=t.scope.epic.neighbors.previous)?n.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.epic.neighbors.previous.ref},t.scope.previousUrl=t.navUrls.resolve("project-epics-detail",r)),null!=(null!=(i=t.scope.epic.neighbors.next)?i.ref:void 0))return r={project:t.scope.project.slug,ref:t.scope.epic.neighbors.next.ref},t.scope.nextUrl=t.navUrls.resolve("project-epics-detail",r)}}(this))},e.prototype.loadUserstories=function(){return this.rs2.userstories.listInEpic(this.scope.epicId).then(function(t){return function(e){return t.scope.userstories=e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(e){return t.fillUsersAndRoles(e.members,e.roles),t.loadEpic().then(function(){return t.loadUserstories()})}}(this))},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.upvote(this.scope.epicId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.downvote(this.scope.epicId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.watch(this.scope.epicId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.unwatch(this.scope.epicId).then(e,t)},e.prototype.onSelectColor=function(t){var e,r,n;return r=function(t){return function(){return t.rootscope.$broadcast("object:updated"),t.confirm.notify("success")}}(this),e=function(t){return function(){return t.confirm.notify("error")}}(this),n=this.modelTransform.save(function(e){return e.color=t,e}),n.then(r,e)},e}(a(c.Controller,c.PageMixin)),u.controller("EpicDetailController",t),r=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:s.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},u.directive("tgEpicStatusDisplay",["$tgTemplate","$compile",r]),e=function(t,e,r,n,i,o,s,a){var u,c;return c=a.get("common/components/status-button.html",!0),u=function(e,s,a,u){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_epic")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=o(c({status:n,statuses:e.statusList,editable:l()}))(e),s.html(r)}}(this),f=function(e){var o,a,u,c;return o=n().target(s).start(),c=i.save(function(t){return t.status=e,t}),u=function(){return t.$broadcast("object:updated"),o.finish()},a=function(){return r.notify("error"),o.finish()},c.then(u,a)},s.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return s.find(".pop-status").popover().open()}),s.on("click",".status",function(t){var e;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),$.fn.popover().closeAll(),f(e.data("status-id"))}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.status:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return s.off()})},{link:u,restrict:"EA",require:"ngModel"}},u.directive("tgEpicStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$compile","$translate","$tgTemplate",e])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g=function(t,e){function r(){this.constructor=t}for(var n in e)m.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},m={}.hasOwnProperty;d=this.taiga,p=this.taiga.mixOf,h=this.taiga.toString,l=this.taiga.joinStr,c=this.taiga.groupBy,u=this.taiga.bindOnce,a=this.taiga.bindMethods,f=angular.module("taigaIssues"),t=function(t){function e(t,e,r,n,i,o,s,u,c,l,p,f,d,h,g){var m;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=u,this.log=c,this.appMetaService=l,this.analytics=p,this.navUrls=f,this.translate=d,this.modelTransform=h,this.errorHandlingService=g,a(this),this.scope.issueRef=this.params.issueref,this.scope.sectionName=this.translate.instant("ISSUES.SECTION_NAME"),this.initializeEventHandlers(),m=this.loadInitialData(),m.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),m.then(null,this.onInitialDataError.bind(this))}return g(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgAnalytics","$tgNavUrls","$translate","$tgQueueModelTransformation","tgErrorHandlingService"], e.prototype._setMeta=function(){var t,e,r,n,i,o;return o=this.translate.instant("ISSUE.PAGE_TITLE",{issueRef:"#"+this.scope.issue.ref,issueSubject:this.scope.issue.subject,projectName:this.scope.project.name}),t=this.translate.instant("ISSUE.PAGE_DESCRIPTION",{issueStatus:(null!=(e=this.scope.statusById[this.scope.issue.status])?e.name:void 0)||"--",issueType:(null!=(r=this.scope.typeById[this.scope.issue.type])?r.name:void 0)||"--",issueSeverity:(null!=(n=this.scope.severityById[this.scope.issue.severity])?n.name:void 0)||"--",issuePriority:(null!=(i=this.scope.priorityById[this.scope.issue.priority])?i.name:void 0)||"--",issueDescription:angular.element(this.scope.issue.description_html||"").text()}),this.appMetaService.setAll(o,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on issue",1)}}(this)),this.scope.$on("promote-issue-to-us:success",function(t){return function(){return t.analytics.trackEvent("issue","promoteToUserstory","promote issue to userstory",1),t.rootscope.$broadcast("object:updated"),t.loadIssue()}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadIssue()}}(this)),this.scope.$on("custom-attributes-values:edit",function(t){return function(){return t.rootscope.$broadcast("object:updated")}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;return t={project:this.scope.project.slug},this.scope.project.is_issues_activated?this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-issues",t):this.scope.onDeleteGoToUrl=this.navUrls.resolve("project",t)},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),t.scope.statusList=e.issue_statuses,t.scope.statusById=c(e.issue_statuses,function(t){return t.id}),t.scope.typeById=c(e.issue_types,function(t){return t.id}),t.scope.typeList=_.sortBy(e.issue_types,"order"),t.scope.severityList=e.severities,t.scope.severityById=c(e.severities,function(t){return t.id}),t.scope.priorityList=e.priorities,t.scope.priorityById=c(e.priorities,function(t){return t.id}),e}}(this))},e.prototype.loadIssue=function(){return this.rs.issues.getByRef(this.scope.projectId,this.params.issueref).then(function(t){return function(e){var r,n,i;if(t.scope.issue=e,t.scope.issueId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"issue"),null!=(null!=(n=t.scope.issue.neighbors.previous)?n.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.issue.neighbors.previous.ref},t.scope.previousUrl=t.navUrls.resolve("project-issues-detail",r)),null!=(null!=(i=t.scope.issue.neighbors.next)?i.ref:void 0))return r={project:t.scope.project.slug,ref:t.scope.issue.neighbors.next.ref},t.scope.nextUrl=t.navUrls.resolve("project-issues-detail",r)}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(e){return t.fillUsersAndRoles(e.members,e.roles),t.loadIssue()}}(this))},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.upvote(this.scope.issueId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.downvote(this.scope.issueId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.watch(this.scope.issueId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.unwatch(this.scope.issueId).then(e,t)},e}(p(d.Controller,d.PageMixin)),f.controller("IssueDetailController",t),i=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:s.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},f.directive("tgIssueStatusDisplay",["$tgTemplate","$compile",i]),n=function(t,e,r,n,i,o,s){var a,u;return u=o.get("common/components/status-button.html",!0),a=function(e,o,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=u({status:n,statuses:e.statusList,editable:l()}),r=s(r)(e),o.html(r)}}(this),f=function(e){var s,a,u,c;return $.fn.popover().closeAll(),s=n().target(o).start(),c=i.save(function(t){return t.status=e,t}),u=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},c.then(u,a)},o.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-status").popover().open()}),o.on("click",".status",function(t){var e;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),f(e.data("status-id"))}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.status:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},f.directive("tgIssueStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",n]),o=function(t,e,r,n,i,o,s){var a,u;return u=o.get("issue/issue-type-button.html",!0),a=function(e,o,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.typeById[t.type],r=u({type:n,typees:e.typeList,editable:l()}),r=s(r)(e),o.html(r)}}(this),f=function(e){var s,a,u,c;return $.fn.popover().closeAll(),s=n().target(o.find(".level-name")).start(),c=i.save(function(t){return t.type=e,t}),u=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},c.then(u,a)},o.on("click",".type-data",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-type").popover().open()}),o.on("click",".type",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),r=e.data("type-id"),f(r)}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.type:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},f.directive("tgIssueTypeButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",o]),r=function(t,e,r,n,i,o,s){var a,u;return u=o.get("issue/issue-severity-button.html",!0),a=function(e,o,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.severityById[t.severity],r=u({severity:n,severityes:e.severityList,editable:l()}),r=s(r)(e),o.html(r)}}(this),f=function(e){var s,a,u,c;return $.fn.popover().closeAll(),s=n().target(o.find(".level-name")).start(),c=i.save(function(t){return t.severity=e,t}),u=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},c.then(u,a)},o.on("click",".severity-data",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-severity").popover().open()}),o.on("click",".severity",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return r=angular.element(t.currentTarget),e=r.data("severity-id"),f(e)}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.severity:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},f.directive("tgIssueSeverityButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",r]),e=function(t,e,r,n,i,o,s){var a,u;return u=o.get("issue/issue-priority-button.html",!0),a=function(e,o,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.priorityById[t.priority],r=u({priority:n,priorityes:e.priorityList,editable:l()}),r=s(r)(e),o.html(r)}}(this),f=function(e){var s,a,u,c;return $.fn.popover().closeAll(),s=n().target(o.find(".level-name")).start(),c=i.save(function(t){return t.priority=e,t}),u=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},c.then(u,a)},o.on("click",".priority-data",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-priority").popover().open()}),o.on("click",".priority",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return r=angular.element(t.currentTarget),e=r.data("priority-id"),f(e)}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.priority:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},f.directive("tgIssuePriorityButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",e]),s=function(t,e,r,n){var i;return i=function(i,o,s,a){var u;return u=function(n){return function(n,i){var o,s,a;return o={generated_from_issue:n.id,project:n.project,subject:n.subject,description:n.description,tags:n.tags,is_blocked:n.is_blocked,blocked_note:n.blocked_note},a=function(){return i.finish(),r.notify("success"),t.$broadcast("promote-issue-to-us:success")},s=function(){return i.finish(),r.notify("error")},e.create("userstories",o).then(a,s)}}(this),o.on("click","a",function(t){var e,i,o,s;return t.preventDefault(),e=a.$modelValue,s=n.instant("ISSUES.CONFIRM_PROMOTE.TITLE"),i=n.instant("ISSUES.CONFIRM_PROMOTE.MESSAGE"),o=e.subject,r.ask(s,o,i).then(function(t){return function(t){return u(e,t)}}(this))}),i.$on("$destroy",function(){return o.off()})},{restrict:"AE",require:"ngModel",templateUrl:"issue/promote-issue-to-us-button.html",link:i}},f.directive("tgPromoteIssueToUsButton",["$rootScope","$tgRepo","$tgConfirm","$translate",s])}.call(this),function(){var t,e,r,n,i,o,s,a=[].indexOf||function(t){for(var e=0,r=this.length;e0}),n=_.map(o.assigned_to,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.full_name||"Unassigned",t}),s=_.map(o.owners,function(t){return t.id=t.id.toString(),t.name=t.full_name,t}),e.selectedFilters=[],t.status&&(u=e.formatSelectedFilters("status",l,t.status),e.selectedFilters=e.selectedFilters.concat(u)),t.tags&&(u=e.formatSelectedFilters("tags",p,t.tags),e.selectedFilters=e.selectedFilters.concat(u)),t.assigned_to&&(u=e.formatSelectedFilters("assigned_to",n,t.assigned_to),e.selectedFilters=e.selectedFilters.concat(u)),t.owner&&(u=e.formatSelectedFilters("owner",s,t.owner),e.selectedFilters=e.selectedFilters.concat(u)),t.type&&(u=e.formatSelectedFilters("type",d,t.type),e.selectedFilters=e.selectedFilters.concat(u)),t.severity&&(u=e.formatSelectedFilters("severity",c,t.severity),e.selectedFilters=e.selectedFilters.concat(u)),t.priority&&(u=e.formatSelectedFilters("priority",a,t.priority),e.selectedFilters=e.selectedFilters.concat(u)),e.filterQ=t.q,e.filters=[{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.TYPE"),dataType:"type",content:d},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.SEVERITY"),dataType:"severity",content:c},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.PRIORITIES"),dataType:"priority",content:a},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.STATUS"),dataType:"status",content:l},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.TAGS"),dataType:"tags",content:p,hideEmpty:!0,totalTaggedElements:f.length},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"),dataType:"assigned_to",content:n},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.CREATED_BY"),dataType:"owner",content:s}],e.customFilters=[],_.forOwn(i,function(t,r){return e.customFilters.push({id:r,name:r,filter:t})})}}(this))},e.prototype.initializeSubscription=function(){var t;return t="changes.project."+this.scope.projectId+".issues",this.events.subscribe(this.scope,t,function(t){return function(e){return t.loadIssues()}}(this))},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return e.is_issues_activated||t.errorHandlingService.permissionDenied(),t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),t.scope.issueStatusById=a(e.issue_statuses,function(t){return t.id}),t.scope.issueStatusList=_.sortBy(e.issue_statuses,"order"),t.scope.severityById=a(e.severities,function(t){return t.id}),t.scope.severityList=_.sortBy(e.severities,"order"),t.scope.priorityById=a(e.priorities,function(t){return t.id}),t.scope.priorityList=_.sortBy(e.priorities,"order"),t.scope.issueTypes=_.sortBy(e.issue_types,"order"),t.scope.issueTypeById=a(e.issue_types,function(t){return t.id}),e}}(this))},e.prototype.loadIssuesRequests=0,e.prototype.loadIssues=function(){var t,e;return t=this.location.search(),e=this.rs.issues.list(this.scope.projectId,t),this.loadIssuesRequests+=1,e.index=this.loadIssuesRequests,e.then(function(t){return function(r){return e.index===t.loadIssuesRequests&&(t.scope.issues=r.models,t.scope.page=r.current,t.scope.count=r.count,t.scope.paginatedBy=r.paginatedBy),r}}(this)),e},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(e){return t.fillUsersAndRoles(e.members,e.roles),t.initializeSubscription(),t.generateFilters(),t.loadIssues()}}(this))},e.prototype.addNewIssue=function(){return this.rootscope.$broadcast("issueform:new",this.scope.project)},e.prototype.addIssuesInBulk=function(){return this.rootscope.$broadcast("issueform:bulk",this.scope.projectId)},e.prototype.upVoteIssue=function(t){var e,r;return this.voting=t,r=function(t){return function(){return t.loadIssues(),t.voting=null}}(this),e=function(t){return function(){return t.confirm.notify("error"),t.voting=null}}(this),this.rs.issues.upvote(t).then(r,e)},e.prototype.downVoteIssue=function(t){var e,r;return this.voting=t,r=function(t){return function(){return t.loadIssues(),t.voting=null}}(this),e=function(t){return function(){return t.confirm.notify("error"),t.voting=null}}(this),this.rs.issues.downvote(t).then(r,e)},e.prototype.getOrderBy=function(){return _.isString(this.location.search().order_by)?this.location.search().order_by:"created_date"},e}(c(f.Controller,f.PageMixin,f.FiltersMixin)),l.controller("IssuesController",r),n=function(t,e,r,n){var i,o,s,a;return a=r.get("issue/issue-paginator.html",!0),s=function(t,e,r,i){var o,s,u,c,l,p,f;return s=2,l=4,u=2,c=2,o=e.find(".issues-paginator"),p=function(){var e;return e=t.count/t.paginatedBy,e=parseInt(e,10)1,h.showNext=!(t.page===d),e=t.page,i=f=1,m=d;1<=m?f<=m:f>=m;i=1<=m?++f:--f)i===e+s&&d>e+s+c?g.push({classes:"dots",type:"dots"}):i===e-l&&e>u+l?g.push({classes:"dots",type:"dots"}):i>e+s&&i<=d-c||iu||(i===e?g.push({classes:"active",num:i,type:"page-active"}):g.push({classes:"page",num:i,type:"page"}));return r=a(h),r=n(r)(t),o.html(r)},t.$watch("issues",function(t){if(t)return f()}),e.on("click",".issues-paginator a.next",function(e){return e.preventDefault(),t.$apply(function(){return i.selectFilter("page",t.page+1),i.loadIssues()})}),e.on("click",".issues-paginator a.previous",function(e){return e.preventDefault(),t.$apply(function(){return i.selectFilter("page",t.page-1),i.loadIssues()})}),e.on("click",".issues-paginator li.page > a",function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=n.data("pagenum"),t.$apply(function(){return i.selectFilter("page",r),i.loadIssues()})})},o=function(t,r,i,o){var s,a,u,c;return a=o.getOrderBy(),a&&(u=p(a,"-")?"icon-arrow-up":"icon-arrow-down",s=r.find(".row.title > div[data-fieldname='"+h(a,"-")+"']"),c=$("").attr("svg-icon",u),s.append(c),n(s.contents())(t)),r.on("click",".row.title > div",function(i){var s,l,f;return f=angular.element(i.currentTarget),a=o.getOrderBy(),l=f.data("fieldname"),s=a===l?"-"+l:l,t.$apply(function(){return o.replaceFilter("order_by",s),o.storeFilters(o.params.pslug,e.search(),o.filtersHashSuffix),o.loadIssues().then(function(){return r.find(".row.title > div > tg-svg").remove(),u=p(s,"-")?"icon-arrow-up":"icon-arrow-down",c=$("").attr("svg-icon",u),f.append(c),n(f.contents())(t)})})})},i=function(t,e,r){var n;return n=e.controller(),o(t,e,r,n),s(t,e,r,n),t.$on("$destroy",function(){return e.off()})},{link:i}},l.directive("tgIssues",["$log","$tgLocation","$tgTemplate","$compile",n]),e=function(t,e,r){var n,i,o;return i=e.get("issue/issue-status-inline-edition-selection.html",!0),o=function(t,e,r){var n,i,o;if(i=t.find(".issue-status"),n=t.find(".issue-status .issue-status-bind"),o=r[e.status])return n.text(o.name),n.prop("title",o.name),i.css("color",o.color)},n=function(e,r,n){var s,a;return s=r.controller(),a=e.$eval(n.tgIssueStatusInlineEdition),r.on("click",".issue-status",function(t){return t.preventDefault(),t.stopPropagation(),r.find(".pop-status").popover().open()}),r.on("click",".status",function(n){var i;return n.preventDefault(),n.stopPropagation(),i=angular.element(n.currentTarget),a.status=i.data("status-id"),r.find(".pop-status").popover().close(),o(r,a,e.issueStatusById),e.$apply(function(){return t.save(a).then(function(){return s.loadIssues(),s.generateFilters()})})}),f.bindOnce(e,"project",function(t){if(r.append(i({statuses:t.issue_statuses})),o(r,a,e.issueStatusById),t.my_permissions.indexOf("modify_issue")===-1)return r.unbind("click"),r.find("a").addClass("not-clickable")}),e.$watch(n.tgIssueStatusInlineEdition,function(t){return function(t){return o(r,t,e.issueStatusById)}}(this)),e.$on("$destroy",function(){return r.off()})},{link:n}},l.directive("tgIssueStatusInlineEdition",["$tgRepo","$tgTemplate","$rootScope",e]),t=function(t,e,r,n){var i,o;return o=_.template('<%- name %>\n
<%- name %>
'),i=function(i,s,a){var u,c,l;return l=function(t){var e,a,u;return a={name:r.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED"),imgurl:"/"+window._version+"/images/unnamed.png"},u=i.usersById[t.assigned_to],e=n.getAvatar(u),a.imgurl=e.url,a.bg=null,u&&(a.name=u.full_name_display,a.bg=e.bg),s.find(".avatar").html(o(a)),s.find(".issue-assignedto").attr("title",a.name)},u=s.controller(),c=i.$eval(a.tgIssueAssignedToInlineEdition),l(c),s.on("click",".issue-assignedto",function(t){return e.$broadcast("assigned-to:add",c)}),f.bindOnce(i,"project",function(t){if(t.my_permissions.indexOf("modify_issue")===-1)return s.unbind("click"),s.find("a").addClass("not-clickable")}),i.$on("assigned-to:added",function(e){return function(e,r,n){if(n.id===c.id)return n.assigned_to=r,t.save(n),l(n)}}(this)),i.$watch(a.tgIssueAssignedToInlineEdition,function(t){return function(t){return l(t)}}(this)),i.$on("$destroy",function(){return s.off()})},{link:i}},l.directive("tgIssueAssignedToInlineEdition",["$tgRepo","$rootScope","$translate","tgAvatarService",t])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p=function(t,e){function r(){this.constructor=t}for(var n in e)f.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},f={}.hasOwnProperty;l=this.taiga,u=this.taiga.mixOf,a=this.taiga.groupBy,s=this.taiga.bindOnce,o=this.taiga.bindMethods,c=angular.module("taigaUserStories"),i=function(t){function e(t,e,r,n,i,s,a,u,c,l,p,f,d,h,g,m){var v;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=s,this.q=a,this.location=u,this.log=c,this.appMetaService=l,this.navUrls=p,this.analytics=f,this.translate=d,this.modelTransform=h,this.errorHandlingService=g,this.configService=m,o(this),this.scope.usRef=this.params.usref,this.scope.sectionName=this.translate.instant("US.SECTION_NAME"),this.scope.tribeEnabled=this.configService.config.tribeHost,this.initializeEventHandlers(),v=this.loadInitialData(),v.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),v.then(null,this.onInitialDataError.bind(this))}return p(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgNavUrls","$tgAnalytics","$translate","$tgQueueModelTransformation","tgErrorHandlingService","$tgConfig"],e.prototype._setMeta=function(){var t,e,r,n,i,o;return o=this.scope.tasks.length,t=_.filter(this.scope.tasks,function(t){return function(e){return t.scope.taskStatusById[e.status].is_closed}}(this)).length,r=o>0?Math.round(100*t/o):0,i=this.translate.instant("US.PAGE_TITLE",{userStoryRef:"#"+this.scope.us.ref,userStorySubject:this.scope.us.subject,projectName:this.scope.project.name}),e=this.translate.instant("US.PAGE_DESCRIPTION",{userStoryStatus:(null!=(n=this.scope.statusById[this.scope.us.status])?n.name:void 0)||"--",userStoryPoints:this.scope.us.total_points,userStoryDescription:angular.element(this.scope.us.description_html||"").text(),userStoryClosedTasks:t,userStoryTotalTasks:o,userStoryProgressPercentage:r}),this.appMetaService.setAll(i,e)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("related-tasks:update",function(t){return function(){var e;if(t.scope.tasks=_.clone(t.scope.tasks,!1),e=_.every(t.scope.tasks,function(t){return t.is_closed}),t.scope.us.is_closed!==e)return t.loadUs()}}(this)),this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on userstory",1)}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadUs()}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;return t={project:this.scope.project.slug},this.scope.onDeleteGoToUrl=this.navUrls.resolve("project",t),this.scope.project.is_backlog_activated?this.scope.us.milestone?(t.sprint=this.scope.sprint.slug,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-taskboard",t)):this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-backlog",t):this.scope.project.is_kanban_activated?this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-kanban",t):void 0},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),t.scope.statusList=e.us_statuses,t.scope.statusById=a(e.us_statuses,function(t){return t.id}),t.scope.taskStatusById=a(e.task_statuses,function(t){return t.id}),t.scope.pointsList=_.sortBy(e.points,"order"),t.scope.pointsById=a(t.scope.pointsList,function(t){return t.id}),e}}(this))},e.prototype.loadUs=function(){var t,e,r,n;return t=_.pick(this.location.search(),"milestone","no-milestone","kanban-status"),r=t.milestone,r&&this.rs.userstories.storeQueryParams(this.scope.projectId,{milestone:r,order_by:"sprint_order"}),n=t["no-milestone"],n&&this.rs.userstories.storeQueryParams(this.scope.projectId,{milestone:"null",order_by:"backlog_order"}),e=t["kanban-status"],e&&this.rs.userstories.storeQueryParams(this.scope.projectId,{status:e,order_by:"kanban_order"}),this.rs.userstories.getByRef(this.scope.projectId,this.params.usref).then(function(t){return function(e){return t.scope.us=e,t.scope.usId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"us"),e}}(this))},e.prototype.loadSprint=function(){if(this.scope.us.milestone)return this.rs.sprints.get(this.scope.us.project,this.scope.us.milestone).then(function(t){return function(e){return t.scope.sprint=e,e}}(this))},e.prototype.loadTasks=function(){return this.rs.tasks.list(this.scope.projectId,null,this.scope.usId).then(function(t){return function(e){return t.scope.tasks=e,e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(e){return t.fillUsersAndRoles(e.members,e.roles),t.loadUs().then(function(){return t.q.all([t.loadSprint(),t.loadTasks()]); })}}(this))},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.upvote(this.scope.usId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.downvote(this.scope.usId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.watch(this.scope.usId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.unwatch(this.scope.usId).then(e,t)},e.prototype.onTribeInfo=function(){var t,e,r,n;return r=this.translate.instant("US.TRIBE.PUBLISH_MORE_INFO_TITLE"),t=$("").attr({src:"/"+window._version+"/images/monster-fight.png",alt:this.translate.instant("US.TRIBE.PUBLISH_MORE_INFO_TITLE")}),n=this.translate.instant("US.TRIBE.PUBLISH_MORE_INFO_TEXT"),e=$("
").append(t).append(n),this.confirm.success(r,e)},e}(u(l.Controller,l.PageMixin)),c.controller("UserStoryDetailController",i),r=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:i.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},c.directive("tgUsStatusDisplay",["$tgTemplate","$compile",r]),e=function(t,e,r,n,i,o,s){var a,u;return u=o.get("common/components/status-button.html",!0),a=function(e,o,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_us")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=u({status:n,statuses:e.statusList,editable:l()}),o.html(r),s(o.contents())(e)}}(this),f=function(e){return function(e){var s,a,u,c;return o.find(".pop-status").popover().close(),s=n().target(o.find(".js-edit-status")).start(),c=i.save(function(t){return t.status=e,t}),u=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},c.then(u,a)}}(this),o.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-status").popover().open()}),o.on("click",".status",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return r=angular.element(t.currentTarget),e=r.data("status-id"),f(e)}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.status:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},c.directive("tgUsStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",e]),n=function(t,e,r,n,i,o,s){var a,u;return u=o.get("us/us-team-requirement-button.html",!0),a=function(e,o,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_us")!==-1},p=function(t){var r,n;return r={canEdit:l(),isRequired:t.team_requirement},n=u(r),n=s(n)(e),o.html(n)},f=function(e){var s,a;return s=n().target(o.find("label")).start(),a=i.save(function(t){return t.team_requirement=e,t}),a.then(function(e){return function(){return s.finish(),t.$broadcast("object:updated")}}(this)),a.then(null,function(){return s.finish(),r.notify("error")})},o.on("click",".team-requirement",function(t){var e;if(l())return e=!c.$modelValue.team_requirement,f(e)}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.team_requirement:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},c.directive("tgUsTeamRequirementButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",n]),t=function(t,e,r,n,i,o,s){var a,u;return u=o.get("us/us-client-requirement-button.html",!0),a=function(e,o,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_us")!==-1},p=function(t){var r,n;return r={canEdit:l(),isRequired:t.client_requirement},n=s(u(r))(e),o.html(n)},f=function(e){var s,a;return s=n().target(o.find("label")).start(),a=i.save(function(t){return t.client_requirement=e,t}),a.then(function(e){return function(){return s.finish(),t.$broadcast("object:updated")}}(this)),a.then(null,function(){return r.notify("error")})},o.on("click",".client-requirement",function(t){var e;if(l())return e=!c.$modelValue.client_requirement,f(e)}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.client_requirement:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},c.directive("tgUsClientRequirementButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",t])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;u=this.taiga,s=this.taiga.mixOf,o=this.taiga.groupBy,i=this.taiga.bindMethods,a=angular.module("taigaTasks"),t=function(t){function e(t,e,r,n,o,s,a,u,c,l,p,f,d,h,g){var m;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=o,this.params=s,this.q=a,this.location=u,this.log=c,this.appMetaService=l,this.navUrls=p,this.analytics=f,this.translate=d,this.modelTransform=h,this.errorHandlingService=g,i(this),this.scope.taskRef=this.params.taskref,this.scope.sectionName=this.translate.instant("TASK.SECTION_NAME"),this.initializeEventHandlers(),m=this.loadInitialData(),m.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),m.then(null,this.onInitialDataError.bind(this))}return c(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgNavUrls","$tgAnalytics","$translate","$tgQueueModelTransformation","tgErrorHandlingService"],e.prototype._setMeta=function(){var t,e,r;return r=this.translate.instant("TASK.PAGE_TITLE",{taskRef:"#"+this.scope.task.ref,taskSubject:this.scope.task.subject,projectName:this.scope.project.name}),t=this.translate.instant("TASK.PAGE_DESCRIPTION",{taskStatus:(null!=(e=this.scope.statusById[this.scope.task.status])?e.name:void 0)||"--",taskDescription:angular.element(this.scope.task.description_html||"").text()}),this.appMetaService.setAll(r,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on task",1)}}(this)),this.scope.$on("custom-attributes-values:edit",function(t){return function(){return t.rootscope.$broadcast("object:updated")}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadTask()}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;if(t={project:this.scope.project.slug},this.scope.onDeleteGoToUrl=this.navUrls.resolve("project",t),this.scope.project.is_backlog_activated){if(this.scope.task.milestone)return t.sprint=this.scope.sprint.slug,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-taskboard",t);if(this.scope.task.us)return t.ref=this.scope.us.ref,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-userstories-detail",t)}else if(this.scope.project.is_kanban_activated&&this.scope.us)return t.ref=this.scope.us.ref,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-userstories-detail",t)},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),t.scope.statusList=e.task_statuses,t.scope.statusById=o(e.task_statuses,function(t){return t.id}),e}}(this))},e.prototype.loadTask=function(){return this.rs.tasks.getByRef(this.scope.projectId,this.params.taskref).then(function(t){return function(e){var r,n,i;return t.scope.task=e,t.scope.taskId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"task"),null!=(null!=(n=t.scope.task.neighbors.previous)?n.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.task.neighbors.previous.ref},t.scope.previousUrl=t.navUrls.resolve("project-tasks-detail",r)),null!=(null!=(i=t.scope.task.neighbors.next)?i.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.task.neighbors.next.ref},t.scope.nextUrl=t.navUrls.resolve("project-tasks-detail",r)),e}}(this))},e.prototype.loadSprint=function(){if(this.scope.task.milestone)return this.rs.sprints.get(this.scope.task.project,this.scope.task.milestone).then(function(t){return function(e){return t.scope.sprint=e,e}}(this))},e.prototype.loadUserStory=function(){if(this.scope.task.user_story)return this.rs.userstories.get(this.scope.task.project,this.scope.task.user_story).then(function(t){return function(e){return t.scope.us=e,e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(e){return t.fillUsersAndRoles(e.members,e.roles),t.loadTask().then(function(){return t.q.all([t.loadSprint(),t.loadUserStory()])})}}(this))},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.upvote(this.scope.taskId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.downvote(this.scope.taskId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.watch(this.scope.taskId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.unwatch(this.scope.taskId).then(e,t)},e}(s(u.Controller,u.PageMixin)),a.controller("TaskDetailController",t),n=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:s.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},a.directive("tgTaskStatusDisplay",["$tgTemplate","$compile",n]),r=function(t,e,r,n,i,o,s,a){var u,c;return c=a.get("common/components/status-button.html",!0),u=function(e,s,a,u){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_task")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=o(c({status:n,statuses:e.statusList,editable:l()}))(e),s.html(r)}}(this),f=function(e){var o,a,u,c;return o=n().target(s).start(),c=i.save(function(t){return t.status=e,t}),u=function(){return t.$broadcast("object:updated"),o.finish()},a=function(){return r.notify("error"),o.finish()},c.then(u,a)},s.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return s.find(".pop-status").popover().open()}),s.on("click",".status",function(t){var e;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),$.fn.popover().closeAll(),f(e.data("status-id"))}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.status:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return s.off()})},{link:u,restrict:"EA",require:"ngModel"}},a.directive("tgTaskStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$compile","$translate","$tgTemplate",r]),e=function(t,e,r,n,i,o,s){var a,u;return u=s.get("issue/iocaine-button.html",!0),a=function(e,s,a,c){var l,p,f;return l=function(){return e.project.my_permissions.indexOf("modify_task")!==-1},p=function(t){var r,n;return l()||t.is_iocaine?(r={isIocaine:t.is_iocaine,isEditable:l()},n=o(u(r))(e),s.html(n)):void s.html("")},f=function(e){var o,a;return o=n().target(s.find("label")).start(),a=i.save(function(t){return t.is_iocaine=e,t}),a.then(function(){return t.$broadcast("object:updated")}),a.then(null,function(){return r.notify("error")}),a["finally"](function(){return o.finish()})},s.on("click",".is-iocaine",function(t){var e;if(l())return e=!c.$modelValue.is_iocaine,f(e)}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.is_iocaine:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return s.off()})},{link:a,restrict:"EA",require:"ngModel"}},a.directive("tgTaskIsIocaineButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$compile","$tgTemplate",e])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;c=this.taiga,a=this.taiga.mixOf,u=angular.module("taigaTeam"),e=function(t){function e(t,e,r,n,i,o,s,a,u,c,l,p,f){var d;this.scope=t,this.rootscope=e,this.repo=r,this.rs=n,this.params=i,this.q=o,this.location=s,this.navUrls=a,this.appMetaService=u,this.auth=c,this.translate=l,this.projectService=p,this.errorHandlingService=f,this.scope.sectionName="TEAM.SECTION_NAME",d=this.loadInitialData(),d.then(function(t){return function(){var e,r;return r=t.translate.instant("TEAM.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.translate.instant("TEAM.PAGE_DESCRIPTION",{projectName:t.scope.project.name,projectDescription:t.scope.project.description}),t.appMetaService.setAll(r,e)}}(this)),d.then(null,this.onInitialDataError.bind(this))}return l(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgResources","$routeParams","$q","$location","$tgNavUrls","tgAppMetaService","$tgAuth","$translate","tgProjectService","tgErrorHandlingService"],e.prototype.setRole=function(t){return t?this.scope.filtersRole=t:this.scope.filtersRole=null},e.prototype.loadMembers=function(){var t,e,r,n,i;for(i=this.auth.getUser(),this.scope.totals={},n=this.scope.activeUsers,t=0,e=n.length;t=0)})}},u.filter("membersFilter",s)}.call(this),function(){var t,e,r,n,i,o,s,a,u,c=function(t,e){return function(){return t.apply(e,arguments)}},l=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;u=this.taiga,s=this.taiga.mixOf,o=this.taiga.groupBy,n=this.taiga.bindOnce,i=this.taiga.debounce,a=angular.module("taigaWiki"),e=function(t){function e(t,e,r,n,i,o,s,a,u,l,p,f,d,h,g,m){var v;this.scope=t,this.rootscope=e,this.repo=r,this.model=n,this.confirm=i,this.rs=o,this.params=s,this.q=a,this.location=u,this.filter=l,this.log=p,this.appMetaService=f,this.navUrls=d,this.analytics=h,this.translate=g,this.errorHandlingService=m,this.moveLink=c(this.moveLink,this),this.scope.$on("wiki:links:move",this.moveLink),this.scope.projectSlug=this.params.pslug,this.scope.wikiSlug=this.params.slug,this.scope.wikiTitle=this.scope.wikiSlug,this.scope.sectionName="Wiki",this.scope.linksVisible=!1,v=this.loadInitialData(),v.then(function(t){return function(){return t._setMeta()}}(this)),v.then(null,this.onInitialDataError.bind(this))}return l(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgModel","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$filter","$log","tgAppMetaService","$tgNavUrls","$tgAnalytics","$translate","tgErrorHandlingService"],e.prototype._setMeta=function(){var t,e,r,n,i;return i=this.translate.instant("WIKI.PAGE_TITLE",{wikiPageName:this.scope.wikiTitle,projectName:this.scope.project.name}),t=this.translate.instant("WIKI.PAGE_DESCRIPTION",{wikiPageContent:angular.element((null!=(e=this.scope.wiki)?e.html:void 0)||"").text(),totalEditions:(null!=(r=this.scope.wiki)?r.editions:void 0)||0,lastModifiedDate:moment(null!=(n=this.scope.wiki)?n.modified_date:void 0).format(this.translate.instant("WIKI.DATETIME"))}),this.appMetaService.setAll(i,t)},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return e.is_wiki_activated||t.errorHandlingService.permissionDenied(),t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadWiki=function(){var t;return t=this.rs.wiki.getBySlug(this.scope.projectId,this.params.slug),t.then(function(t){return function(e){return t.scope.wiki=e,t.scope.wikiId=e.id,t.scope.wiki}}(this)),t.then(null,function(t){return function(e){var r;return t.scope.wikiId=null,t.scope.project.my_permissions.indexOf("add_wiki_page")===-1?null:(r={project:t.scope.projectId,slug:t.scope.wikiSlug,content:""},t.scope.wiki=t.model.make_model("wiki",r),t.scope.wiki)}}(this))},e.prototype.loadWikiLinks=function(){return this.rs.wiki.listLinks(this.scope.projectId).then(function(t){return function(e){var r,n,i,o,s;for(t.scope.wikiLinks=e,o=t.scope.wikiLinks,r=0,n=o.length;r-1,h=null,g=function(e){var r,l,m,v,y;return d=n.project.my_permissions.indexOf("add_wiki_link")>-1,r=n.project.my_permissions.indexOf("delete_wiki_link")>-1,l=f({wikiLinks:e,projectSlug:n.projectSlug,addWikiLinkPermission:d,deleteWikiLinkPermission:r}),l=u(l)(n),a.off(),d&&h&&h.destroy(),a.html(l),d&&(m=null,y=a.find(".sortable"),h=dragula([y[0]],{direction:"vertical",copySortSource:!1,copy:!1,mirrorContainer:y[0],moves:function(t){return $(t).is("li")}}),h.on("dragend",function(t){var e;return m=$(t),t=m.scope().link,e=m.index(),n.$emit("wiki:links:move",t,e)}),v=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&h.dragging}})),a.on("click",".add-button",function(t){return t.preventDefault(),a.find(".new").removeClass("hidden"),a.find(".new input").focus(),a.find(".add-button").hide()}),a.on("click",".js-delete-link",function(e){var r,o,s,a;return e.preventDefault(),e.stopPropagation(),s=angular.element(e.currentTarget),r=s.parents(".wiki-link").data("id"),a=c.instant("WIKI.DELETE_LIGHTBOX_TITLE"),o=n.wikiLinks[r].title,i.askOnDelete(a,o).then(function(e){return function(e){var o;return o=t.remove(n.wikiLinks[r]),o.then(function(){return o=p.loadWikiLinks(),o.then(function(){return e.finish(),g(n.wikiLinks)}),o.then(null,function(){return e.finish()})}),o.then(null,function(){return e.finish(!1),i.notify("error")})}}(this))}),a.on("keyup",".new input",function(e){var r,u,c,l;return e.preventDefault(),13===e.keyCode?(l=angular.element(e.currentTarget),u=l.val(),r=s().target(a.find(".new")).start(),c=t.create("wiki-links",{project:n.projectId,title:u}),c.then(function(){var t;return o.trackEvent("wikilink","create","create wiki link",1),t=p.loadWikiLinks(),t.then(function(){return r.finish(),a.find(".new").addClass("hidden"),a.find(".new input").val(""),a.find(".add-button").show(),g(n.wikiLinks)}),t.then(null,function(){return r.finish(),a.find(".new").addClass("hidden"),a.find(".new input").val(""),a.find(".add-button").show(),i.notify("error","Error loading wiki links")})}),c.then(null,function(t){var e;return r.finish(),a.find(".new input").val(u),a.find(".new input").focus().select(),null!=(null!=t&&null!=(e=t.__all__)?e[0]:void 0)?i.notify("error","The link already exists"):i.notify("error")})):27===e.keyCode?(l=angular.element(e.currentTarget),a.find(".new").addClass("hidden"),a.find(".new input").val(""),a.find(".add-button").show()):void 0})},e(n,l.ngModel,g))},l=function(t,e,r){return p(t,e,r),t.$on("$destroy",function(){return e.off()})},{link:l}},i.directive("tgWikiNav",["$tgRepo","$log","$tgLocation","$tgConfirm","$tgAnalytics","$tgLoading","$tgTemplate","$compile","$translate",t])}.call(this),function(){var t,e,r,n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;n=this.taiga,e=this.taiga.mixOf,r=angular.module("taigaWiki"),t=function(t){function e(t,e,r,n,i,o,s,a,u,c){var l;this.scope=t,this.rootscope=e,this.repo=r,this.model=n,this.confirm=i,this.rs=o,this.params=s,this.q=a,this.navUrls=u,this.errorHandlingService=c,this.scope.projectSlug=this.params.pslug,this.scope.wikiSlug=this.params.slug,this.scope.wikiTitle=this.scope.wikiSlug,this.scope.sectionName="Wiki",this.scope.linksVisible=!1,l=this.loadInitialData(),l.then(null,this.onInitialDataError.bind(this))}return i(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgModel","$tgConfirm","$tgResources","$routeParams","$q","$tgNavUrls","tgErrorHandlingService"],e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return e.is_wiki_activated||t.errorHandlingService.permissionDenied(),t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadWikiPages=function(){var t;return t=this.rs.wiki.list(this.scope.projectId).then(function(t){return function(e){return t.scope.wikipages=e}}(this))},e.prototype.loadWikiLinks=function(){return this.rs.wiki.listLinks(this.scope.projectId).then(function(t){return function(e){var r,n,i,o,s;for(t.scope.wikiLinks=e,o=t.scope.wikiLinks,r=0,n=o.length;r=this.membersLimit&&(this.canAddUsers=!1),this.showWarningMessage=!this.canAddUsers&&this.project.total_memberships+this.memberInvites.length===this.project.max_memberships},t.prototype.removeSingleMember=function(t){return this.memberInvites.splice(t,1),this.canAddUsers=!0,this.showWarningMessage=1===this.membersLimit},t.prototype.submit=function(){var t;if(this.form.initializeFields(),this.form.reset(),this.form.validate())return this.memberInvites=_.filter(this.memberInvites,function(t){return""!==t.email}),this.submitInvites=!0,t=this.rs.memberships.bulkCreateMemberships(this.project.id,this.memberInvites,this.invitationText),t.then(this._onSuccessInvite.bind(this),this._onErrorInvite.bind(this))},t.prototype._onSuccessInvite=function(){return this.submitInvites=!1,this.rootScope.$broadcast("membersform:new:success"),this.lightboxService.closeAll(),this.confirm.notify("success")},t.prototype._onErrorInvite=function(t){var e;if(this.submitInvites=!1,e={},_.each(t.data.bulk_memberships,function(t){return function(t,r){if(t.email&&(e["email-"+r]=t.email[0]),t.role)return e["role-"+r]=t.role[0]}}(this)),this.form.setErrors(e),t.data._error_message)return this.confirm.notify("error",t.data._error_message)},t}(),u.controller("LbAddMembersController",n),i=function(t){var e;return e=function(e,r,n,i){return t.open(r),i.form=r.find("form").checksley()},{scope:{},bindToController:{project:"="},controller:"LbAddMembersController",controllerAs:"vm",templateUrl:"admin/lightbox-add-members.html",link:e}},u.directive("tgLbAddMembers",["lightboxService",i]),o=function(){return{templateUrl:"admin/memberships-warning-message.html",scope:{project:"="}}},u.directive("tgLightboxAddMembersWarningMessage",[o]),r=function(t,e,r,n){return{link:function(i,o){return t.open(o),i.request=function(){return i.loading=!0,e.projects.transferRequest(i.projectId).then(function(){return i.loading=!1,t.close(o),r.notify("success",n.instant("ADMIN.PROJECT_PROFILE.REQUEST_OWNERSHIP_SUCCESS"))})}},templateUrl:"common/lightbox/lightbox-request-ownership.html"}},u.directive("tgLbRequestOwnership",["lightboxService","tgResources","$tgConfirm","$translate",r]),t=function(){function t(t,e,r,n){this.rs=t,this.lightboxService=e,this.confirm=r,this.translate=n,this.users=[],this.q="",this.commentOpen=!1}return t.prototype.limit=3,t.prototype.normalizeString=function(t){return t=t.replace("Á","A").replace("Ä","A").replace("À","A"),t=t.replace("É","E").replace("Ë","E").replace("È","E"),t=t.replace("Í","I").replace("Ï","I").replace("Ì","I"),t=t.replace("Ó","O").replace("Ö","O").replace("Ò","O"),t=t.replace("Ú","U").replace("Ü","U").replace("Ù","U")},t.prototype.filterUsers=function(t){var e,r;return r=t.full_name_display.toUpperCase(),r=this.normalizeString(r),e=this.q.toUpperCase(),e=this.normalizeString(e),_.includes(r,e)},t.prototype.getUsers=function(){var t;return t=this.users.length||this.q.length?this.users:this.activeUsers,t=t.slice(0,this.limit),t=_.reject(t,{selected:!0}),_.reject(t,{id:this.currentOwnerId})},t.prototype.userSearch=function(){if(this.users=this.activeUsers,this.selected=_.find(this.users,{selected:!0}),this.q)return this.users=_.filter(this.users,this.filterUsers.bind(this))},t.prototype.selectUser=function(t){return this.activeUsers=_.map(this.activeUsers,function(t){return t.selected=!1,t}),t.selected=!0,this.userSearch()},t.prototype.submit=function(){return this.loading=!0,this.rs.projects.transferStart(this.projectId,this.selected.id,this.comment).then(function(t){return function(){var e,r;return t.loading=!1,t.lightboxService.closeAll(),r=t.translate.instant("ADMIN.PROJECT_PROFILE.CHANGE_OWNER_SUCCESS_TITLE"),e=t.translate.instant("ADMIN.PROJECT_PROFILE.CHANGE_OWNER_SUCCESS_DESC"),t.confirm.success(r,e,{type:"svg",name:"icon-speak-up"})}}(this))},t}(),t.$inject=["tgResources","lightboxService","$tgConfirm","$translate"],u.controller("ChangeOwnerLightbox",t),e=function(t,e,r,n){var i;return i=function(e,r){return t.open(r)},{scope:!0,controller:"ChangeOwnerLightbox",controllerAs:"vm",bindToController:{currentOwnerId:"=",projectId:"=",activeUsers:"="},templateUrl:"common/lightbox/lightbox-change-owner.html",link:i}},u.directive("tgLbChangeOwner",["lightboxService","lightboxKeyboardNavigationService","$tgTemplate","$compile",e]),s=function(t){var e;return e=function(e,r){return e.close=function(){return t.close(r)},t.open(r)},{templateUrl:"common/lightbox/lightbox-transfer-project-start-success.html",link:e}},u.directive("tgLbTransferProjectStartSuccess",["lightboxService",s])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p=function(t,e){function r(){this.constructor=t}for(var n in e)f.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},f={}.hasOwnProperty;l=this.taiga,u=this.taiga.mixOf,a=this.taiga.bindMethods,c=angular.module("taigaAdmin"),t=function(t){function e(t,e,r,n,i,o,s,u,c,l,p,f,d,h,g){var m;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=u,this.navUrls=c,this.analytics=l,this.appMetaService=p,this.translate=f,this.auth=d,this.lightboxFactory=h,this.errorHandlingService=g,a(this),this.scope.project={},this.scope.filters={},m=this.loadInitialData(),m.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.MEMBERSHIPS.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),m.then(null,this.onInitialDataError.bind(this)),this.scope.$on("membersform:new:success",function(t){return function(){return t.loadInitialData(),t.analytics.trackEvent("membership","create","create memberships on admin",1)}}(this))}return p(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAnalytics","tgAppMetaService","$translate","$tgAuth","tgLightboxFactory","tgErrorHandlingService"],e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return e.i_am_admin||t.errorHandlingService.permissionDenied(),t.scope.projectId=e.id,t.scope.project=e,t.scope.canAddUsers=null===e.max_memberships||e.max_memberships>e.total_memberships,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadMembers=function(){var t;return t=this.getUrlFilters(),this.rs.memberships.list(this.scope.projectId,t).then(function(t){return function(e){return t.scope.memberships=_.filter(e.models,function(t){return null===t.user||t.is_user_active}),t.scope.page=e.current,t.scope.count=e.count,t.scope.paginatedBy=e.paginatedBy,e}}(this))},e.prototype.loadInitialData=function(){return this.loadProject().then(function(t){return function(){return t.q.all([t.loadMembers(),t.auth.refresh()])}}(this))},e.prototype.getUrlFilters=function(){var t;return t=_.pick(this.location.search(),"page"),t.page||(t.page=1),t},e.prototype.addNewMembers=function(){return this.lightboxFactory.create("tg-lb-add-members",{"class":"lightbox lightbox-add-member",project:"project"},{project:this.scope.project})},e.prototype.showLimitUsersWarningMessage=function(){var t,e,r;return r=this.translate.instant("ADMIN.MEMBERSHIPS.LIMIT_USERS_WARNING"),e=this.translate.instant("ADMIN.MEMBERSHIPS.LIMIT_USERS_WARNING_MESSAGE",{members:this.scope.project.max_memberships}),t="/"+window._version+"/svg/icons/team-question.svg",this.confirm.success(r,e,{name:t,type:"img"})},e}(u(l.Controller,l.PageMixin,l.FiltersMixin)),c.controller("MembershipsController",t),e=function(t,e){var r,n,i;return i=t.get("admin/admin-membership-paginator.html",!0),n=function(t,r,n,o){var s,a,u,c,l,p,f;return a=2,l=4,u=2,c=2,s=r.find(".memberships-paginator"),p=function(){var e;return e=t.count/t.paginatedBy,e=parseInt(e,10)1,h.showNext=!(t.page===d),r=t.page,o=f=1,m=d;1<=m?f<=m:f>=m;o=1<=m?++f:--f)o===r+a&&d>r+a+c?g.push({classes:"dots",type:"dots"}):o===r-l&&r>u+l?g.push({classes:"dots",type:"dots"}):o>r+a&&o<=d-c||ou||(o===r?g.push({classes:"active",num:o,type:"page-active"}):g.push({classes:"page",num:o,type:"page"}));return n=i(h),n=e(n)(t),s.html(n),s.show()},t.$watch("memberships",function(t){if(t)return f()}),r.on("click",".memberships-paginator a.next",function(e){return e.preventDefault(),t.$apply(function(){return o.selectFilter("page",t.page+1),o.loadMembers()})}),r.on("click",".memberships-paginator a.previous",function(e){return e.preventDefault(),t.$apply(function(){return o.selectFilter("page",t.page-1),o.loadMembers()})}),r.on("click",".memberships-paginator li.page > a",function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=n.data("pagenum"),t.$apply(function(){return o.selectFilter("page",r),o.loadMembers()})})},r=function(t,e,r){var i;return i=e.controller(),n(t,e,r,i),t.$on("$destroy",function(){return e.off()})},{link:r}},c.directive("tgMemberships",["$tgTemplate","$compile",e]),i=function(t,e,r,n,i){var o,s;return s=e.get("admin/memberships-row-avatar.html",!0),o=function(e,o,a){var u,c,l;return c=r.instant("ADMIN.MEMBERSHIP.STATUS_PENDING"),l=function(t){var r,a,u;return r=i.getAvatar(t),a={full_name:t.full_name?t.full_name:"",email:t.user_email?t.user_email:t.email,imgurl:r.url,bg:r.bg,pending:t.is_user_active?"":c,isOwner:t.is_owner},u=s(a),u=n(u)(e),o.html(u)},null==a.tgMembershipsRowAvatar?t.error("MembershipsRowAvatarDirective: the directive need a member"):(u=e.$eval(a.tgMembershipsRowAvatar),l(u),e.$on("$destroy",function(){return o.off()}))},{link:o}},c.directive("tgMembershipsRowAvatar",["$log","$tgTemplate","$translate","$compile","tgAvatarService",i]),n=function(t,e,r,n,i){var o,s;return s=n.get("admin/admin-memberships-row-checkbox.html",!0),o=function(n,o,a){var u,c,l;return n.$on("$destroy",function(){return o.off()}),null==a.tgMembershipsRowAdminCheckbox?t.error("MembershipsRowAdminCheckboxDirective: the directive need a member"):(c=n.$eval(a.tgMembershipsRowAdminCheckbox),c.is_owner?void o.find(".js-check").remove():(l=function(t){var e,r;return e={inputId:"is-admin-"+t.id},r=s(e),r=i(r)(n),o.html(r)},o.on("click",":checkbox",function(t){return function(t){var n,i,s;return i=function(){return r.notify("success")},n=function(t){return c.revert(),o.find(":checkbox").prop("checked",c.is_admin),r.notify("error",t.is_admin[0])},s=angular.element(t.currentTarget),c.is_admin=s.prop("checked"),e.save(c).then(i,n)}}(this)),u=l(c),c.is_admin?o.find(":checkbox").prop("checked",!0):void 0))},{link:o}},c.directive("tgMembershipsRowAdminCheckbox",["$log","$tgRepo","$tgConfirm","$tgTemplate","$compile",n]),o=function(t,e,r){var n,i;return i=_.template(''),n=function(n,o,s){var a,u,c,l;return l=function(t){var e,r;return e={roleList:n.project.roles,selectedRole:t.role},r=i(e),o.html(r)},null==s.tgMembershipsRowRoleSelector?t.error("MembershipsRowRoleSelectorDirective: the directive need a member"):(a=o.controller(),c=n.$eval(s.tgMembershipsRowRoleSelector),u=l(c),o.on("change","select",function(t){return function(t){var n,i,o,s;if(o=function(){return r.notify("success")},i=function(){return r.notify("error")},s=angular.element(t.currentTarget),n=parseInt(s.val(),10),c.role!==n)return c.role=n,e.save(c).then(o,i)}}(this)),n.$on("$destroy",function(){return o.off()}))},{link:n}},c.directive("tgMembershipsRowRoleSelector",["$log","$tgRepo","$tgConfirm",o]),r=function(t,e,r,n,i,o,s,a,u){var c,l,p;return c='
\n
\n
\n \n',p='\n\n\n \n',l=function(l,f,d){var h,g,m,v;return v=function(t){var e;return e=t.user?i(c)(l):i(p)(l),f.html(e)},null==d.tgMembershipsRowActions?t.error("MembershipsRowActionsDirective: the directive need a member"):(h=f.controller(),m=l.$eval(d.tgMembershipsRowActions),v(m),f.on("click",".js-resend",function(t){var e,i;return t.preventDefault(),i=function(){var t;return t=o.instant("ADMIN.MEMBERSHIP.SUCCESS_SEND_INVITATION",{email:l.member.email}),n.notify("success",t)},e=function(){var t;return t=o.instant("ADMIM.MEMBERSHIP.ERROR_SEND_INVITATION"),n.notify("error",t)},r.memberships.resendInvitation(l.member.id).then(i,e)}),g=function(){var t,r,i;return i=o.instant("ADMIN.MEMBERSHIP.DELETE_MEMBER"),t=o.instant("ADMIN.MEMBERSHIP.DEFAULT_DELETE_MESSAGE",{email:m.email}),r=m.user?m.full_name:t,n.askOnDelete(i,r).then(function(t){var i,u;return u=function(e){return function(){var e;return t.finish(),m.user!==l.user.id?(l.page>1&&l.count-1<=l.paginatedBy&&h.selectFilter("page",l.page-1),h.loadInitialData()):s.path(a.resolve("home")),e=o.instant("ADMIN.MEMBERSHIP.SUCCESS_DELETE",{message:r}),n.notify("success",e,null,5e3)}}(this),i=function(e){return function(){var e;return t.finish(!1),e=o.instant("ADMIN.MEMBERSHIP.ERROR_DELETE",{message:r}),n.notify("error",e)}}(this),e.remove(m).then(u,i)})},f.on("click",".delete",function(t){var e;return t.preventDefault(),l.project.owner.id===m.user?(e=l.user.id===m.user,u.create("tg-lightbox-leave-project-warning",{"class":"lightbox lightbox-leave-project-warning"},{isCurrentUser:e,project:l.project})):g()}),l.$on("$destroy",function(){return f.off()}))},{link:l}},c.directive("tgMembershipsRowActions",["$log","$tgRepo","$tgResources","$tgConfirm","$compile","$translate","$tgLocation","$tgNavUrls","tgLightboxFactory",r]),s=function(){return{templateUrl:"admin/no-more-memberships-explanation.html",scope:{project:"="}}},c.directive("tgNoMoreMembershipsExplanation",[s])}.call(this),function(){var t,e;t=function(){var t;return t=function(t,e,r){var n;return n=r.tgAdminNavigation,e.find(".active").removeClass("active"),e.find("#adminmenu-"+n+" a").addClass("active"),t.$on("$destroy",function(){return e.off()})},{link:t}},e=angular.module("taigaAdmin"),e.directive("tgAdminNavigation",t)}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g,m,v,y,b,S,k,$,j,I,E,T,C,w=function(t,e){function r(){this.constructor=t}for(var n in e)O.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},O={}.hasOwnProperty,A=function(t,e){return function(){return t.apply(e,arguments)}};E=this.taiga,j=this.taiga.mixOf,C=this.taiga.trim,T=this.taiga.toString,$=this.taiga.joinStr,k=this.taiga.groupBy,b=this.taiga.bindOnce,S=this.taiga.debounce,I=angular.module("taigaAdmin"),v=function(t){function e(t,e,r,n,i,o,s,a,u,c,l,p,f,d){var h;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=u,this.appMetaService=c,this.translate=l,this.tgAuth=p,this.currentUserService=f,this.errorHandlingService=d,this.scope.project={},h=this.loadInitialData(),this.scope.projectTags=[],h.then(function(t){return function(){var e,r,n;return r=t.translate.instant(t.scope.sectionName),n=t.translate.instant("ADMIN.PROJECT_PROFILE.PAGE_TITLE",{sectionName:r,projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(n,e),t.fillUsersAndRoles(t.scope.project.members,t.scope.project.roles)}}(this)),h.then(null,this.onInitialDataError.bind(this)),this.scope.$on("project:loaded",function(t){return function(){var e,r,n;return r=t.translate.instant(t.scope.sectionName),n=t.translate.instant("ADMIN.PROJECT_PROFILE.PAGE_TITLE",{sectionName:r,projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(n,e)}}(this))}return w(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","tgAppMetaService","$translate","$tgAuth","tgCurrentUserService","tgErrorHandlingService"],e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return e.i_am_admin||t.errorHandlingService.permissionDenied(),t.scope.projectId=e.id,t.scope.project=e,t.scope.epicStatusList=_.sortBy(e.epic_statuses,"order"),t.scope.usStatusList=_.sortBy(e.us_statuses,"order"),t.scope.pointsList=_.sortBy(e.points,"order"),t.scope.taskStatusList=_.sortBy(e.task_statuses,"order"),t.scope.issueTypesList=_.sortBy(e.issue_types,"order"),t.scope.issueStatusList=_.sortBy(e.issue_statuses,"order"),t.scope.prioritiesList=_.sortBy(e.priorities,"order"),t.scope.severitiesList=_.sortBy(e.severities,"order"),t.scope.$emit("project:loaded",e),t.scope.projectTags=_.map(t.scope.project.tags,function(e){return[e,t.scope.project.tags_colors[e]]}),e}}(this))},e.prototype.loadInitialData=function(){return this.q.all([this.loadProject(),this.tgAuth.refresh()])},e.prototype.openDeleteLightbox=function(){return this.rootscope.$broadcast("deletelightbox:new",this.scope.project)},e.prototype.addTag=function(t,e){var r;return r=_.clone(this.scope.project.tags),r.push(t),this.scope.projectTags.push([t,null]),this.scope.project.tags=r},e.prototype.deleteTag=function(t){var e;return e=_.clone(this.scope.project.tags),_.pull(e,t[0]),_.remove(this.scope.projectTags,function(e){return function(e){return e[0]===t[0]}}(this)),this.scope.project.tags=e},e}(j(E.Controller,E.PageMixin)),I.controller("ProjectProfileController",v),y=function(t,e,r,n,i,o,s){var a;return a=function(a,u,c){var l,p,f,d;return l=u.controller(),p=u.find("form").checksley({onlyOneErrorElement:!0}),f=S(2e3,function(u){return function(u){var c,f;if(u.preventDefault(),p.validate())return c=r().target(d).start(),f=t.save(a.project),f.then(function(){var t;return c.finish(),e.notify("success"),t=n.resolve("project-admin-project-profile-details",{project:a.project.slug}),i.path(t),l.loadInitialData(),o.fetchProject(),s.loadProjects()}),f.then(null,function(t){if(c.finish(),p.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),d=u.find(".submit-button"),u.on("submit","form",f)},{link:a}},I.directive("tgProjectProfile",["$tgRepo","$tgConfirm","$tgLoading","$tgNavUrls","$tgLocation","tgProjectService","tgCurrentUserService",y]),f=function(t,e,r){var n;return n=function(n,i,o){var s,a,u;return s=i.find("form").checksley({onlyOneErrorElement:!0}),a=S(2e3,function(i){return function(i){var o,a;if(i.preventDefault(),s.validate())return o=r().target(u).start(),a=t.save(n.project),a.then(function(){return o.finish(),e.notify("success")}),a.then(null,function(t){if(o.finish(),s.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=i.find(".submit-button"),i.on("submit","form",a),n.$on("$destroy",function(){return i.off()})},{link:n}},I.directive("tgProjectDefaultValues",["$tgRepo","$tgConfirm","$tgLoading",f]),m=function(t,e,r,n){var i;return i=function(r,i,o){var s;return s=function(o){return function(){var o,s;if(o=i.find("form").checksley(),o.initializeFields(),o.reset(),o.validate())return s=t.save(r.project),s.then(function(){return r.$emit("project:loaded",r.project),e.notify("success"),n.fetchProject()}),s.then(null,function(t){if(o.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this),i.on("change",".module-activation.module-direct-active input",function(t){return t.preventDefault(),r.$applyAsync(s)}),i.on("submit","form",function(t){return t.preventDefault(),s()}),i.on("click",".save",function(t){return t.preventDefault(),s()}),i.on("keydown",".videoconference-attributes input",function(t){return 32!==t.which}),r.$watch("project.videoconferences",function(t,e){if(null!=t&&null!=e&&t!==e)return r.project.videoconferences_extra_data=""}),r.$watch("isVideoconferenceActivated",function(t,e){if(t===!1&&(r.project.videoconferences=null,r.project.videoconferences_extra_data="",e===!0))return s()}),r.$watch("project",function(t){return null!=t.videoconferences?r.isVideoconferenceActivated=!0:r.isVideoconferenceActivated=!1})},{link:i}},I.directive("tgProjectModules",["$tgRepo","$tgConfirm","$tgLoading","tgProjectService",m]),d=function(t,e,r,n){var i;return i=function(i,o,s){var a,u,c,l,p,f,d,h,g,m,v,y,_,b,k,$,j,I,E,T,C,w,O,A,R,P;return u=o.find(".admin-project-export-buttons"),I=function(){return u.removeClass("hidden")},l=function(){return u.addClass("hidden")},g=o.find(".admin-project-export-result"),O=function(){return g.removeClass("hidden")},p=function(){return g.addClass("hidden")},R=o.find(".spin"),A=function(){return R.removeClass("hidden")},f=function(){return R.addClass("hidden")},v=o.find(".result-title"),h=n.instant("ADMIN.PROJECT_EXPORT.LOADING_TITLE"),d=n.instant("ADMIN.PROJECT_EXPORT.LOADING_MESSAGE"),c=function(){return v.html(n.instant("ADMIN.PROJECT_EXPORT.DUMP_READY"))},a=function(){return v.html(n.instant("ADMIN.PROJECT_EXPORT.ASYNC_MESSAGE"))},P=function(t){return v.html(n.instant("ADMIN.PROJECT_EXPORT.SYNC_MESSAGE",{url:t}))},k=function(){return v.html(h)},_=function(){return v.html(d)},j=function(){return v.html(c)},m=o.find(".result-message "),b=function(){return m.html(d)},y=function(){return m.html(a)},$=function(t){return m.html(P(t))},w=function(){return A(),k(),b(),l(),O()},T=function(){return f(),_(),y()},C=function(t){return f(),j(),$(t)},E=function(){return f(),p(),I()},o.on("click","a.button-export",S(2e3,function(o){return function(o){var s,a;return o.preventDefault(),a=function(e){var r;return 202===e.status?T():(r=e.data.url,C(r),t.open(r,"_blank"))},s=function(t){var e,i;return E(),e=n.instant("ADMIN.PROJECT_EXPORT.ERROR"),429===t.status?e=n.instant("ADMIN.PROJECT_EXPORT.ERROR_BUSY"):(null!=(i=t.data)?i._error_message:void 0)&&(e=n.instant("ADMIN.PROJECT_EXPORT.ERROR_BUSY",{message:t.data._error_message})),r.notify("error",e)},w(),e.projects["export"](i.projectId).then(a,s)}}(this)))},{link:i}},I.directive("tgProjectExport",["$window","$tgResources","$tgConfirm","$translate",d]),i=function(t){function e(t,e,r,n,i,o){this.scope=t,this.rootscope=e,this.urls=r,this.confirm=n,this.rs=i,this.translate=o,this._generateUuid=A(this._generateUuid,this),this.setCsvUuid=A(this.setCsvUuid,this),this.rootscope.$on("project:loaded",this.setCsvUuid),this.scope.$watch("csvUuid",function(t){return function(e){return e?t.scope.csvUrl=t.urls.resolveAbsolute(t.type+"-csv",e):t.scope.csvUrl=""}}(this))}return w(e,t),e.$inject=["$scope","$rootScope","$tgUrls","$tgConfirm","$tgResources","$translate"],e.prototype.setCsvUuid=function(){return this.scope.csvUuid=this.scope.project[this.type+"_csv_uuid"]},e.prototype._generateUuid=function(t){var e;return null==t&&(t=null),e=this.rs.projects["regenerate_"+this.type+"_csv_uuid"](this.scope.projectId),e.then(function(t){return function(e){var r;return t.scope.csvUuid=null!=(r=e.data)?r.uuid:void 0}}(this)),e.then(null,function(t){return function(){return t.confirm.notify("error")}}(this)),e["finally"](function(){if(t)return t.finish()}),e},e.prototype.regenerateUuid=function(){var t,e;return this.scope.csvUuid?(e=this.translate.instant("ADMIN.REPORTS.REGENERATE_TITLE"),t=this.translate.instant("ADMIN.REPORTS.REGENERATE_SUBTITLE"),this.confirm.ask(e,t).then(this._generateUuid)):this._generateUuid()},e}(E.Controller),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="epics",e}(i),u=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="userstories",e}(i),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="tasks",e}(i),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="issues",e}(i),I.controller("CsvExporterEpicsController",o),I.controller("CsvExporterUserstoriesController",u),I.controller("CsvExporterTasksController",a),I.controller("CsvExporterIssuesController",s),n=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_EPIC"},{controller:"CsvExporterEpicsController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvEpic",["$translate",n]),p=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_US"},{controller:"CsvExporterUserstoriesController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvUs",["$translate",p]),l=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_TASK"},{controller:"CsvExporterTasksController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvTask",["$translate",l]),c=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_ISSUE"},{controller:"CsvExporterIssuesController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvIssue",["$translate",c]),h=function(t,e,r,n){var i;return i=function(t,i,o){var s,a,u;return u=function(){return i.find(".size-info").addClass("active")},a=function(r){var o;return o=e.make_model("projects",r.data),t.project=o,i.find(".loading-overlay").removeClass("active"),n.notify("success")},s=function(t){return 413===t.status&&u(),i.find(".loading-overlay").removeClass("active"),n.notify("error",t.data._error_message)},i.on("click",".js-change-logo",function(){return i.find("#logo-field").click()}),i.on("change","#logo-field",function(e){if(t.logoAttachment)return i.find(".loading-overlay").addClass("active"),r.projects.changeLogo(t.project.id,t.logoAttachment).then(a,s)}),i.on("click","a.js-use-default-logo",function(e){return i.find(".loading-overlay").addClass("active"),r.projects.removeLogo(t.project.id).then(a,s)}),t.$on("$destroy",function(){return i.off()})},{link:i}},I.directive("tgProjectLogo",["$tgAuth","$tgModel","$tgResources","$tgConfirm",h]),g=function(t){var e;return e=function(e,r,n){var i,o;return i=t(n.tgProjectLogoModel),o=i.assign,r.bind("change",function(){return e.$apply(function(){return o(e,r[0].files[0])})})},{link:e}},I.directive("tgProjectLogoModel",["$parse",g]),r=function(){return{scope:{project:"="},templateUrl:"admin/admin-project-restrictions.html"}},I.directive("tgAdminProjectRestrictions",[r]),e=function(t){return{link:function(e){return e.requestOwnership=function(){return t.create("tg-lb-request-ownership",{"class":"lightbox lightbox-request-ownership"},{projectId:e.projectId})}},scope:{projectId:"=",owner:"="},templateUrl:"admin/admin-project-request-ownership.html"}},I.directive("tgAdminProjectRequestOwnership",["tgLightboxFactory",e]),t=function(t){return{link:function(e){return e.changeOwner=function(){return t.create("tg-lb-change-owner",{"class":"lightbox lightbox-select-user","project-id":"projectId","active-users":"activeUsers","current-owner-id":"currentOwnerId"},{projectId:e.projectId,activeUsers:e.activeUsers,currentOwnerId:e.owner.id,members:e.members})}},scope:{activeUsers:"=",projectId:"=",owner:"=",members:"="},templateUrl:"admin/admin-project-change-owner.html"}},I.directive("tgAdminProjectChangeOwner",["tgLightboxFactory",t])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g,m,v,y,b,S,k,j,I=function(t,e){function r(){this.constructor=t}for(var n in e)E.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},E={}.hasOwnProperty,T=function(t,e){return function(){return t.apply(e,arguments)}};S=this.taiga,y=this.taiga.mixOf,j=this.taiga.trim,k=this.taiga.toString,v=this.taiga.joinStr,m=this.taiga.groupBy,d=this.taiga.bindOnce,h=this.taiga.debounce,g=this.taiga.getDefaulColorList,b=angular.module("taigaAdmin"),c=function(t){function e(t,e,r,n,i,o,s,a,u,c,l,p){var f;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=u,this.appMetaService=c,this.translate=l,this.errorHandlingService=p,this.scope.project={},f=this.loadInitialData(),f.then(function(t){return function(){var e,r,n;return r=t.translate.instant(t.scope.sectionName),n=t.translate.instant("ADMIN.PROJECT_VALUES.PAGE_TITLE",{sectionName:r,projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(n,e)}}(this)),f.then(null,this.onInitialDataError.bind(this))}return I(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","tgAppMetaService","$translate","tgErrorHandlingService"],e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return e.i_am_admin||t.errorHandlingService.permissionDenied(),t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject()},e}(y(S.Controller,S.PageMixin)),b.controller("ProjectValuesSectionController",c),a=function(t){function e(t,e,r,n,i){this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.moveValue=T(this.moveValue,this),this.loadValues=T(this.loadValues,this),this.scope.$on("admin:project-values:move",this.moveValue),this.rootscope.$on("project:loaded",this.loadValues)}return I(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources"],e.prototype.loadValues=function(){return this.rs[this.scope.resource].listValues(this.scope.projectId,this.scope.type).then(function(t){return function(e){return t.scope.values=e,t.scope.maxValueOrder=_.maxBy(e,"order").order,e}}(this))},e.prototype.moveValue=function(t,e,r){var n,i;return i=this.scope.values,n=i.indexOf(e),i.splice(n,1),i.splice(r,0,e),_.each(i,function(t,e){return t.order=e}),this.repo.saveAll(i)},e}(S.Controller),b.controller("ProjectValuesController",a),u=function(t,e,r,n,i,o,s){var a,u,c;return u=function(t,e,r){var n,i,o,s,a,u;return s=null,o=null,i=null,u=e.find(".sortable"),n=dragula([u[0]],{direction:"vertical",copySortSource:!1,copy:!1,mirrorContainer:u[0],moves:function(t){return $(t).is("div[tg-bind-scope]")}}),n.on("dragend",function(e){var r,n;return i=$(e),n=i.scope().value,r=i.index(),t.$broadcast("admin:project-values:move",n,r)}),a=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&n.dragging}}),t.$on("$destroy",function(){return e.off(),n.destroy()})},c=function(t,n,i){var a,u,c,l,p,f,d,g,m;return a=n.controller(),m=i.type,f=i.objname,l=function(){return t.newValue={name:"",is_closed:!1,is_archived:!1}},p=function(){return t.addNewElementText=o.instant("ADMIN.PROJECT_VALUES_"+f.toUpperCase()+".ACTION_ADD")},l(),p(),s.$on("$translateChangeEnd",function(){return t.$evalAsync(p)}),c=function(t){return function(t){var e;if(null==t&&(t=!1),e=n.find(".table-main"),$(document.body).scrollTop(e.offset().top+e.height()),t)return n.find(".new-value input:visible").first().focus()}}(this),g=function(t){var r,n,i,o;if(n=t.parents("form"),r=n.checksley(),r.validate())return o=n.scope().value,i=e.save(o),i.then(function(e){return function(){var e;return e=t.parents(".row.table-main"),e.addClass("hidden"),e.siblings(".visualization").removeClass("hidden")}}(this)),i.then(null,function(t){return r.setErrors(t)})},d=function(r){var n,i,o;if(i=r.parents("form"),n=i.checksley(),n.validate())return t.newValue.project=t.project.id,t.newValue.order=t.maxValueOrder?t.maxValueOrder+1:1,o=e.create(m,t.newValue),o.then(function(e){ return function(e){return r.addClass("hidden"),t.values.push(e),t.maxValueOrder=e.order,l()}}(this)),o.then(null,function(t){return n.setErrors(t)})},u=function(e){var r,n,i;return n=e.parents(".row.table-main"),r=e.parents("form"),i=r.scope().value,t.$apply(function(){return n.addClass("hidden"),i.revert(),n.siblings(".visualization").removeClass("hidden")})},n.on("click",".show-add-new",function(t){return t.preventDefault(),n.find(".new-value").removeClass("hidden"),c(!0)}),n.on("click",".add-new",h(2e3,function(t){var e;return t.preventDefault(),e=n.find(".new-value"),d(e)})),n.on("click",".delete-new",function(t){return t.preventDefault(),n.find(".new-value").addClass("hidden"),l()}),n.on("click",".edit-value",function(t){var e,r,n;return t.preventDefault(),n=angular.element(t.currentTarget),r=n.parents(".row.table-main"),r.addClass("hidden"),e=r.siblings(".edition"),e.removeClass("hidden"),e.find("input:visible").first().focus().select()}),n.on("keyup",".new-value input",function(t){var e;return 13===t.keyCode?(e=n.find(".new-value"),d(e)):27===t.keyCode?(n.find(".new-value").addClass("hidden"),l()):void 0}),n.on("click",".save",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),g(e)}),n.on("click",".cancel",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),u(e)}),n.on("click",".delete-value",function(n){var i,s,u,c,l,p,f;return n.preventDefault(),c=angular.element(n.currentTarget),s=c.parents("form"),f=s.scope().value,i={},_.each(t.values,function(t){if(f.id!==t.id)return i[t.id]=t.name}),u=f.name,0===_.keys(i).length?r.error(o.instant("ADMIN.PROJECT_VALUES.ERROR_DELETE_ALL")):(p=o.instant("ADMIN.COMMON.TITLE_ACTION_DELETE_VALUE"),l=o.instant("ADMIN.PROJECT_VALUES.REPLACEMENT"),r.askChoice(p,u,i,l).then(function(t){var n,i;return i=function(){return a.loadValues()["finally"](function(){return t.finish()})},n=function(){return r.notify("error")},e.remove(f,{moveTo:t.selected}).then(i,n)}))})},a=function(t,e,r){return u(t,e,r),c(t,e,r),t.$on("$destroy",function(){return e.off()})},{link:a}},b.directive("tgProjectValues",["$log","$tgRepo","$tgConfirm","$tgLocation","animationFrame","$translate","$rootScope",u]),t=function(){var t;return t=function(t,e,r,n){var i;return t.colorList=g(),t.allowEmpty=!1,r.tgAllowEmpty&&(t.allowEmpty=!0),i=e.controller(),t.$watch(r.ngModel,function(e){return t.color=e.color}),e.on("click",".current-color",function(t){var r,n;return t.preventDefault(),t.stopPropagation(),n=angular.element(t.currentTarget),$(".select-color").hide(),n.siblings(".select-color").show(),r=angular.element("body"),r.on("click",function(t){return function(t){if(0===angular.element(t.target).parent(".select-color").length)return e.find(".select-color").hide(),r.unbind("click")}}(this))}),e.on("click",".select-color .color",function(r){var i;return r.preventDefault(),i=angular.element(r.currentTarget),t.$apply(function(){return n.$modelValue.color=i.data("color")}),e.find(".select-color").hide()}),e.on("click",".select-color .selected-color",function(r){return r.preventDefault(),t.$apply(function(){return n.$modelValue.color=t.color}),e.find(".select-color").hide()}),e.on("keyup","input",function(r){return r.stopPropagation(),13===r.keyCode?(t.$apply(function(){return n.$modelValue.color=t.color}),e.find(".select-color").hide()):27===r.keyCode?e.find(".select-color").hide():void 0}),t.$on("$destroy",function(){return e.off()})},{link:t,require:"ngModel"}},b.directive("tgColorSelection",t),l="text",r="multiline",e="date",f="url",p=[{key:l,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_TEXT"},{key:r,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_MULTI"},{key:e,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_DATE"},{key:f,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_URL"}],n=function(t){function e(t,e,r,n,i,o,s,a,u,c){this.scope=t,this.rootscope=e,this.repo=r,this.rs=n,this.params=i,this.q=o,this.location=s,this.navUrls=a,this.appMetaService=u,this.translate=c,this.moveCustomAttributes=T(this.moveCustomAttributes,this),this.deleteCustomAttribute=T(this.deleteCustomAttribute,this),this.saveCustomAttribute=T(this.saveCustomAttribute,this),this.createCustomAttribute=T(this.createCustomAttribute,this),this.loadCustomAttributes=T(this.loadCustomAttributes,this),this.scope.TYPE_CHOICES=p,this.scope.project={},this.rootscope.$on("project:loaded",function(t){return function(){var e,r,n;return t.loadCustomAttributes(),r=t.translate.instant(t.scope.sectionName),n=t.translate.instant("ADMIN.CUSTOM_ATTRIBUTES.PAGE_TITLE",{sectionName:r,projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(n,e)}}(this))}return I(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","tgAppMetaService","$translate"],e.prototype.loadCustomAttributes=function(){return this.rs.customAttributes[this.scope.type].list(this.scope.projectId).then(function(t){return function(e){var r;return t.scope.customAttributes=e,t.scope.maxOrder=null!=(r=_.maxBy(e,"order"))?r.order:void 0,e}}(this))},e.prototype.createCustomAttribute=function(t){return this.repo.create("custom-attributes/"+this.scope.type,t)},e.prototype.saveCustomAttribute=function(t){return this.repo.save(t)},e.prototype.deleteCustomAttribute=function(t){return this.repo.remove(t)},e.prototype.moveCustomAttributes=function(t,e){var r,n;return r=this.scope.customAttributes,n=r.indexOf(t),r.splice(n,1),r.splice(e,0,t),_.each(r,function(t,e){return t.order=e}),this.repo.saveAll(r)},e}(y(S.Controller,S.PageMixin)),b.controller("ProjectCustomAttributesController",n),i=function(t,e,r,n){var i;return i=function(t,r,i){var o,s,a,u,c,l,p,f,d,g,m,v,y,_,b,S,k,j;return o=r.controller(),t.$on("$destroy",function(){return r.off()}),k=r.find(".js-sortable"),l=dragula([k[0]],{direction:"vertical",copySortSource:!1,copy:!1,mirrorContainer:k[0],moves:function(t){return $(t).is("div[tg-bind-scope]")}}),l.on("dragend",function(t){var e,r,n;return r=$(t),e=r.scope().attr,n=r.index(),o.moveCustomAttributes(e,n)}),b=function(){return r.find(".js-new-custom-field").removeClass("hidden"),r.find(".js-new-custom-field input:visible").first().focus()},d=function(){return r.find(".js-new-custom-field").addClass("hidden")},y=function(){return r.find(".js-add-custom-field-button").removeClass("hidden")},p=function(){return r.find(".js-add-custom-field-button").addClass("hidden")},_=function(){return r.find(".js-cancel-new-custom-field-button").removeClass("hidden")},f=function(){return r.find(".js-cancel-new-custom-field-button").addClass("hidden")},m=function(){return t.newAttr={}},u=function(r){var n,i,s,a;if(i=r.checksley(),i.validate())return a=function(t){return function(){return o.loadCustomAttributes(),d(),m(),e.notify("success")}}(this),s=function(t){return function(t){return i.setErrors(t)}}(this),n=t.newAttr,n.project=t.projectId,n.order=t.maxOrder?t.maxOrder+1:1,o.createCustomAttribute(n).then(a,s)},s=function(){return d(),m()},t.$watch("customAttributes",function(t){if(t)return 0===t.length?(f(),p(),b()):(d(),y(),_())}),r.on("click",".js-add-custom-field-button",function(t){return t.preventDefault(),b()}),r.on("click",".js-create-custom-field-button",h(2e3,function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),u(e)})),r.on("click",".js-cancel-new-custom-field-button",function(t){return t.preventDefault(),s()}),r.on("keyup",".js-new-custom-field input",function(t){var e,r;return 13===t.keyCode?(r=angular.element(t.currentTarget),e=r.closest("form"),u(e)):27===t.keyCode?s():void 0}),S=function(t){return t.find(".js-view-custom-field").addClass("hidden"),t.find(".js-edit-custom-field").removeClass("hidden"),t.find(".js-edit-custom-field input:visible").first().focus().select()},g=function(t){return t.find(".js-edit-custom-field").addClass("hidden"),t.find(".js-view-custom-field").removeClass("hidden")},v=function(e){return t.$apply(function(){return e.scope().attr.revert()})},j=function(t){var r,n,i,s;if(n=t.checksley(),n.validate())return s=function(r){return function(){return o.loadCustomAttributes(),g(t),e.notify("success")}}(this),i=function(t){return function(t){return n.setErrors(t)}}(this),r=t.scope().attr,o.saveCustomAttribute(r).then(s,i)},a=function(t){return g(t),v(t)},r.on("click",".js-edit-custom-field-button",function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),S(e)}),r.on("click",".js-update-custom-field-button",h(2e3,function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),j(e)})),r.on("click",".js-cancel-edit-custom-field-button",function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),a(e)}),r.on("keyup",".js-edit-custom-field input",function(t){var e,r;return 13===t.keyCode?(r=angular.element(t.currentTarget),e=r.closest("form"),j(e)):27===t.keyCode?(r=angular.element(t.currentTarget),e=r.closest("form"),a(e)):void 0}),c=function(t){var r,i,s,a;return r=t.scope().attr,i=r.name,a=n.instant("COMMON.CUSTOM_ATTRIBUTES.DELETE"),s=n.instant("COMMON.CUSTOM_ATTRIBUTES.CONFIRM_DELETE"),e.ask(a,s,i).then(function(t){var n,s;return s=function(){return o.loadCustomAttributes()["finally"](function(){return t.finish()})},n=function(){return e.notify("error",null,"We have not been able to delete '"+i+"'.")},o.deleteCustomAttribute(r).then(s,n)})},r.on("click",".js-delete-custom-field-button",h(2e3,function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),c(e)}))},{link:i}},b.directive("tgProjectCustomAttributes",["$log","$tgConfirm","animationFrame","$translate",i]),o=function(t){function e(t,e,r,n,i,o){this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.model=o,this.mixingClass=T(this.mixingClass,this),this.cancelMixingTags=T(this.cancelMixingTags,this),this.confirmMixingTags=T(this.confirmMixingTags,this),this.toggleMixingFromTags=T(this.toggleMixingFromTags,this),this.startMixingTags=T(this.startMixingTags,this),this.deleteTag=T(this.deleteTag,this),this.editTag=T(this.editTag,this),this.createTag=T(this.createTag,this),this.filterAndSortTags=T(this.filterAndSortTags,this),this.loadTags=T(this.loadTags,this),this.loading=!0,this.rootscope.$on("project:loaded",this.loadTags)}return I(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$tgModel"],e.prototype.loadTags=function(){return this.rs.projects.tagsColors(this.scope.projectId).then(function(t){return function(e){return t.scope.projectTagsAll=_.map(e.getAttrs(),function(e,r){return t.model.make_model("tag",{name:r,color:e})}),t.filterAndSortTags(),t.loading=!1}}(this))},e.prototype.filterAndSortTags=function(){return this.scope.projectTags=_.filter(_.sortBy(this.scope.projectTagsAll,"name"),function(t){return function(e){return e.name.indexOf(t.scope.tagsFilter.name)!==-1}}(this))},e.prototype.createTag=function(t,e){return this.rs.projects.createTag(this.scope.projectId,t,e)},e.prototype.editTag=function(t,e,r){return t===e&&(e=null),this.rs.projects.editTag(this.scope.projectId,t,e,r)},e.prototype.deleteTag=function(t){return this.scope.loadingDelete=!0,this.rs.projects.deleteTag(this.scope.projectId,t)["finally"](function(t){return function(){return t.scope.loadingDelete=!1}}(this))},e.prototype.startMixingTags=function(t){return this.scope.mixingTags.toTag=t.name},e.prototype.toggleMixingFromTags=function(t){var e;if(t.name!==this.scope.mixingTags.toTag)return e=this.scope.mixingTags.fromTags.indexOf(t.name),e===-1?this.scope.mixingTags.fromTags.push(t.name):this.scope.mixingTags.fromTags.splice(e,1)},e.prototype.confirmMixingTags=function(){var t,e;return e=this.scope.mixingTags.toTag,t=this.scope.mixingTags.fromTags,this.scope.loadingMixing=!0,this.rs.projects.mixTags(this.scope.projectId,e,t).then(function(t){return function(){return t.cancelMixingTags(),t.loadTags()}}(this))["finally"](function(t){return function(){return t.scope.loadingMixing=!1}}(this))},e.prototype.cancelMixingTags=function(){return this.scope.mixingTags.toTag=null,this.scope.mixingTags.fromTags=[]},e.prototype.mixingClass=function(t){if(null!==this.scope.mixingTags.toTag){if(t.name===this.scope.mixingTags.toTag)return"mixing-tags-to";if(this.scope.mixingTags.fromTags.indexOf(t.name)!==-1)return"mixing-tags-from"}},e}(S.Controller),b.controller("ProjectTagsController",o),s=function(t,e,r,n,i,o,s){var a;return a=function(t,e,n){var i,a,u,c,l,p,f,d,g,m,v,y;return a=$(window),i=e.controller(),y=n.type,g=n.objname,p=function(){return t.newValue={tag:"",color:""}},f=function(){return t.tagsFilter={name:""}},l=function(){return t.mixingTags={toTag:null,fromTags:[]}},d=function(){return t.addNewElementText=o.instant("ADMIN.PROJECT_VALUES_TAGS.ACTION_ADD")},p(),f(),l(),d(),s.$on("$translateChangeEnd",function(){return t.$evalAsync(d)}),c=function(t){return function(t){var r;if(null==t&&(t=!1),r=e.find(".table-main"),$(document.body).scrollTop(r.offset().top+r.height()),t)return e.find(".new-value input:visible").first().focus()}}(this),v=function(e){return function(e){var r,n,o,s,a;if(n=e.parents("form"),r=n.checksley(),r.validate())return a=n.scope().tag,o=a.clone(),o.revert(),t.loadingEdit=!0,s=i.editTag(o.name,a.name,a.color),s.then(function(){return i.loadTags().then(function(){var r;return r=e.parents(".row.table-main"),r.addClass("hidden"),t.loadingEdit=!1,r.siblings(".visualization").removeClass("hidden")})}),s.then(null,function(e){return t.loadingEdit=!1,r.setErrors(e.data)})}}(this),m=function(e){return function(e){var r,n,o;if(n=e.parents("form"),n=e,r=n.checksley(),r.validate())return t.loadingCreate=!0,o=i.createTag(t.newValue.tag,t.newValue.color),o.then(function(r){return i.loadTags().then(function(){return t.loadingCreate=!1,e.addClass("hidden"),p()})}),o.then(null,function(e){return t.loadingCreate=!1,r.setErrors(e.data)})}}(this),u=function(e){var r,n,i;return n=e.parents(".row.table-main"),r=e.parents("form"),i=r.scope().tag,t.$apply(function(){return n.addClass("hidden"),i.revert(),n.siblings(".visualization").removeClass("hidden")})},t.$watch("tagsFilter.name",function(t){return i.filterAndSortTags()}),a.on("keyup",function(e){if(27===e.keyCode)return t.$apply(function(){return l()})}),e.on("click",".show-add-new",function(t){return t.preventDefault(),e.find(".new-value").removeClass("hidden")}),e.on("click",".add-new",h(2e3,function(t){var r;return t.preventDefault(),r=e.find(".new-value"),m(r)})),e.on("click",".delete-new",function(t){return t.preventDefault(),e.find(".new-value").addClass("hidden"),p()}),e.on("click",".mix-tags",function(e){var r;return e.preventDefault(),r=angular.element(e.currentTarget),t.$apply(function(){return i.startMixingTags(r.parents("form").scope().tag)})}),e.on("click",".mixing-row",function(e){var r;return e.preventDefault(),r=angular.element(e.currentTarget),t.$apply(function(){return i.toggleMixingFromTags(r.parents("form").scope().tag)})}),e.on("click",".mixing-confirm",function(e){return e.preventDefault(),e.stopPropagation(),t.$apply(function(){return i.confirmMixingTags()})}),e.on("click",".mixing-cancel",function(e){return e.preventDefault(),e.stopPropagation(),t.$apply(function(){return i.cancelMixingTags()})}),e.on("click",".edit-value",function(t){var e,r,n;return t.preventDefault(),n=angular.element(t.currentTarget),r=n.parents(".row.table-main"),r.addClass("hidden"),e=r.siblings(".edition"),e.removeClass("hidden"),e.find("input:visible").first().focus().select()}),e.on("keyup",".new-value input",function(t){var r;return 13===t.keyCode?(r=e.find(".new-value"),m(r)):27===t.keyCode?(e.find(".new-value").addClass("hidden"),p()):void 0}),e.on("keyup",".status-name input",function(t){var e;return e=angular.element(t.currentTarget),13===t.keyCode?v(e):27===t.keyCode?u(e):void 0}),e.on("click",".save",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),v(e)}),e.on("click",".cancel",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),u(e)}),e.on("click",".delete-tag",function(t){var e,n,s,a;return t.preventDefault(),s=angular.element(t.currentTarget),e=s.parents("form"),n=e.scope().tag,a=o.instant("ADMIN.COMMON.TITLE_ACTION_DELETE_TAG"),r.askOnDelete(a,n.name).then(function(t){var e,o;return o=function(){return i.loadTags()["finally"](function(){return t.finish()})},e=function(){return r.notify("error")},i.deleteTag(n.name).then(o,e)})}),t.$on("$destroy",function(){return e.off(),a.off()})},{link:a}},b.directive("tgProjectTags",["$log","$tgRepo","$tgConfirm","$tgLocation","animationFrame","$translate","$rootScope",s])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p=function(t,e){return function(){return t.apply(e,arguments)}},f=function(t,e){function r(){this.constructor=t}for(var n in e)d.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},d={}.hasOwnProperty,h=[].indexOf||function(t){for(var e=0,r=this.length;e\n
\n
<%- category.activePermissions %>/<%- category.permissions.length %>
\n <% _.each(category.permissions, function(permission) { %>\n
\n <% }) %>\n
\n'),o=_.template('
\n
\n
\n
\n
\n <% _.each(category.permissions, function(permission) { %>\n
\n \n
\n disabled="disabled" <% } %>\n <% if(permission.active) { %> checked="checked" <% } %>/>\n
\n \n \n
\n
\n <% }) %>\n
\n
\n
'),i=_.template('
'),a=function(a,c,l){var p,f,d,g,m;return p=c.controller(),f=function(t){var e,r,n,i,o,s,u,c,l,p;return s=function(e){return _.map(e,function(e){var r;return _.extend({},e,{active:(r=e.key,h.call(t.permissions,r)>=0)})})},n=function(t,e,r){return!(e.external_user&&!r.is_private&&0===t.key.indexOf("view_"))},u=function(e){return _.map(e,function(e){return e.permissions=e.permissions.map(function(e){return e.editable=n(e,t,a.project),e}),_.extend({},e,{activePermissions:_.filter(e.permissions,"active").length})})},e=[],r=[{key:"view_epics",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.VIEW_EPICS"},{key:"add_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.ADD_EPICS"},{key:"modify_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.MODIFY_EPICS"},{key:"comment_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.COMMENT_EPICS"},{key:"delete_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.DELETE_EPICS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.EPICS.NAME",permissions:s(r)}),o=[{key:"view_milestones",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.VIEW_SPRINTS"},{key:"add_milestone",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.ADD_SPRINTS"},{key:"modify_milestone",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.MODIFY_SPRINTS"},{key:"delete_milestone",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.DELETE_SPRINTS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.NAME",permissions:s(o)}),l=[{key:"view_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.VIEW_USER_STORIES"},{key:"add_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.ADD_USER_STORIES"},{key:"modify_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.MODIFY_USER_STORIES"},{key:"comment_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.COMMENT_USER_STORIES"},{key:"delete_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.DELETE_USER_STORIES"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.NAME",permissions:s(l)}),c=[{key:"view_tasks",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.VIEW_TASKS"},{key:"add_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.ADD_TASKS"},{key:"modify_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.MODIFY_TASKS"},{key:"comment_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.COMMENT_TASKS"},{key:"delete_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.DELETE_TASKS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.TASKS.NAME",permissions:s(c)}),i=[{key:"view_issues",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.VIEW_ISSUES"},{key:"add_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.ADD_ISSUES"},{key:"modify_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.MODIFY_ISSUES"},{key:"comment_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.COMMENT_ISSUES"},{key:"delete_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.DELETE_ISSUES"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.NAME",permissions:s(i)}),p=[{key:"view_wiki_pages",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.VIEW_WIKI_PAGES"},{key:"add_wiki_page",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.ADD_WIKI_PAGES"},{key:"modify_wiki_page",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.MODIFY_WIKI_PAGES"},{key:"delete_wiki_page",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.DELETE_WIKI_PAGES"},{key:"view_wiki_links",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.VIEW_WIKI_LINKS"},{key:"add_wiki_link",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.ADD_WIKI_LINKS"},{key:"delete_wiki_link",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.DELETE_WIKI_LINKS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.WIKI.NAME",permissions:s(p)}),u(e)},m=function(t,e){return t.find(".resume").html(n(u({category:e}))(a))},d=function(t,e){var r;return r=o({category:t,index:e}),r=angular.element(r),m(r,t),n(r)(a)},g=function(){var n;return c.off(),n=i(),_.each(f(a.role),function(t,e){return n=angular.element(n).append(d(t,e))}),c.html(n),c.on("click",".resume",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),e.toggleClass("open-drawer"),e.next().toggleClass("open")}),c.on("change",".category-item input",function(n){var i,o,s,u;return i=function(){var t;return t=_.filter(c.find(".category-item input"),function(t){return angular.element(t).is(":checked")}),t=_.sortBy(_.map(t,function(t){var e;return e=angular.element(t).parents(".category-item").data("id")})),t.length&&t.push("view_project"),t},u=angular.element(n.currentTarget),a.role.permissions=i(),s=function(){var e,n;return e=f(a.role),n=u.parents(".category-config").data("id"),m(u.parents(".category-config"),e[n]),t.$broadcast("projects:reload"),r.notify("success"),p.loadProject()},o=function(){return r.notify("error"),u.prop("checked",!u.prop("checked")),a.role.permissions=i()},a.role.external_user?(a.project.public_permissions=a.role.permissions,a.project.anon_permissions=a.role.permissions.filter(function(t){return 0===t.indexOf("view_")}),e.save(a.project).then(s,o)):e.save(a.role).then(s,o)})},a.$on("$destroy",function(){return c.off()}),a.$on("role:changed",function(){return g()}),s(a,l.ngModel,g)},{link:a}},c.directive("tgRolePermissions",["$rootScope","$tgRepo","$tgConfirm","$compile",r])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c,l,p,f,d,h,g,m,v,y=function(t,e){function r(){this.constructor=t}for(var n in e)b.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},b={}.hasOwnProperty;m=this.taiga,h=this.taiga.mixOf,f=this.taiga.bindMethods,d=this.taiga.debounce,v=this.taiga.timeout,g=angular.module("taigaAdmin"),p=function(t){function e(t,e,r,n,i,o,s,a,u){var c;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.location=i,this.navUrls=o,this.appMetaService=s,this.translate=a,this.errorHandlingService=u,f(this),this.scope.sectionName="ADMIN.WEBHOOKS.SECTION_NAME",this.scope.project={},c=this.loadInitialData(),c.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.WEBHOOKS.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),c.then(null,this.onInitialDataError.bind(this)),this.scope.$on("webhooks:reload",this.loadWebhooks)}return y(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","$tgLocation","$tgNavUrls","tgAppMetaService","$translate","tgErrorHandlingService"],e.prototype.loadWebhooks=function(){return this.rs.webhooks.list(this.scope.projectId).then(function(t){return function(e){return t.scope.webhooks=e}}(this))},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return e.i_am_admin||t.errorHandlingService.permissionDenied(),t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(){return t.loadWebhooks()}}(this)),t},e}(h(m.Controller,m.PageMixin,m.FiltersMixin)),g.controller("WebhooksController",p),l=function(t,e,r,n,i){var o;return o=function(n,o,s){var a,u,c,l,p,f,h,g;return g=n.$eval(s.tgWebhook),f=function(){var e;return e=i.instant("ADMIN.WEBHOOKS.DATE"),t.webhooklogs.list(g.id).then(function(t){return function(t){var r,n,i,o;for(r=0,n=t.length;r=1)return s.addClass("hidden")})}),o.on("click",function(t){return s.removeClass("hidden"),s.find("input")[0].focus()})},{link:i}},g.directive("tgNewWebhook",["$tgResources","$tgRepo","$tgConfirm","$tgLoading",a]),r=function(t){function e(t,e,r,n,i,o){var s;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,f(this),this.scope.sectionName=this.translate.instant("ADMIN.GITHUB.SECTION_NAME"),this.scope.project={},s=this.loadInitialData(),s.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.GITHUB.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),s.then(null,this.onInitialDataError.bind(this))}return y(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"github").then(function(t){return function(e){return t.scope.github=e}}(this))},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(){return t.loadModules()}}(this)),t},e}(h(m.Controller,m.PageMixin,m.FiltersMixin)),g.controller("GithubController",r),i=function(t){function e(t,e,r,n,i,o){var s;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,f(this),this.scope.sectionName=this.translate.instant("ADMIN.GITLAB.SECTION_NAME"),this.scope.project={},s=this.loadInitialData(),s.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.GITLAB.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),s.then(null,this.onInitialDataError.bind(this)),this.scope.$on("project:modules:reload",function(t){return function(){return t.loadModules()}}(this))}return y(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"gitlab").then(function(t){return function(e){return t.scope.gitlab=e}}(this))},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(){return t.loadModules()}}(this)),t},e}(h(m.Controller,m.PageMixin,m.FiltersMixin)),g.controller("GitlabController",i),t=function(t){function e(t,e,r,n,i,o){var s;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,f(this),this.scope.sectionName=this.translate.instant("ADMIN.BITBUCKET.SECTION_NAME"),this.scope.project={},s=this.loadInitialData(),s.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.BITBUCKET.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),s.then(null,this.onInitialDataError.bind(this)),this.scope.$on("project:modules:reload",function(t){return function(){return t.loadModules()}}(this))}return y(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"bitbucket").then(function(t){return function(e){return t.scope.bitbucket=e}}(this))},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(){return t.loadModules()}}(this)),t},e}(h(m.Controller,m.PageMixin,m.FiltersMixin)),g.controller("BitbucketController",t),u=function(){var t;return t=function(t,e,r){return e.on("click",".select-input-content",function(){return e.find("input").select(),e.find(".help-copy").addClass("visible")})},{link:t}},g.directive("tgSelectInputText",u),n=function(t,e,r){var n;return n=function(n,i,o){var s,a,u;return s=i.find("form").checksley({onlyOneErrorElement:!0}),a=d(2e3,function(i){return function(i){var o,a;if(i.preventDefault(),s.validate())return o=r().target(u).start(),a=t.saveAttribute(n.github,"github"),a.then(function(){return o.finish(),e.notify("success")}),a.then(null,function(t){if(o.finish(),s.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=i.find(".submit-button"),i.on("submit","form",a)},{link:n}},g.directive("tgGithubWebhooks",["$tgRepo","$tgConfirm","$tgLoading",n]),o=function(t,e,r){var n;return n=function(n,i,o){var s,a,u;return s=i.find("form").checksley({onlyOneErrorElement:!0}),a=d(2e3,function(i){return function(i){var o,a;if(i.preventDefault(),s.validate())return o=r().target(u).start(),a=t.saveAttribute(n.gitlab,"gitlab"),a.then(function(){return o.finish(),e.notify("success"),n.$emit("project:modules:reload")}),a.then(null,function(t){if(o.finish(),s.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=i.find(".submit-button"),i.on("submit","form",a)},{link:n}},g.directive("tgGitlabWebhooks",["$tgRepo","$tgConfirm","$tgLoading",o]),e=function(t,e,r){var n;return n=function(n,i,o){var s,a,u;return s=i.find("form").checksley({onlyOneErrorElement:!0}),a=d(2e3,function(i){return function(i){var o,a;if(i.preventDefault(),s.validate())return o=r().target(u).start(),a=t.saveAttribute(n.bitbucket,"bitbucket"),a.then(function(){return o.finish(),e.notify("success"),n.$emit("project:modules:reload")}),a.then(null,function(t){if(o.finish(),s.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=i.find(".submit-button"),i.on("submit","form",a)},{link:n}},g.directive("tgBitbucketWebhooks",["$tgRepo","$tgConfirm","$tgLoading",e]),c=function(){var t;return t=function(t,e,r,n){return n.$parsers.push(function(t){return t=$.trim(t),""===t?[]:t.split(",")})},{link:t,restrict:"EA",require:"ngModel"}},g.directive("tgValidOriginIps",c),s=function(t){function e(t,e,r,n,i,o){var s;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,f(this),this.scope.sectionName=this.translate.instant("ADMIN.GOGS.SECTION_NAME"),this.scope.project={},s=this.loadInitialData(),s.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.GOGS.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),s.then(null,this.onInitialDataError.bind(this))}return y(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"gogs").then(function(t){return function(e){return t.scope.gogs=e}}(this))},e.prototype.loadProject=function(){return this.rs.projects.getBySlug(this.params.pslug).then(function(t){return function(e){return t.scope.projectId=e.id,t.scope.project=e,t.scope.$emit("project:loaded",e),e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),t.then(function(t){return function(){return t.loadModules()}}(this)),t},e}(h(m.Controller,m.PageMixin,m.FiltersMixin)),g.controller("GogsController",s)}.call(this),function(){var t,e;e=angular.module("taigaProject"),t=function(){return{templateUrl:"project/wizard-restrictions.html"}},e.directive("tgCreateProjectRestriction",[t])}.call(this),function(){var t,e,r,n,i,o,s;o=this.taiga,r=this.taiga.bindOnce,s=this.taiga.timeout,n=this.taiga.debounce,i=angular.module("taigaProject"),t=function(t,e,r,n,i,o,s,a,u,c,l,p,f){var d,h;return h=function(i,d,h){var g,m,v,y,b,S,k;return i.data={},i.templates=[],g=null,m=d.find("form").checksley({onlyOneErrorElement:!0}),y=function(e){return c.get("$http").removeAll(),g.finish(),t.$broadcast("projects:reload"),r.notify("success",l.instant("COMMON.SAVE")),n.url(s.get(e)),u.close(d),p.loadProjects()},v=function(t){var e,r,n,i,o,s;for(g.finish(),m.setErrors(t),s=[],i=_.keys(t),o=[],r=0,n=i.length;rd?(p=a.instant("PROJECT.IMPORT.ERROR_MAX_SIZE_EXCEEDED",{fileName:e.name,fileSize:r(e.size),maxFileSize:r(d)}),h={status:413,data:{_error_message:p}},l.reject(h),l.promise):(v=function(t){return function(t){var e,i;return i=Math.round(t.loaded/t.total*100),e=a.instant("PROJECT.IMPORT.UPLOAD_IN_PROGRESS_MESSAGE",{uploadedSize:r(t.loaded),totalSize:r(t.total)}),n("in-progress",null,e,i)}}(this),g=function(t){return function(t){return n("done",a.instant("PROJECT.IMPORT.TITLE"),a.instant("PROJECT.IMPORT.DESCRIPTION"))}}(this),m=function(t){return function(t){return n("error")}}(this),u=function(t){return function(t){var e;h={};try{h.data=JSON.parse(t.target.responseText)}catch(r){h.data={}}return h.status=t.target.status,t.target.getResponseHeader("Taiga-Info-Project-Is-Private")&&(h.headers={isPrivate:"True"===t.target.getResponseHeader("Taiga-Info-Project-Is-Private"),memberships:parseInt(t.target.getResponseHeader("Taiga-Info-Project-Memberships"))}),201!==(e=h.status)&&202!==e||l.resolve(h),l.reject(h)}}(this),f=function(t){return function(t){return l.reject("fail")}}(this),c=new FormData,c.append("dump",e),y=new XMLHttpRequest,y.upload.addEventListener("progress",v,!1),y.upload.addEventListener("load",g,!1),y.upload.addEventListener("error",m,!1),y.upload.addEventListener("abort",m,!1),y.addEventListener("load",u,!1),y.addEventListener("error",f,!1),y.open("POST",i.resolve("importer")),y.setRequestHeader("Authorization","Bearer "+o.getToken()),y.setRequestHeader("Accept","application/json"),y.send(c),l.promise)},u.changeLogo=function(e,o){var a,u,c,l,p,f;return c=t.get("maxUploadFileSize",null),c&&o.size>c?(p={status:413,data:{_error_message:"'"+o.name+"' ("+r(o.size)+") is too heavy for our oompa loompas, try it with a smaller than ("+r(c)+")"}},u=s.defer(),u.reject(p),u.promise):(a=new FormData,a.append("logo",o),l={transformRequest:angular.identity,headers:{"Content-Type":void 0}},f=i.resolve("projects")+"/"+e+"/change_logo",n.post(f,a,{},l))},u.removeLogo=function(t){var e;return e=i.resolve("projects")+"/"+t+"/remove_logo",n.post(e)},function(t){return t.projects=u}},t=angular.module("taigaResources"),t.factory("$tgProjectsResourcesProvider",["$tgConfig","$tgRepo","$tgHttp","$tgUrls","$tgAuth","$q","$translate",e])}.call(this),function(){var t,e,r;r=this.taiga,e=function(t,e,r){var n;return n={},n.get=function(e){return t.queryOne("roles",e)},n.list=function(e){return t.queryMany("roles",{project:e})},function(t){return t.roles=n}},t=angular.module("taigaResources"),t.factory("$tgRolesResourcesProvider",["$tgRepo","$tgHttp","$tgUrls",e])}.call(this),function(){var t,e,r;r=this.taiga,e=function(t,e,r,n){var i;return i={},i["do"]=function(t,i){var o,s,a,u;return o=n.defer(),u=e.resolve("search"),s={url:u,method:"GET",timeout:o.promise,cancelable:!0,params:{project:t,text:i,get_all:!1}},a=r.request(s).then(function(t){return t.data}),a.abort=function(){return o.resolve()},a["finally"]=function(){return a.abort=angular.noop,o=a=null},a},function(t){return t.search=i}},t=angular.module("taigaResources"),t.factory("$tgSearchResourcesProvider",["$tgRepo","$tgUrls","$tgHttp","$q",e])}.call(this),function(){var t,e,r,n;n=this.taiga,t=n.generateHash,r=function(t,e,r){var n;return n={},n.get=function(r,n){return t.queryOne("milestones",n).then(function(t){var r;return r=t.user_stories,r=_.map(r,function(t){return e.make_model("userstories",t)}),t._attrs.user_stories=r,t})},n.stats=function(e,r){return t.queryOneRaw("milestones",r+"/stats")},n.list=function(r,n){var i;return i={project:r},i=_.extend({},i,n||{}),t.queryMany("milestones",i,{},!0).then(function(t){return function(t){var r,n,i,o,s,a;for(s=t[0],r=t[1],n=0,i=s.length;nu?(l={status:413,data:{_error_message:"'"+e.name+"' ("+r(e.size)+") is too heavy for our oompa loompas, try it with a smaller than ("+r(u)+")"}},a=o.defer(),a.reject(l),a.promise):(s=new FormData,s.append("avatar",e),c={transformRequest:angular.identity,headers:{"Content-Type":void 0}},p=i.resolve("users")+"/change_avatar",n.post(p,s,{},c))},s.removeAvatar=function(){var t;return t=i.resolve("users")+"/remove_avatar",n.post(t)},s.changePassword=function(t,e){var r,o;return o=i.resolve("users")+"/change_password",r={current_password:t,password:e},n.post(o,r)},function(t){return t.userSettings=s}},t=angular.module("taigaResources"),t.factory("$tgUserSettingsResourcesProvider",["$tgConfig","$tgRepo","$tgHttp","$tgUrls","$q",e])}.call(this),function(){var t,e,r,n;n=this.taiga,r=this.taiga.sizeFormat,e=function(t,e){var r;return r={},r.contacts=function(r,n){var i,o;return null==n&&(n={}),o=e.resolve("user-contacts",r),i={headers:{}},n.enablePagination||(i.headers["x-disable-pagination"]="1"),t.get(o,{},i).then(function(t){return t.data})},function(t){return t.users=r}},t=angular.module("taigaResources"),t.factory("$tgUsersResourcesProvider",["$tgHttp","$tgUrls","$q",e])}.call(this),function(){var t,e,r,n;n=this.taiga,t=n.generateHash,r=function(e,r,n,i,o){var s,a;return a={},s="userstories-queryparams",a.get=function(t,r){var n;return n=a.getQueryParams(t),n.project=t,e.queryOne("userstories",r,n)},a.getByRef=function(t,r,n){var i;return null==n&&(n={}),i=a.getQueryParams(t),i.project=t,i.ref=r,i=_.extend({},i,n),e.queryOne("userstories","by_ref",i)},a.listInAllProjects=function(t){return e.queryMany("userstories",t)},a.filtersData=function(t){return e.queryOneRaw("userstories-filters",null,t)},a.listUnassigned=function(t,r,n){var i;return i={project:t,milestone:"null"},i=_.extend({},i,r||{}),a.storeQueryParams(t,i),e.queryMany("userstories",_.extend(i,{page_size:n}),{enablePagination:!0},!0)},a.listAll=function(t,r){var n;return n={project:t},n=_.extend({},n,r||{}),a.storeQueryParams(t,n),e.queryMany("userstories",n)},a.bulkCreate=function(t,e,i){var o,s;return o={project_id:t,status_id:e,bulk_stories:i},s=n.resolve("bulk-create-us"),r.post(s,o)},a.upvote=function(t){var e;return e=n.resolve("userstory-upvote",t),r.post(e)},a.downvote=function(t){var e;return e=n.resolve("userstory-downvote",t),r.post(e)},a.watch=function(t){var e;return e=n.resolve("userstory-watch",t),r.post(e)},a.unwatch=function(t){var e;return e=n.resolve("userstory-unwatch",t),r.post(e)},a.bulkUpdateBacklogOrder=function(t,e){var i,o;return o=n.resolve("bulk-update-us-backlog-order"),i={project_id:t,bulk_stories:e},r.post(o,i)},a.bulkUpdateMilestone=function(t,e,i){var o,s;return s=n.resolve("bulk-update-us-milestone"),o={project_id:t,milestone_id:e,bulk_stories:i},r.post(s,o)},a.bulkUpdateKanbanOrder=function(t,e){var i,o;return o=n.resolve("bulk-update-us-kanban-order"),i={project_id:t,bulk_stories:e},r.post(o,i)},a.listValues=function(t,r){var n;return n={project:t},a.storeQueryParams(t,n),e.queryMany(r,n)},a.storeQueryParams=function(e,r){var n,o;return o=e+":"+s,n=t([e,o]),i.set(n,r)},a.getQueryParams=function(e){var r,n;return n=e+":"+s,r=t([e,n]),i.get(r)||{}},a.storeShowTags=function(e,r){var n;return n=t([e,"showTags"]),i.set(n,r)},a.getShowTags=function(e){var r;return r=t([e,"showTags"]),i.get(r)||null},function(t){return t.userstories=a}},e=angular.module("taigaResources"),e.factory("$tgUserstoriesResourcesProvider",["$tgRepo","$tgHttp","$tgUrls","$tgStorage","$q",r])}.call(this),function(){var t,e;e=function(t,e,r){var n;return n={},n.list=function(e){var r;return r={webhook:e},t.queryMany("webhooklogs",r)},n.resend=function(t){var n;return n=e.resolve("webhooklogs-resend",t),r.post(n)},function(t){return t.webhooklogs=n}},t=angular.module("taigaResources"),t.factory("$tgWebhookLogsResourcesProvider",["$tgRepo","$tgUrls","$tgHttp",e])}.call(this),function(){var t,e;e=function(t,e,r){var n;return n={},n.list=function(e){var r;return r={project:e},t.queryMany("webhooks",r)},n.test=function(t){var n;return n=e.resolve("webhooks-test",t),r.post(n)},function(t){return t.webhooks=n}},t=angular.module("taigaResources"),t.factory("$tgWebhooksResourcesProvider",["$tgRepo","$tgUrls","$tgHttp",e])}.call(this),function(){var t,e,r;r=this.taiga,e=function(t,e,r){var n;return n={},n.get=function(e){return t.queryOne("wiki",e)},n.getBySlug=function(e,r){return t.queryOne("wiki","by_slug?project="+e+"&slug="+r)},n.list=function(e){return t.queryMany("wiki",{project:e})},n.listLinks=function(e){return t.queryMany("wiki-links",{project:e})},function(t){return t.wiki=n}},t=angular.module("taigaResources"),t.factory("$tgWikiResourcesProvider",["$tgRepo","$tgHttp","$tgUrls",e])}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=this.taiga,n=this.taiga.mixOf,r=this.taiga.debounce,i=angular.module("taigaUserSettings"),t=function(t){function e(t,e,r,n,i,o,s,a,u,c,l){this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=u,this.auth=c,this.translate=l,this.scope.sectionName=this.translate.instant("CHANGE_PASSWORD.SECTION_NAME"),this.scope.user=this.auth.getUser()}return s(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAuth","$translate"],e}(n(o.Controller,o.PageMixin)),i.controller("UserChangePasswordController",t),e=function(t,e,n,i){var o;return o=function(o,s,a,u){var c,l,p;return c=new checksley.Form(s.find("form")),l=r(2e3,function(r){return function(r){var s,a;if(r.preventDefault(),c.validate())return o.newPassword1!==o.newPassword2?void e.notify("error",i.instant("CHANGE_PASSWORD.ERROR_PASSWORD_MATCH")):(s=n().target(p).start(),a=t.userSettings.changePassword(o.currentPassword,o.newPassword1),a.then(function(){return s.finish(),e.notify("success")}),a.then(null,function(t){return s.finish(),e.notify("error",t.data._error_message)}))}}(this)),p=s.find(".submit-button"),s.on("submit","form",l),o.$on("$destroy",function(){return s.off()})},{link:o}},i.directive("tgUserChangePassword",["$tgResources","$tgConfirm","$tgLoading","$translate",e])}.call(this),function(){var t,e,r,n,i;i=this.taiga,e=this.taiga.bindOnce,r=this.taiga.debounce,n=angular.module("taigaUserSettings"),t=function(t,e,n,i,o,s,a){var u;return u=function(e,u,c){var l,p;return e.$on("deletelightbox:new",function(t,e){return s.open(u)}),e.$on("$destroy",function(){return u.off()}),l=function(){var r,c;return r=a().target(p).start(),c=t.remove(e.user),c.then(function(t){return r.finish(),s.close(u),n.logout(),i.path(o.resolve("login"))}),c.then(null,function(){return r.finish(),console.log("FAIL")})},u.on("click",".button-green",function(t){return t.preventDefault(),s.close(u)}),u.on("click",".button-red",r(2e3,function(t){return t.preventDefault(),l()})),p=u.find(".button-red")},{link:u,templateUrl:"user/lightbox/lightbox-delete-account.html"}},n.directive("tgLbDeleteUser",["$tgRepo","$rootScope","$tgAuth","$tgLocation","$tgNavUrls","lightboxService","$tgLoading",t])}.call(this),function(){var t,e,r,n,i,o,s,a,u,c=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;u=this.taiga,o=this.taiga.mixOf,a=this.taiga.sizeFormat,s=angular.module("taigaUserSettings"),i=this.taiga.debounce,n=function(t){function e(t,e,r,n,i,o,s,u,c,l,p,f,d){var h,g,m;this.scope=t,this.rootscope=e,this.config=r,this.repo=n,this.confirm=i,this.rs=o,this.params=s,this.q=u,this.location=c,this.navUrls=l,this.auth=p,this.translate=f,this.errorHandlingService=d,this.scope.sectionName="USER_SETTINGS.MENU.SECTION_TITLE",this.scope.project={},this.scope.user=this.auth.getUser(),this.scope.user||this.errorHandlingService.permissionDenied(),this.scope.lang=this.getLan(),this.scope.theme=this.getTheme(),h=this.config.get("maxUploadFileSize",null),h&&(m=this.translate.instant("USER_SETTINGS.AVATAR_MAX_SIZE",{maxFileSize:a(h)}),this.scope.maxFileSizeMsg=m),g=this.loadInitialData(),g.then(null,this.onInitialDataError.bind(this))}return c(e,t),e.$inject=["$scope","$rootScope","$tgConfig","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAuth","$translate","tgErrorHandlingService"],e.prototype.loadInitialData=function(){return this.scope.availableThemes=this.config.get("themes",[]),this.rs.locales.list().then(function(t){return function(e){return t.scope.locales=e,e}}(this))},e.prototype.openDeleteLightbox=function(){return this.rootscope.$broadcast("deletelightbox:new",this.scope.user)},e.prototype.getLan=function(){return this.scope.user.lang||this.translate.preferredLanguage()},e.prototype.getTheme=function(){return this.scope.user.theme||this.config.get("defaultTheme")||"taiga"},e}(o(u.Controller,u.PageMixin)),s.controller("UserSettingsController",n),r=function(t,e,r,n){var o;return o=function(o,s,a){var u;return u=i(2e3,function(i){return function(i){var a,u,c,l;if(i.preventDefault(),u=s.find("form").checksley(),u.validate())return a=o.user.isAttributeModified("email"),o.user.lang=o.lang,o.user.theme=o.theme,l=function(r){var i;return e.setUser(r),a?(i=n.instant("USER_PROFILE.CHANGE_EMAIL_SUCCESS"),t.success(i)):t.notify("success")},c=function(e){return u.setErrors(e),t.notify("error",e._error_message)},r.save(o.user).then(l,c)}}(this)),s.on("submit","form",u),o.$on("$destroy",function(){return s.off()})},{link:o}},s.directive("tgUserProfile",["$tgConfirm","$tgAuth","$tgRepo","$translate",r]),e=function(t,e,r,n){var i;return i=function(i,o,s){var a,u,c;return c=function(){return o.find(".size-info").removeClass("hidden")},u=function(r){var s;return s=e.make_model("users",r.data),t.setUser(s),i.user=s,o.find(".loading-overlay").removeClass("active"),n.notify("success")},a=function(t){return 413===t.status&&c(),o.find(".loading-overlay").removeClass("active"),n.notify("error",t.data._error_message)},o.on("click",".js-change-avatar",function(){return o.find("#avatar-field").click()}),o.on("change","#avatar-field",function(t){if(i.avatarAttachment)return o.find(".loading-overlay").addClass("active"),r.userSettings.changeAvatar(i.avatarAttachment).then(u,a)}),o.on("click","a.js-use-gravatar",function(t){return o.find(".loading-overlay").addClass("active"),r.userSettings.removeAvatar().then(u,a)}),i.$on("$destroy",function(){return o.off()})},{link:i}},s.directive("tgUserAvatar",["$tgAuth","$tgModel","$tgResources","$tgConfirm",e]),t=function(t){var e;return e=function(e,r,n){var i,o;return i=t(n.tgAvatarModel),o=i.assign,r.bind("change",function(){return e.$apply(function(){return o(e,r[0].files[0])})})},{link:e}},s.directive("tgAvatarModel",["$parse",t])}.call(this),function(){var t,e;t=function(){var t;return t=function(t,e,r){var n;return n=r.tgUserSettingsNavigation,e.find(".active").removeClass("active"),e.find("#usersettingsmenu-"+n+" a").addClass("active"),t.$on("$destroy",function(){return e.off()})},{link:t}},e=angular.module("taigaUserSettings"),e.directive("tgUserSettingsNavigation",t)}.call(this),function(){var t,e,r,n,i,o,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;s=this.taiga,i=this.taiga.mixOf,n=this.taiga.bindOnce,o=angular.module("taigaUserSettings"),t=function(t){function e(t,e,r,n,i,o,s,a,u,c,l){var p;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=u,this.auth=c,this.errorHandlingService=l,this.scope.sectionName="USER_SETTINGS.NOTIFICATIONS.SECTION_NAME",this.scope.user=this.auth.getUser(),p=this.loadInitialData(),p.then(null,this.onInitialDataError.bind(this))}return a(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAuth","tgErrorHandlingService"],e.prototype.loadInitialData=function(){return this.rs.notifyPolicies.list().then(function(t){return function(e){return t.scope.notifyPolicies=e,e}}(this))},e}(i(s.Controller,s.PageMixin)),o.controller("UserNotificationsController",t),e=function(){var t;return t=function(t,e,r){return t.$on("$destroy",function(){return e.off()})},{link:t}},o.directive("tgUserNotifications",e),r=function(t,e,r){var i,o;return o=_.template('<% _.each(notifyPolicies, function (notifyPolicy, index) { %>\n
\n
<%- notifyPolicy.project_name %>
\n
\n
\n checked="checked"<% } %>/>\n \n
\n
\n
\n
\n checked="checked"<% } %> />\n \n
\n
\n
\n
\n checked="checked"<% } %> />\n \n
\n
\n
\n<% }) %>'),i=function(i,s,a){var u;return u=function(){var n,a;return s.off(),n={notifyPolicies:i.notifyPolicies},a=o(n),s.html(r(a)(i)),s.on("change","input[type=radio]",function(r){var n,o,s,a,u,c;return c=angular.element(r.currentTarget),a=c.parents(".policy-table-row").data("index"),s=i.notifyPolicies[a],u=s.notify_level,s.notify_level=parseInt(c.val(),10),o=function(){return e.notify("success")},n=function(){return e.notify("error"),c.parents(".policy-table-row").find("input[value="+u+"]").prop("checked",!0)},t.save(s).then(o,n)})},i.$on("$destroy",function(){return s.off()}),n(i,a.ngModel,u)},{link:i}},o.directive("tgUserNotificationsList",["$tgRepo","$tgConfirm","$compile",r])}.call(this),function(){angular.module("taigaComponents",[])}.call(this),function(){var t;t=angular.module("taigaDiscover",[])}.call(this),function(){var t;t=angular.module("taigaExternalApps",[])}.call(this),function(){angular.module("taigaHistory",[])}.call(this),function(){var t;t=angular.module("taigaHome",[])}.call(this),function(){angular.module("taigaNavigationBar",[])}.call(this),function(){var t;t=angular.module("taigaProfile",[])}.call(this),function(){angular.module("taigaProjects",[])}.call(this),function(){angular.module("taigaResources2",[])}.call(this),function(){angular.module("taigaUserTimeline",[])}.call(this),function(){var t;t=angular.module("taigaUtils",[])}.call(this),function(){angular.module("taigaWikiHistory",[])}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{templateUrl:"components/assigned-to/assigned-item/assigned-item.html",scope:{member:"="},link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAssignedItem",t)}.call(this),function(){var t;t=function(){function t(){this.assigned&&this._getAssignedMember(),this._filterAssignedMember()}return t.$inject=[],t.prototype._getAssignedMember=function(){return this.assignedMember=_.filter(this.project.members,function(t){return function(e){return e.id===t.assigned.get("id")}}(this))},t.prototype._filterAssignedMember=function(){return this.assigned?this.nonAssignedMembers=_.filter(this.project.members,function(t){return function(e){return e.id!==t.assigned.get("id")}}(this)):this.nonAssignedMembers=this.project.members},t}(),angular.module("taigaComponents").controller("AssignedToSelectorCtrl",t)}.call(this),function(){var t;t=function(){return{controller:"AssignedToSelectorCtrl",controllerAs:"vm",bindToController:!0,templateUrl:"components/assigned-to/assigned-to-selector/assigned-to-selector.html", scope:{assigned:"=",project:"=",onRemoveAssigned:"&",onAssignTo:"&"}}},t.$inject=[],angular.module("taigaComponents").directive("tgAssignedToSelector",t)}.call(this),function(){var t;t=function(){function t(t,e){this.lightboxFactory=t,this.lightboxService=e,this.has_permissions=_.includes(this.project.my_permissions,"modify_epic")}return t.$inject=["tgLightboxFactory","lightboxService"],t.prototype._closeAndRemoveAssigned=function(){return this.lightboxService.closeAll(),this.onRemoveAssigned()},t.prototype._closeAndAssign=function(t){return this.lightboxService.closeAll(),this.onAssignTo({member:t})},t.prototype.onSelectAssignedTo=function(t,e){return this.lightboxFactory.create("tg-assigned-to-selector",{"class":"lightbox lightbox-assigned-to-selector open",assigned:"assigned",project:"project","on-remove-assigned":"onRemoveAssigned()","on-assign-to":"assignTo(member)"},{assigned:this.assignedTo,project:this.project,onRemoveAssigned:this._closeAndRemoveAssigned.bind(this),assignTo:this._closeAndAssign.bind(this)})},t}(),angular.module("taigaComponents").controller("AssignedToCtrl",t)}.call(this),function(){var t;t=function(){return{controller:"AssignedToCtrl",controllerAs:"vm",bindToController:!0,templateUrl:"components/assigned-to/assigned-to.html",scope:{assignedTo:"=",project:"=",onRemoveAssigned:"&",onAssignTo:"&"}}},t.$inject=[],angular.module("taigaComponents").directive("tgAssignedToComponent",t)}.call(this),function(){var t;t=function(t,e,r){var n;return n=function(n,i,o){var s;return s=t(o.tgAttachmentLink)(n),i.on("click",function(t){return taiga.isImage(s.getIn(["file","name"]))?(t.preventDefault(),n.$apply(function(){return r.open($("tg-attachments-preview")),e.fileId=s.getIn(["file","id"])})):taiga.isPdf(s.getIn(["file","name"]))?(t.preventDefault(),window.open(s.getIn(["file","url"]))):void 0}),n.$on("$destroy",function(){return i.off()})},{link:n}},t.$inject=["$parse","tgAttachmentsPreviewService","lightboxService"],angular.module("taigaComponents").directive("tgAttachmentLink",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{scope:{},bindToController:{attachment:"=",onDelete:"&",onUpdate:"&",type:"="},controller:"Attachment",controllerAs:"vm",templateUrl:"components/attachment/attachment-gallery.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachmentGallery",t)}.call(this),function(){var t;t=function(){function t(t,e){this.attachmentsService=t,this.translate=e,this.form={},this.form.description=this.attachment.getIn(["file","description"]),this.form.is_deprecated=this.attachment.get(["file","is_deprecated"]),this.title=this.translate.instant("ATTACHMENT.TITLE",{fileName:this.attachment.get("name"),date:moment(this.attachment.get("created_date")).format(this.translate.instant("ATTACHMENT.DATE"))})}return t.$inject=["tgAttachmentsService","$translate"],t.prototype.editMode=function(t){var e;return e=this.attachment.set("editable",t),this.onUpdate({attachment:e})},t.prototype["delete"]=function(){return this.onDelete({attachment:this.attachment})},t.prototype.save=function(){var t;return t=this.attachment.set("loading",!0),this.onUpdate({attachment:t}),t=this.attachment.merge({editable:!1,loading:!1}),t=t.mergeIn(["file"],{description:this.form.description,is_deprecated:!!this.form.is_deprecated}),this.onUpdate({attachment:t})},t}(),angular.module("taigaComponents").controller("Attachment",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{scope:{},bindToController:{attachment:"=",onDelete:"&",onUpdate:"&",type:"="},controller:"Attachment",controllerAs:"vm",templateUrl:"components/attachment/attachment.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachment",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i;return i=t(n.tgAttachmentsDrop),r.on("dragover",function(t){return t.preventDefault(),!1}),r.on("drop",function(t){var r;return t.stopPropagation(),t.preventDefault(),r=t.dataTransfer||t.originalEvent&&t.originalEvent.dataTransfer,e.$apply(function(){return i(e,{files:r.files})})}),e.$on("$destroy",function(){return r.off()})},{link:e}},t.$inject=["$parse"],angular.module("taigaComponents").directive("tgAttachmentsDrop",t)}.call(this),function(){var t,e;e=this.taiga.sizeFormat,t=function(){function t(t,r,n,i,o,s,a){this.translate=t,this.confirm=r,this.config=n,this.storage=i,this.attachmentsFullService=o,this.projectService=s,this.attachmentsPreviewService=a,this.mode=this.storage.get("attachment-mode","list"),this.maxFileSize=this.config.get("maxUploadFileSize",null),this.maxFileSize&&(this.maxFileSize=e(this.maxFileSize)),this.maxFileSizeMsg=this.maxFileSize?this.translate.instant("ATTACHMENT.MAX_UPLOAD_SIZE",{maxFileSize:this.maxFileSize}):"",taiga.defineImmutableProperty(this,"attachments",function(t){return function(){return t.attachmentsFullService.attachments}}(this)),taiga.defineImmutableProperty(this,"deprecatedsCount",function(t){return function(){return t.attachmentsFullService.deprecatedsCount}}(this)),taiga.defineImmutableProperty(this,"attachmentsVisible",function(t){return function(){return t.attachmentsFullService.attachmentsVisible}}(this)),taiga.defineImmutableProperty(this,"deprecatedsVisible",function(t){return function(){return t.attachmentsFullService.deprecatedsVisible}}(this))}return t.$inject=["$translate","$tgConfirm","$tgConfig","$tgStorage","tgAttachmentsFullService","tgProjectService","tgAttachmentsPreviewService"],t.prototype.uploadingAttachments=function(){return this.attachmentsFullService.uploadingAttachments},t.prototype.addAttachment=function(t){var e;return e="list"===this.mode,this.attachmentsFullService.addAttachment(this.projectId,this.objId,this.type,t,e)},t.prototype.setMode=function(t){return this.mode=t,this.storage.set("attachment-mode",t)},t.prototype.toggleDeprecatedsVisible=function(){return this.attachmentsFullService.toggleDeprecatedsVisible()},t.prototype.addAttachments=function(t){return _.forEach(t,function(t){return function(e){return t.addAttachment(e)}}(this))},t.prototype.loadAttachments=function(){return this.attachmentsFullService.loadAttachments(this.type,this.objId,this.projectId)},t.prototype.deleteAttachment=function(t){var e,r;return this.attachmentsPreviewService.fileId=null,r=this.translate.instant("ATTACHMENT.TITLE_LIGHTBOX_DELETE_ATTACHMENT"),e=this.translate.instant("ATTACHMENT.MSG_LIGHTBOX_DELETE_ATTACHMENT",{fileName:t.getIn(["file","name"])}),this.confirm.askOnDelete(r,e).then(function(r){return function(n){var i,o;return i=function(){return e=r.translate.instant("ATTACHMENT.ERROR_DELETE_ATTACHMENT",{errorMessage:e}),r.confirm.notify("error",null,e),n.finish(!1)},o=function(){return n.finish()},r.attachmentsFullService.deleteAttachment(t,r.type).then(o,i)}}(this))},t.prototype.reorderAttachment=function(t,e){return this.attachmentsFullService.reorderAttachment(this.type,t,e)},t.prototype.updateAttachment=function(t){return this.attachmentsFullService.updateAttachment(t,this.type)},t.prototype._isEditable=function(){return!!this.projectService.project&&this.projectService.hasPermission(this.editPermission)},t.prototype.showAttachments=function(){return this._isEditable()||this.attachmentsFullService.attachments.size},t}(),angular.module("taigaComponents").controller("AttachmentsFull",t)}.call(this),function(){var t,e;e=this.taiga.bindOnce,t=function(){var t;return t=function(t,r,n,i){return e(t,"vm.objId",function(t){return i.loadAttachments()})},{scope:{},bindToController:{type:"@",objId:"=",projectId:"=",editPermission:"@"},controller:"AttachmentsFull",controllerAs:"vm",templateUrl:"components/attachments-full/attachments-full.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachmentsFull",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,e){this.attachmentsService=t,this.rootScope=e,this._attachments=Immutable.List(),this._deprecatedsCount=0,this._attachmentsVisible=Immutable.List(),this._deprecatedsVisible=!1,this.uploadingAttachments=[],taiga.defineImmutableProperty(this,"attachments",function(t){return function(){return t._attachments}}(this)),taiga.defineImmutableProperty(this,"deprecatedsCount",function(t){return function(){return t._deprecatedsCount}}(this)),taiga.defineImmutableProperty(this,"attachmentsVisible",function(t){return function(){return t._attachmentsVisible}}(this)),taiga.defineImmutableProperty(this,"deprecatedsVisible",function(t){return function(){return t._deprecatedsVisible}}(this))}return e(r,t),r.$inject=["tgAttachmentsService","$rootScope"],r.prototype.toggleDeprecatedsVisible=function(){return this._deprecatedsVisible=!this._deprecatedsVisible,this.regenerate()},r.prototype.regenerate=function(){return this._deprecatedsCount=this._attachments.count(function(t){return t.getIn(["file","is_deprecated"])}),this._deprecatedsVisible?this._attachmentsVisible=this._attachments:this._attachmentsVisible=this._attachments.filter(function(t){return!t.getIn(["file","is_deprecated"])})},r.prototype.addAttachment=function(t,e,r,n,i){return null==i&&(i=!0),new Promise(function(o){return function(s,a){var u;return o.attachmentsService.validate(n)?(o.uploadingAttachments.push(n),u=o.attachmentsService.upload(n,e,t,r),u.then(function(t){var e;return o.uploadingAttachments=o.uploadingAttachments.filter(function(e){return e.name!==t.get("name")}),e=Immutable.Map(),e=e.merge({file:t,editable:i,loading:!1}),o._attachments=o._attachments.push(e),o.regenerate(),o.rootScope.$broadcast("attachment:create"),s(e)})):a(new Error(n))}}(this))},r.prototype.loadAttachments=function(t,e,r){return this.attachmentsService.list(t,e,r).then(function(t){return function(e){return t._attachments=e.map(function(t){var e;return e=Immutable.Map(),e.merge({loading:!1,editable:!1,file:t})}),t.regenerate()}}(this))},r.prototype.deleteAttachment=function(t,e){var r;return r=function(e){return function(){return e._attachments=e._attachments.filter(function(e){return e!==t}),e.regenerate()}}(this),this.attachmentsService["delete"](e,t.getIn(["file","id"])).then(r)},r.prototype.reorderAttachment=function(t,e,r){var n,i,o;if(i=this.attachments.findIndex(function(t){return t===e}),i!==r)return n=this.attachments.remove(i),n=n.splice(r,0,e),n=n.map(function(t,e){return t.setIn(["file","order"],e+1)}),o=[],n.forEach(function(e){return function(r){var n;return n={order:r.getIn(["file","order"])},o.push(e.attachmentsService.patch(r.getIn(["file","id"]),t,n))}}(this)),Promise.all(o).then(function(t){return function(){return t._attachments=n,t.regenerate()}}(this))},r.prototype.updateAttachment=function(t,e){var r,n,i;return r=this._attachments.findIndex(function(e){return e.getIn(["file","id"])===t.getIn(["file","id"])}),n=this._attachments.get(r),i=taiga.patch(n.get("file"),t.get("file")),t.get("loading")?(this._attachments=this._attachments.set(r,t),this.regenerate()):this.attachmentsService.patch(t.getIn(["file","id"]),e,i).then(function(e){return function(){return e._attachments=e._attachments.set(r,t),e.regenerate()}}(this))},r}(taiga.Service),angular.module("taigaComponents").service("tgAttachmentsFullService",t)}.call(this),function(){var t;t=function(){function t(t){this.attachmentsPreviewService=t,taiga.defineImmutableProperty(this,"current",function(t){return function(){return t.attachmentsPreviewService.fileId?t.getCurrent():null}}(this))}return t.$inject=["tgAttachmentsPreviewService"],t.prototype.hasPagination=function(){var t;return t=this.attachments.filter(function(t){return function(t){return taiga.isImage(t.getIn(["file","name"]))}}(this)),t.size>1},t.prototype.getCurrent=function(){var t,e;return t=this.attachments.find(function(t){return function(e){return t.attachmentsPreviewService.fileId===e.getIn(["file","id"])}}(this)),e=t.get("file")},t.prototype.getIndex=function(){return this.attachments.findIndex(function(t){return function(e){return t.attachmentsPreviewService.fileId===e.getIn(["file","id"])}}(this))},t.prototype.next=function(){var t,e;return t=this.getIndex(),e=this.attachments.slice(t+1).find(function(t){return taiga.isImage(t.getIn(["file","name"]))}),e||(e=this.attachments.find(function(t){return taiga.isImage(t.getIn(["file","name"]))})),this.attachmentsPreviewService.fileId=e.getIn(["file","id"])},t.prototype.previous=function(){var t,e;return t=this.getIndex(),e=this.attachments.slice(0,t).findLast(function(t){return taiga.isImage(t.getIn(["file","name"]))}),e||(e=this.attachments.findLast(function(t){return taiga.isImage(t.getIn(["file","name"]))})),this.attachmentsPreviewService.fileId=e.getIn(["file","id"])},t}(),angular.module("taigaComponents").controller("AttachmentsPreview",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(t,r,n,i){return $(document.body).on("keydown.image-preview",function(r){return e.fileId&&(39===r.keyCode?i.next():37===r.keyCode&&i.previous()),t.$digest()}),t.$on("$destroy",function(){return $(document.body).off(".image-preview")})},{scope:{},controller:"AttachmentsPreview",templateUrl:"components/attachments-preview/attachments-preview.html",link:r,controllerAs:"vm",bindToController:{attachments:"="}}},angular.module("taigaComponents").directive("tgAttachmentsPreview",["lightboxService","tgAttachmentsPreviewService",t])}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){}return e(r,t),r.$inject=[],r}(taiga.Service),angular.module("taigaComponents").service("tgAttachmentsPreviewService",t)}.call(this),function(){var t;t=function(){function t(t){this.attachmentsService=t}return t.$inject=["tgAttachmentsService"],t.prototype.addAttachment=function(t){var e;if(e=Immutable.fromJS({file:t,name:t.name,size:t.size}),this.attachmentsService.validate(t)&&(this.attachments=this.attachments.push(e),this.onAdd))return this.onAdd({attachment:e})},t.prototype.addAttachments=function(t){return _.forEach(t,this.addAttachment.bind(this))},t.prototype.deleteAttachment=function(t){if(this.attachments=this.attachments.filter(function(e){return e!==t}),this.onDelete)return this.onDelete({attachment:t})},t}(),angular.module("taigaComponents").controller("AttachmentsSimple",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{scope:{},bindToController:{attachments:"=",onAdd:"&",onDelete:"&"},controller:"AttachmentsSimple",controllerAs:"vm",templateUrl:"components/attachments-simple/attachments-simple.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachmentsSimple",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i,o,s;return i=t(n.tgAttachmentsSortable),o=dragula([r[0]],{copySortSource:!1,copy:!1,mirrorContainer:r[0],moves:function(t){return $(t).is("div[tg-bind-scope]")}}),o.on("dragend",function(t){var r,n;return t=$(t),r=t.scope().attachment,n=t.index(),e.$apply(function(){return i(e,{attachment:r,index:n})})}),s=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&o.dragging}}),e.$on("$destroy",function(){return r.off(),o.destroy()})},{link:e}},t.$inject=["$parse"],angular.module("taigaComponents").directive("tgAttachmentsSortable",t)}.call(this),function(){var t;t=function(t){return{link:function(e,r){return t(function(){return r[0].select()})}}},t.$inject=["$timeout"],angular.module("taigaComponents").directive("tgAutoSelect",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i;return i=n.tgAvatarBig?"avatarBig":"avatar",e.$watch(i,function(e){var n;if(n=t.getAvatar(e,i),r.attr("src",n.url),n.bg)return r.css("background",n.bg)})},{link:e,scope:{avatar:"=tgAvatar",avatarBig:"=tgAvatarBig"}}},t.$inject=["tgAvatarService"],angular.module("taigaComponents").directive("tgAvatar",t),angular.module("taigaComponents").directive("tgAvatarBig",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){var t,e;return t=function(t,e,r){return t.$watch("epics",function(e){if(e&&!e.isIterable)return t.epics=Immutable.fromJS(e)})},e=function(t,e){return e.format?"components/belong-to-epics/belong-to-epics-"+e.format+".html":"components/belong-to-epics/belong-to-epics-pill.html"},{link:t,scope:{epics:"="},templateUrl:e}},e.directive("tgBelongToEpics",t)}.call(this),function(){var t;t=function(){return{scope:{levels:"=",value:"="},templateUrl:"components/board-zoom/board-zoom.html"}},angular.module("taigaComponents").directive("tgBoardZoom",[t])}.call(this),function(){var t;t=function(){function t(){this.index=0}return t.$inject=[],t.prototype.next=function(){if(this.index++,this.index>=this.images.size)return this.index=0},t.prototype.previous=function(){if(this.index--,this.index<0)return this.index=this.images.size-1},t}(),angular.module("taigaComponents").controller("CardSlideshow",t)}.call(this),function(){var t,e;e=angular.module("taigaComponents"),t=function(){return{controller:"CardSlideshow",templateUrl:"components/card-slideshow/card-slideshow.html",bindToController:!0,controllerAs:"vm",scope:{images:"="}}},e.directive("tgCardSlideshow",t)}.call(this),function(){var t;t=function(){function t(){}return t.$inject=[],t.prototype.visible=function(t){return this.zoom.indexOf(t)!==-1},t.prototype.toggleFold=function(){return this.onToggleFold({id:this.item.get("id")})},t.prototype.getClosedTasks=function(){return this.item.getIn(["model","tasks"]).filter(function(t){return t.get("is_closed")})},t.prototype.closedTasksPercent=function(){return 100*this.getClosedTasks().size/this.item.getIn(["model","tasks"]).size},t.prototype.getPermissionsKey=function(){return"task"===this.type?"modify_task":"modify_us"},t.prototype._setVisibility=function(){var t;return t={related:this.visible("related_tasks"),slides:this.visible("attachments")},_.isUndefined(this.item.get("foldStatusChanged"))||(this.visible("related_tasks")&&this.visible("attachments")?(t.related=!this.item.get("foldStatusChanged"),t.slides=!this.item.get("foldStatusChanged")):this.visible("attachments")?(t.related=this.item.get("foldStatusChanged"),t.slides=this.item.get("foldStatusChanged")):this.visible("related_tasks")||this.visible("attachments")||(t.related=this.item.get("foldStatusChanged"),t.slides=this.item.get("foldStatusChanged"))),this.item.getIn(["model","tasks"])&&this.item.getIn(["model","tasks"]).size||(t.related=!1),this.item.get("images")&&this.item.get("images").size||(t.slides=!1),t},t.prototype.isRelatedTasksVisible=function(){var t;return t=this._setVisibility(),t.related},t.prototype.isSlideshowVisible=function(){var t;return t=this._setVisibility(),t.slides},t.prototype.getNavKey=function(){return"task"===this.type?"project-tasks-detail":"project-userstories-detail"},t}(),angular.module("taigaComponents").controller("Card",t)}.call(this),function(){var t,e;e=angular.module("taigaComponents"),t=function(){return{link:function(t){},controller:"Card",controllerAs:"vm",bindToController:!0,templateUrl:"components/card/card.html",scope:{onToggleFold:"&",onClickAssignedTo:"&",onClickEdit:"&",project:"=",item:"=",zoom:"=",zoomLevel:"=",archived:"=",type:"@"}}},e.directive("tgCard",t)}.call(this),function(){var t,e,r;r=this.taiga,e=r.getDefaulColorList,t=function(){function t(t){this.projectService=t,this.colorList=e(),this.checkIsColorRequired(),this.displayColorList=!1}return t.$inject=["tgProjectService"],t.prototype.userCanChangeColor=function(){return!this.requiredPerm||this.projectService.hasPermission(this.requiredPerm)},t.prototype.checkIsColorRequired=function(){if(!this.isColorRequired)return this.colorList=_.dropRight(this.colorList)},t.prototype.setColor=function(t){return this.color=this.initColor},t.prototype.resetColor=function(){if(this.isColorRequired&&!this.color)return this.color=this.initColor},t.prototype.toggleColorList=function(){return this.displayColorList=!this.displayColorList,this.resetColor()},t.prototype.onSelectDropdownColor=function(t){return this.color=t,this.onSelectColor({color:t}),this.toggleColorList()},t.prototype.onKeyDown=function(t){if(13===t.which)return!this.color&&this.isColorRequired||this.onSelectDropdownColor(this.color),t.preventDefault()},t}(),angular.module("taigaComponents").controller("ColorSelectorCtrl",t)}.call(this),function(){var t,e;e=this.taiga.bindOnce,t=function(t){var e;return e=function(e,r,n,i){var o,s,a;return o=null,s=function(){return t.cancel(o),o=null},a=function(){if(!o)return o=t(function(){return i.displayColorList=!1,i.resetColor()},400)},r.find(".color-selector").mouseenter(s).mouseleave(a),r.find(".color-selector-dropdown").mouseenter(s).mouseleave(a),e.$watch("vm.initColor",function(t){return i.setColor(t)})},{link:e,templateUrl:"components/color-selector/color-selector.html",controller:"ColorSelectorCtrl",controllerAs:"vm",bindToController:{isColorRequired:"=",onSelectColor:"&",initColor:"=",requiredPerm:"@"},scope:{}}},t.$inject=["$timeout"],angular.module("taigaComponents").directive("tgColorSelector",t)}.call(this),function(){var t,e;e=angular.module("taigaUserStories"),t=function(){function t(t,e,r,n,i){this.rootScope=t,this.confirm=e,this.modelTransform=r,this.navUrls=n,this.window=i,this.editMode=!1,this.loadingSubject=!1,this.originalSubject=this.item.subject}return t.$inject=["$rootScope","$tgConfirm","$tgQueueModelTransformation","$tgNavUrls","$window"],t.prototype._checkNav=function(){var t,e,r;if(null!=(null!=(e=this.item.neighbors.previous)?e.ref:void 0)&&(t={project:this.project.slug,ref:this.item.neighbors.previous.ref},this.previousUrl=this.navUrls.resolve("project-"+this.item._name+"-detail",t)),null!=(null!=(r=this.item.neighbors.next)?r.ref:void 0))return t={project:this.project.slug,ref:this.item.neighbors.next.ref},this.nextUrl=this.navUrls.resolve("project-"+this.item._name+"-detail",t)},t.prototype._checkPermissions=function(){return this.permissions={canEdit:_.includes(this.project.my_permissions,this.requiredPerm)}},t.prototype.editSubject=function(t){var e;if(e=this.window.getSelection(),"Range"!==e.type&&(t&&(this.editMode=!0),!t))return this.editMode=!1},t.prototype.onKeyDown=function(t){if(13===t.which&&this.saveSubject(),27===t.which)return this.item.subject=this.originalSubject,this.editSubject(!1)},t.prototype.saveSubject=function(){var t,e,r,n;return r=function(t){return function(){return t.loadingSubject=!1,t.rootScope.$broadcast("object:updated"),t.confirm.notify("success"),t.originalSubject=t.item.subject}}(this),e=function(t){return function(){return t.loadingSubject=!1,t.confirm.notify("error")}}(this),this.editMode=!1,this.loadingSubject=!0,t=this.item,n=this.modelTransform.save(function(t){return t}),n.then(r,e)},t}(),e.controller("StoryHeaderCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaUserStories"),t=function(){var t;return this.$inject=[],t=function(t,e,r,n){return n._checkPermissions(),n._checkNav()},{link:t,controller:"StoryHeaderCtrl",bindToController:!0,scope:{item:"=",project:"=",requiredPerm:"@"},controllerAs:"vm",templateUrl:"components/detail/header/detail-header.html"}},e.directive("tgDetailHeader",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n,i){var o;return o=t(n.tgFileChange),r.on("change",function(t){return e.$apply(function(){return o(e,{files:t.currentTarget.files})})}),e.$on("$destroy",function(){return r.off()})},{require:"ngModel",restrict:"A",link:e}},t.$inject=["$parse"],angular.module("taigaComponents").directive("tgFileChange",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=taiga.generateHash,t=function(t){function n(t,e,r){this.q=t,this.urls=e,this.http=r}return r(n,t),n.$inject=["$q","$tgUrls","$tgHttp"],n.prototype.storeFilters=function(t,r,n){var i,o,s,a,u;return i=this.q.defer(),u=this.urls.resolve("user-storage"),s=t+":"+n,o=e([t,s]),_.isEmpty(r)?(a=this.http["delete"](u+"/"+o,{key:o,value:r}),a.then(function(){return i.resolve()}),a.then(null,function(){return i.reject()})):(a=this.http.put(u+"/"+o,{key:o,value:r}),a.then(function(t){return i.resolve()}),a.then(null,function(t){return function(e){var n;return n=t.http.post(""+u,{key:o,value:r}),n.then(function(){return i.resolve()}),n.then(null,function(){return i.reject()})}}(this))),i.promise},n.prototype.getFilters=function(t,r){var n,i,o,s,a;return n=this.q.defer(),a=this.urls.resolve("user-storage"),o=t+":"+r,i=e([t,o]),s=this.http.get(a+"/"+i),s.then(function(t){return n.resolve(t.data.value)}),s.then(null,function(t){return n.resolve({})}),n.promise},n}(taiga.Service),angular.module("taigaComponents").service("tgFilterRemoteStorageService",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){var i;return i=$("tg-filter"),t.$watch(r.ngIf,function(t){var r,n;if(t)return i.find(".filter-list").hide(),n=i.height(),r=0,i.children().each(function(){return r+=$(this).outerHeight(!0)}),$(e.context.nextSibling).css({"max-height":n-r,display:"block"})})},{priority:900,link:t}},angular.module("taigaComponents").directive("tgFilterSlideDown",[t])}.call(this),function(){var t;t=function(){function t(){this.opened=null,this.customFilterForm=!1,this.customFilterName=""}return t.$inject=[],t.prototype.toggleFilterCategory=function(t){return this.opened===t?this.opened=null:this.opened=t},t.prototype.isOpen=function(t){return this.opened===t},t.prototype.saveCustomFilter=function(){return this.onSaveCustomFilter({name:this.customFilterName}),this.customFilterForm=!1,this.opened="custom-filter",this.customFilterName=""},t.prototype.changeQ=function(){return this.onChangeQ({q:this.q})},t.prototype.unselectFilter=function(t){return this.onRemoveFilter({filter:t})},t.prototype.unselectFilter=function(t){return this.onRemoveFilter({filter:t})},t.prototype.selectFilter=function(t,e){return e={category:t,filter:e},this.onAddFilter({filter:e})},t.prototype.removeCustomFilter=function(t){return this.onRemoveCustomFilter({filter:t})},t.prototype.selectCustomFilter=function(t){return this.onSelectCustomFilter({filter:t})},t.prototype.isFilterSelected=function(t,e){return!!_.find(this.selectedFilters,function(r){return e.id===r.id&&t.dataType===r.dataType})},t}(),angular.module("taigaComponents").controller("Filter",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{scope:{onChangeQ:"&",onAddFilter:"&",onSelectCustomFilter:"&",onRemoveFilter:"&",onRemoveCustomFilter:"&",onSaveCustomFilter:"&",customFilters:"<",q:"<",filters:"<",customFilters:"<",selectedFilters:"<"},bindToController:!0,controller:"Filter",controllerAs:"vm",templateUrl:"components/filter/filter.html",link:t}},angular.module("taigaComponents").directive("tgFilter",[t])}.call(this),function(){var t,e;e=this.taiga,t=function(t,e,r,n,i){var o;return o=function(n,o,s,a){var u,c,l;return l=null,c=introJs(),c.oncomplete(function(){return $("html,body").scrollTop(0)}),c.onexit(function(){return e.disableJoyRide()}),u=function(t,e){if(e[t.joyride])return c.setOptions({exitOnEsc:!1,exitOnOverlayClick:!1,showStepNumbers:!1,nextLabel:i.instant("JOYRIDE.NAV.NEXT")+" →",prevLabel:"← "+i.instant("JOYRIDE.NAV.BACK"),skipLabel:i.instant("JOYRIDE.NAV.SKIP"),doneLabel:i.instant("JOYRIDE.NAV.DONE"),disableInteraction:!0}),c.setOption("steps",r.get(t.joyride)),c.start()},t.$on("$routeChangeSuccess",function(r,n){return n.joyride&&e.isAuthenticated()?(c.oncomplete(function(){return e.disableJoyRide(n.joyride)}),n.loader?l=t.$on("loader:end",function(){return e.loadJoyRideConfig().then(function(t){return u(n,t)}),l()}):e.loadJoyRideConfig().then(function(t){return u(n,t)})):(c.exit(),void(l&&l()))})},{scope:{},link:o}},t.$inject=["$rootScope","tgCurrentUserService","tgJoyRideService","$location","$translate"],angular.module("taigaComponents").directive("tgJoyRide",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,e){this.translate=t,this.checkPermissionsService=e}return e(r,t),r.$inject=["$translate","tgCheckPermissionsService"],r.prototype.getConfig=function(){return{dashboard:function(t){return function(){var e;return e=[{element:".project-list > section:not(.ng-hide)",position:"left",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP1.TITLE"),text:t.translate.instant("JOYRIDE.DASHBOARD.STEP1.TEXT")}},{element:".working-on-container",position:"right",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP2.TITLE"),text:t.translate.instant("JOYRIDE.DASHBOARD.STEP2.TEXT")}},{element:".watching-container",position:"right",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP3.TITLE"),text:[t.translate.instant("JOYRIDE.DASHBOARD.STEP3.TEXT1"),t.translate.instant("JOYRIDE.DASHBOARD.STEP3.TEXT2")]}}],$(".project-list .create-project-button").is(":hidden")||e.push({element:".project-list .create-project-button",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP4.TITLE"),text:[t.translate.instant("JOYRIDE.DASHBOARD.STEP4.TEXT1"),t.translate.instant("JOYRIDE.DASHBOARD.STEP4.TEXT2")]}}),e}}(this),backlog:function(t){return function(){var e;return e=[{element:".summary",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP1.TITLE"),text:[t.translate.instant("JOYRIDE.BACKLOG.STEP1.TEXT1"),t.translate.instant("JOYRIDE.BACKLOG.STEP1.TEXT2")]}},{element:".backlog-table-empty",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP2.TITLE"),text:t.translate.instant("JOYRIDE.BACKLOG.STEP2.TEXT")}},{element:".sprints",position:"left",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP3.TITLE"),text:t.translate.instant("JOYRIDE.BACKLOG.STEP3.TEXT")}}],t.checkPermissionsService.check("add_us")&&e.push({element:".new-us",position:"rigth",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP4.TITLE"),text:t.translate.instant("JOYRIDE.BACKLOG.STEP4.TEXT")}}),e}}(this),kanban:function(t){return function(){var e;return e=[{element:".kanban-table-inner",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.KANBAN.STEP1.TITLE"),text:t.translate.instant("JOYRIDE.KANBAN.STEP1.TEXT")}},{element:".card-placeholder",position:"right",joyride:{title:t.translate.instant("JOYRIDE.KANBAN.STEP2.TITLE"),text:t.translate.instant("JOYRIDE.KANBAN.STEP2.TEXT")}}],t.checkPermissionsService.check("add_us")&&e.push({element:".add-action",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.KANBAN.STEP3.TITLE"),text:[t.translate.instant("JOYRIDE.KANBAN.STEP3.TEXT1"),t.translate.instant("JOYRIDE.KANBAN.STEP3.TEXT2")]}}),e}}(this)}},r.prototype.get=function(t){var e,r;return r=this.getConfig(),e=r[t].call(this),_.map(e,function(t){var e;return e="",t.joyride.title&&(e+="

"+t.joyride.title+"

"),_.isArray(t.joyride.text)?_.forEach(t.joyride.text,function(t){return e+="

"+t+"

"}):e+="

"+t.joyride.text+"

",t.intro=e,t})},r}(taiga.Service),angular.module("taigaComponents").service("tgJoyRideService",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(r,n,i,o){var s,a,u;return r.zoomIndex=t.get("kanban_zoom")||2,r.levels=5,u=[["ref"],["subject"],["owner","tags","extra_info","unfold"],["attachments"],["related_tasks"]],s=function(e){return null==e&&(e=0),t.get("kanban_zoom")!==e&&t.set("kanban_zoom",e),_.reduce(u,function(t,r,n){return n<=e&&(t=t.concat(r)),t})},r.$watch("zoomIndex",function(t){var e;return e=s(t),r.onZoomChange({zoomLevel:t,zoom:e})}),a=r.$watch(function(){return e.project; },function(t){if(t)return t.get("my_permissions").indexOf("view_tasks")===-1&&(r.levels=4),a()})},{scope:{onZoomChange:"&"},template:'',link:r}},angular.module("taigaComponents").directive("tgKanbanBoardZoom",["$tgStorage","tgProjectService",t])}.call(this),function(){var t;t=function(t){var e;return e=function(t,e,r){},{restrict:"AE",scope:{},controllerAs:"vm",controller:function(){return this.close=function(){return t.open=!1},Object.defineProperties(this,{open:{get:function(){return t.open}},title:{get:function(){return t.title}},desc:{get:function(){return t.desc}}})},link:e,templateUrl:"components/live-announcement/live-announcement.html"}},t.$inject=["tgLiveAnnouncementService"],angular.module("taigaComponents").directive("tgLiveAnnouncement",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){this.open=!1,this.title="",this.desc=""}return e(r,t),r.prototype.show=function(t,e){return this.open=!0,this.title=t,this.desc=e},r}(taiga.Service),angular.module("taigaComponents").service("tgLiveAnnouncementService",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){return e.$watch("project",function(e){var n,i;if(e=Immutable.fromJS(e))return i=e.get("logo_big_url"),i?(r.attr("src",i),r.css("background","")):(n=t.getDefaultProjectLogo(e.get("slug"),e.get("id")),r.attr("src",n.src),r.css("background",n.color))})},{link:e,scope:{project:"=tgProjectLogoBigSrc"}}},t.$inject=["tgProjectLogoService"],angular.module("taigaComponents").directive("tgProjectLogoBigSrc",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){return e.$watch("project",function(e){var n,i;if(e=Immutable.fromJS(e))return i=e.get("logo_small_url"),i?(r.attr("src",i),r.css("background","")):(n=t.getDefaultProjectLogo(e.get("slug"),e.get("id")),r.attr("src",n.src),r.css("background",n.color))})},{link:e,scope:{project:"=tgProjectLogoSmallSrc"}}},t.$inject=["tgProjectLogoService"],angular.module("taigaComponents").directive("tgProjectLogoSmallSrc",t)}.call(this),function(){var t;t=function(){function t(t,e){this.projectService=t,this.lightboxFactory=e,this.project=null,this.menu=Immutable.Map()}return t.$inject=["tgProjectService","tgLightboxFactory"],t.prototype.show=function(){return this.project=this.projectService.project,this.active=this._getActiveSection(),this._setVideoConference(),this._setMenuPermissions()},t.prototype.hide=function(){return this.project=null,this.menu={}},t.prototype.search=function(){return this.lightboxFactory.create("tg-search-box",{"class":"lightbox lightbox-search"})},t.prototype._setVideoConference=function(){var t;if(t=this._videoConferenceUrl())return this.project=this.project.set("videoconferenceUrl",t)},t.prototype._setMenuPermissions=function(){if(this.menu=Immutable.Map({epics:!1,backlog:!1,kanban:!1,issues:!1,wiki:!1}),this.project.get("is_epics_activated")&&this.project.get("my_permissions").indexOf("view_epics")!==-1&&(this.menu=this.menu.set("epics",!0)),this.project.get("is_backlog_activated")&&this.project.get("my_permissions").indexOf("view_us")!==-1&&(this.menu=this.menu.set("backlog",!0)),this.project.get("is_kanban_activated")&&this.project.get("my_permissions").indexOf("view_us")!==-1&&(this.menu=this.menu.set("kanban",!0)),this.project.get("is_issues_activated")&&this.project.get("my_permissions").indexOf("view_issues")!==-1&&(this.menu=this.menu.set("issues",!0)),this.project.get("is_wiki_activated")&&this.project.get("my_permissions").indexOf("view_wiki_pages")!==-1)return this.menu=this.menu.set("wiki",!0)},t.prototype._getActiveSection=function(){var t,e,r,n,i;return n=this.projectService.section,i=this.projectService.sectionsBreadcrumb,t=i.lastIndexOf("backlog"),e=i.lastIndexOf("kanban"),t===-1&&e===-1||(r=e===-1||t>e?"backlog":"kanban"),"backlog-kanban"===n&&("backlog"===r||"kanban"===r?n=r:this.project.get("is_backlog_activated")&&!this.project.get("is_kanban_activated")?n="backlog":!this.project.get("is_backlog_activated")&&this.project.get("is_kanban_activated")&&(n="kanban")),n},t.prototype._videoConferenceUrl=function(){var t,e;if("appear-in"===this.project.get("videoconferences"))t="https://appear.in/";else if("talky"===this.project.get("videoconferences"))t="https://talky.io/";else{if("jitsi"!==this.project.get("videoconferences"))return"custom"===this.project.get("videoconferences")?this.project.get("videoconferences_extra_data"):"";t="https://meet.jit.si/"}return e=this.project.get("videoconferences_extra_data")?this.project.get("slug")+"-"+taiga.slugify(this.project.get("videoconferences_extra_data")):this.project.get("slug"),"jitsi"===this.project.get("videoconferences")&&(e=e.replace(/-/g,"")),t+e},t}(),angular.module("taigaComponents").controller("ProjectMenu",t)}.call(this),function(){var t,e;e=this.taiga,t=function(t,e){var r;return r=function(e,r,n,i){var o;return o=function(){return t.project?i.show():i.hide()},e.$watch(function(){return t.project},o),e.vm.fixed=!1,$(window).on("scroll",function(){var t;return t=$(window).scrollTop(),t>100&&e.vm.fixed===!1?(e.vm.fixed=!0,e.$digest()):t<100&&e.vm.fixed===!0?(e.vm.fixed=!1,e.$digest()):void 0})},{scope:{},controller:"ProjectMenu",controllerAs:"vm",templateUrl:"components/project-menu/project-menu.html",link:r}},t.$inject=["tgProjectService","tgLightboxFactory"],angular.module("taigaComponents").directive("tgProjectMenu",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){var t,e,r,n;return r=function(t){var e,r,n;return t.addClass("selected"),n=t.position().top+t.outerHeight(),e=t.parent().outerHeight(),n>e?(r=n-e,t.parent().scrollTop(t.parent().scrollTop()+r)):t.position().top<0?t.parent().scrollTop(t.parent().scrollTop()+t.position().top):void 0},t=function(t,e,n){var i,o,s;if(i=t.find(".selected"),40===e){if(!i.length)return r(t.find("li:first"));if(o=i.next("li"),o.length)return i.removeClass("selected"),r(o)}else if(38===e){if(!i.length)return r(t.find("li:last"));if(s=i.prev("li"),s.length)return i.removeClass("selected"),r(s)}},n=function(){return $(document).off(".tags-keyboard-navigation")},e=function(e,r){return n(),$(document).on("keydown.tags-keyboard-navigation",function(n){return function(n){var i;if(i=n.keyCode?n.keyCode:n.which,40===i||38===i)return n.preventDefault(),t(r,i,e)}}(this)),e.$on("$destroy",n)},{link:e,templateUrl:"components/tags/tag-dropdown/tag-dropdown.html",scope:{onSelectTag:"&",colorArray:"=",tag:"="}}},e.directive("tgTagsDropdown",t)}.call(this),function(){var t,e,r;r=this.taiga.trim,e=angular.module("taigaCommon"),t=function(){function t(t){this.tagLineService=t,this.disableColorSelection=!1,this.newTag={name:"",color:null},this.colorArray=[],this.addTag=!1}return t.$inject=["tgTagLineService"],t.prototype.checkPermissions=function(){return this.tagLineService.checkPermissions(this.project.my_permissions,this.permissions)},t.prototype._createColorsArray=function(t){return this.colorArray=this.tagLineService.createColorsArray(t)},t.prototype.displayTagInput=function(){return this.addTag=!0},t.prototype.addNewTag=function(t,e){if(this.newTag.name="",this.newTag.color=null,t.length)return this.disableColorSelection?t.length?this.onAddTag({name:t,color:e}):void 0:(this.project.tags_colors[t]&&(e=this.project.tags_colors[t]),this.onAddTag({name:t,color:e}))},t.prototype.selectColor=function(t){return this.newTag.color=t},t}(),e.controller("TagLineCommonCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){var t;return t=function(t,e,r,n){var i;return _.isUndefined(r.disableColorSelection)||(n.disableColorSelection=!0),i=t.$watch("vm.project",function(t){if(t&&Object.keys(t).length)return i(),n.disableColorSelection?void 0:n.colorArray=n._createColorsArray(n.project.tags_colors)}),e.on("keydown",".tag-input",function(r){var i;return 27===r.keyCode?(n.addTag=!1,n.newTag.name="",n.newTag.color="",r.stopPropagation()):13===r.keyCode&&(r.preventDefault(),e.find(".tags-dropdown .selected").length?(i=$(".tags-dropdown .selected .tags-dropdown-name").text(),n.addNewTag(i,null)):n.addNewTag(n.newTag.name,n.newTag.color)),t.$apply()})},{link:t,scope:{permissions:"@",loadingAddTag:"=",loadingRemoveTag:"=",tags:"=",project:"=",onAddTag:"&",onDeleteTag:"&"},templateUrl:"components/tags/tag-line-common/tag-line-common.html",controller:"TagLineCommonCtrl",controllerAs:"vm",bindToController:!0}},e.directive("tgTagLineCommon",t)}.call(this),function(){var t,e,r;r=this.taiga.trim,e=angular.module("taigaCommon"),t=function(){function t(t,e,r){this.rootScope=t,this.confirm=e,this.modelTransform=r,this.loadingAddTag=!1}return t.$inject=["$rootScope","$tgConfirm","$tgQueueModelTransformation"],t.prototype.onDeleteTag=function(t){var e,n,i,o;return this.loadingRemoveTag=t[0],n=function(t){return function(e){return t.rootScope.$broadcast("object:updated"),t.loadingRemoveTag=!1,e}}(this),e=function(t){return function(){return t.confirm.notify("error"),t.loadingRemoveTag=!1}}(this),i=r(t[0].toLowerCase()),o=this.modelTransform.save(function(t){var e;return e=_.clone(t.tags),_.remove(e,function(t){return t[0]===i}),t.tags=e,t}),o.then(n,e)},t.prototype.onAddTag=function(t,e){var n,i,o;return this.loadingAddTag=!0,i=function(t){return function(e){return t.rootScope.$broadcast("object:updated"),t.addTag=!1,t.loadingAddTag=!1,e}}(this),n=function(t){return function(){return t.loadingAddTag=!1,t.confirm.notify("error")}}(this),o=this.modelTransform.save(function(n){return function(n){var i,o;return o=r(t.toLowerCase()),i=_.clone(n.tags),i.push([t,e]),n.tags=i,n}}(this)),o.then(i,n)},t}(),e.controller("TagLineCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){return{scope:{item:"=",permissions:"@",project:"="},templateUrl:"components/tags/tag-line-detail/tag-line-detail.html",controller:"TagLineCtrl",controllerAs:"vm",bindToController:!0}},e.directive("tgTagLine",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=angular.module("taigaCommon"),t=function(t){function e(){}return r(e,t),e.$inject=[],e.prototype.checkPermissions=function(t,e){return _.includes(t,e)},e.prototype.createColorsArray=function(t){return _.map(t,function(t,e){return[e,t]})},e}(taiga.Service),e.service("tgTagLineService",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){return{templateUrl:"components/tags/tag/tag.html",scope:{tag:"<",loadingRemoveTag:"<",onDeleteTag:"&",hasPermissions:"@"}}},e.directive("tgTag",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n,i){var o,s;return e.zoomIndex=t.get("taskboard_zoom")||2,e.levels=4,s=[["ref"],["subject"],["owner","tags","extra_info","unfold"],["attachments"],["related_tasks"]],o=function(e){return null==e&&(e=0),t.get("taskboard_zoom")!==e&&t.set("taskboard_zoom",e),_.reduce(s,function(t,r,n){return n<=e&&(t=t.concat(r)),t})},e.$watch("zoomIndex",function(t){var r;return r=o(t),e.onZoomChange({zoomLevel:t,zoom:r})})},{scope:{onZoomChange:"&"},template:'',link:e}},angular.module("taigaComponents").directive("tgTaskboardZoom",["$tgStorage",t])}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){return e.privacyPolicyUrl=t.get("privacyPolicyUrl"),e.termsOfServiceUrl=t.get("termsOfServiceUrl")},{restrict:"AE",scope:{},link:e,templateUrl:"components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.html"}},angular.module("taigaComponents").directive("tgTermsOfServiceAndPrivacyPolicyNotice",["$tgConfig",t])}.call(this),function(){var t;t=function(t,e){var r;return r=function(r,n,i){return r.vm={},r.vm.tribeHost=t.config.tribeHost,r.vm.url=e.protocol()+"://"+e.host(),"http"===e.protocol()&&80!==e.port()?r.vm.url=r.vm.url+":"+e.port():"https"===e.protocol()&&443!==e.port()?r.vm.url=r.vm.url+":"+e.port():void 0},{scope:{usId:"=",projectSlug:"="},controllerAs:"vm",templateUrl:"components/tribe-button/tribe-button.html",link:r}},t.$inject=["$tgConfig","$tgLocation"],angular.module("taigaComponents").directive("tgTribeButton",t)}.call(this),function(){var t;t=function(t){var e,r;return r=function(e,r,n){return e.vm={},e.vm.tribeHost=t.config.tribeHost,e.vm.show=function(){return e.vm.open=!0},e.vm.hide=function(t){return e.vm.open=!1}},e={templateUrl:"components/tribe-button/tribe-linked.html",scope:{gigTitle:"=",gigId:"="},link:r}},t.$inject=["$tgConfig"],angular.module("taigaComponents").directive("tgTribeLinked",t)}.call(this),function(){var t;t=function(){function t(t){this.currentUserService=t,this.user=this.currentUserService.getUser(),this.isMouseOver=!1,this.loading=!1}return t.$inject=["tgCurrentUserService"],t.prototype.showTextWhenMouseIsOver=function(){return this.isMouseOver=!0},t.prototype.showTextWhenMouseIsLeave=function(){return this.isMouseOver=!1},t.prototype.toggleVote=function(){var t;return this.loading=!0,t=this.item.is_voter?this._downvote():this._upvote(),t["finally"](function(t){return function(){return t.loading=!1}}(this)),t},t.prototype._upvote=function(){return this.onUpvote().then(function(t){return function(){return t.showTextWhenMouseIsLeave()}}(this))},t.prototype._downvote=function(){return this.onDownvote()},t}(),angular.module("taigaComponents").controller("VoteButton",t)}.call(this),function(){var t;t=function(){return{scope:{},controller:"VoteButton",bindToController:{item:"=",onUpvote:"=",onDownvote:"="},controllerAs:"vm",templateUrl:"components/vote-button/vote-button.html"}},angular.module("taigaComponents").directive("tgVoteButton",t)}.call(this),function(){var t;t=function(){function t(t,e){this.currentUserService=t,this.rootScope=e,this.user=this.currentUserService.getUser(),this.isMouseOver=!1,this.loading=!1}return t.$inject=["tgCurrentUserService","$rootScope"],t.prototype.showTextWhenMouseIsOver=function(){return this.isMouseOver=!0},t.prototype.showTextWhenMouseIsLeave=function(){return this.isMouseOver=!1},t.prototype.openWatchers=function(){return this.rootScope.$broadcast("watcher:add",this.item)},t.prototype.getPerms=function(){var t,e;return this.item?(t=this.item._name,e={userstories:"modify_us",issues:"modify_issue",tasks:"modify_task",epics:"modify_epic"},e[t]):""},t.prototype.toggleWatch=function(){var t;return this.loading=!0,t=this.item.is_watcher?this._unwatch():this._watch(),t["finally"](function(t){return function(){return t.loading=!1}}(this)),t},t.prototype._watch=function(){return this.onWatch().then(function(t){return function(){return t.showTextWhenMouseIsLeave()}}(this))},t.prototype._unwatch=function(){return this.onUnwatch()},t}(),angular.module("taigaComponents").controller("WatchButton",t)}.call(this),function(){var t;t=function(){return{scope:{},controller:"WatchButton",bindToController:{item:"=",onWatch:"=",onUnwatch:"="},controllerAs:"vm",templateUrl:function(t,e){return"components/watch-button/watch-button-"+e.environment+".html"}}},angular.module("taigaComponents").directive("tgWatchButton",t)}.call(this),function(){var t;t=function(){function t(t){this.translate=t,this.is_open=!1,this.texts={week:this.translate.instant("DISCOVER.FILTERS.WEEK"),month:this.translate.instant("DISCOVER.FILTERS.MONTH"),year:this.translate.instant("DISCOVER.FILTERS.YEAR"),all:this.translate.instant("DISCOVER.FILTERS.ALL_TIME")}}return t.$inject=["$translate"],t.prototype.currentText=function(){return this.texts[this.currentOrderBy]},t.prototype.open=function(){return this.is_open=!0},t.prototype.close=function(){return this.is_open=!1},t.prototype.orderBy=function(t){return this.currentOrderBy=t,this.is_open=!1,this.onChange({orderBy:this.currentOrderBy})},t}(),angular.module("taigaDiscover").controller("DiscoverHomeOrderBy",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{controller:"DiscoverHomeOrderBy",controllerAs:"vm",bindToController:!0,templateUrl:"discover/components/discover-home-order-by/discover-home-order-by.html",scope:{currentOrderBy:"=orderBy",onChange:"&"},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverHomeOrderBy",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"projects",function(t){return function(){return t.discoverProjectsService.projectsCount}}(this)),this.discoverProjectsService.fetchStats()}return t.$inject=["tgDiscoverProjectsService"],t.prototype.selectFilter=function(t){return this.onChange({filter:t,q:this.q})},t.prototype.submitFilter=function(){return this.onChange({filter:this.filter,q:this.q})},t}(),angular.module("taigaDiscover").controller("DiscoverSearchBar",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{controller:"DiscoverSearchBar",controllerAs:"vm",templateUrl:"discover/components/discover-search-bar/discover-search-bar.html",bindToController:!0,scope:{q:"=",filter:"=",onChange:"&"},compile:function(t,e){if(!e.q)return e.q=""},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverSearchBar",t)}.call(this),function(){var t;t=function(){function t(){this.like_is_open=0===this.orderBy.indexOf("-total_fans"),this.activity_is_open=0===this.orderBy.indexOf("-total_activity")}return t.$inject=[],t.prototype.openLike=function(){return this.like_is_open=!0,this.activity_is_open=!1,this.setOrderBy("-total_fans_last_week")},t.prototype.openActivity=function(){return this.activity_is_open=!0,this.like_is_open=!1,this.setOrderBy("-total_activity_last_week")},t.prototype.setOrderBy=function(t){return null==t&&(t=""),t||(this.like_is_open=!1,this.activity_is_open=!1),this.onChange({orderBy:t})},t}(),angular.module("taigaDiscover").controller("DiscoverSearchListHeader",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{controller:"DiscoverSearchListHeader",controllerAs:"vm",bindToController:!0,templateUrl:"discover/components/discover-search-list-header/discover-search-list-header.html",scope:{onChange:"&",orderBy:"="},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverSearchListHeader",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"featured",function(t){return function(){return t.discoverProjectsService.featured}}(this)),this.discoverProjectsService.fetchFeatured()}return t.$inject=["tgDiscoverProjectsService"],t}(),angular.module("taigaDiscover").controller("FeaturedProjects",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{controller:"FeaturedProjects",controllerAs:"vm",templateUrl:"discover/components/featured-projects/featured-projects.html",scope:{},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgFeaturedProjects",t)}.call(this),function(){var t;t=function(){return{templateUrl:"discover/components/highlighted/highlighted.html",scope:{loading:"=",highlighted:"=",orderBy:"="}}},t.$inject=[],angular.module("taigaDiscover").directive("tgHighlighted",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"highlighted",function(t){return function(){return t.discoverProjectsService.mostActive}}(this)),this.currentOrderBy="week",this.order_by=this.getOrderBy()}return t.$inject=["tgDiscoverProjectsService"],t.prototype.fetch=function(){return this.loading=!0,this.order_by=this.getOrderBy(),this.discoverProjectsService.fetchMostActive({order_by:this.order_by}).then(function(t){return function(){return t.loading=!1}}(this))},t.prototype.orderBy=function(t){return this.currentOrderBy=t,this.fetch()},t.prototype.getOrderBy=function(t){return"all"===this.currentOrderBy?"-total_activity":"-total_activity_last_"+this.currentOrderBy},t}(),angular.module("taigaDiscover").controller("MostActive",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.fetch()},{controller:"MostActive",controllerAs:"vm",templateUrl:"discover/components/most-active/most-active.html",scope:{},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgMostActive",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"highlighted",function(t){return function(){return t.discoverProjectsService.mostLiked}}(this)),this.currentOrderBy="week",this.order_by=this.getOrderBy()}return t.$inject=["tgDiscoverProjectsService"],t.prototype.fetch=function(){return this.loading=!0,this.order_by=this.getOrderBy(),this.discoverProjectsService.fetchMostLiked({order_by:this.order_by}).then(function(t){return function(){return t.loading=!1}}(this))},t.prototype.orderBy=function(t){return this.currentOrderBy=t,this.fetch()},t.prototype.getOrderBy=function(){return"all"===this.currentOrderBy?"-total_fans":"-total_fans_last_"+this.currentOrderBy},t}(),angular.module("taigaDiscover").controller("MostLiked",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.fetch()},{controller:"MostLiked",controllerAs:"vm",templateUrl:"discover/components/most-liked/most-liked.html",scope:{},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgMostLiked",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n){var i,o;this.location=t,this.navUrls=e,this.appMetaService=r,this.translate=n,o=this.translate.instant("DISCOVER.PAGE_TITLE"),i=this.translate.instant("DISCOVER.PAGE_DESCRIPTION"),this.appMetaService.setAll(o,i)}return t.$inject=["$tgLocation","$tgNavUrls","tgAppMetaService","$translate"],t.prototype.onSubmit=function(t){var e;return e=this.navUrls.resolve("discover-search"),this.location.search("text",t).path(e)},t}(),angular.module("taigaDiscover").controller("DiscoverHome",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n,i){var o,s;this.routeParams=t,this.discoverProjectsService=e,this.route=r,this.appMetaService=n,this.translate=i,this.page=1,taiga.defineImmutableProperty(this,"searchResult",function(t){return function(){return t.discoverProjectsService.searchResult}}(this)),taiga.defineImmutableProperty(this,"nextSearchPage",function(t){return function(){return t.discoverProjectsService.nextSearchPage}}(this)),this.q=this.routeParams.text,this.filter=this.routeParams.filter||"all",this.orderBy=this.routeParams.order_by||"",this.loadingGlobal=!1,this.loadingList=!1,this.loadingPagination=!1,s=this.translate.instant("DISCOVER.SEARCH.PAGE_TITLE"),o=this.translate.instant("DISCOVER.SEARCH.PAGE_DESCRIPTION"),this.appMetaService.setAll(s,o)}return t.$inject=["$routeParams","tgDiscoverProjectsService","$route","tgAppMetaService","$translate"],t.prototype.fetch=function(){return this.page=1,this.discoverProjectsService.resetSearchList(),this.search()},t.prototype.fetchByGlobalSearch=function(){if(!this.loadingGlobal)return this.loadingGlobal=!0,this.fetch().then(function(t){return function(){return t.loadingGlobal=!1}}(this))},t.prototype.fetchByOrderBy=function(){if(!this.loadingList)return this.loadingList=!0,this.fetch().then(function(t){return function(){return t.loadingList=!1}}(this))},t.prototype.showMore=function(){if(!this.loadingPagination)return this.loadingPagination=!0,this.page++,this.search().then(function(t){return function(){return t.loadingPagination=!1}}(this))},t.prototype.search=function(){var t,e;return t=this.getFilter(),e={page:this.page,q:this.q,order_by:this.orderBy},_.assign(e,t),this.discoverProjectsService.fetchSearch(e)},t.prototype.getFilter=function(){return"people"===this.filter?{is_looking_for_people:!0}:"scrum"===this.filter?{is_backlog_activated:!0}:"kanban"===this.filter?{is_kanban_activated:!0}:{}},t.prototype.onChangeFilter=function(t,e){return this.filter=t,this.q=e,this.route.updateParams({filter:this.filter,text:this.q}),this.fetchByGlobalSearch()},t.prototype.onChangeOrder=function(t){return this.orderBy=t,this.route.updateParams({order_by:t}),this.fetchByOrderBy()},t}(),angular.module("taigaDiscover").controller("DiscoverSearch",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.fetch()},{controller:"DiscoverSearch",controllerAs:"vm",link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverSearch",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga,t=function(t){function n(t,r){this.rs=t,this.projectsService=r,this._mostLiked=Immutable.List(),this._mostActive=Immutable.List(),this._featured=Immutable.List(),this._searchResult=Immutable.List(),this._projectsCount=0,this.decorate=this.projectsService._decorate.bind(this.projectsService),e.defineImmutableProperty(this,"mostLiked",function(t){return function(){return t._mostLiked}}(this)),e.defineImmutableProperty(this,"mostActive",function(t){return function(){return t._mostActive}}(this)),e.defineImmutableProperty(this,"featured",function(t){return function(){return t._featured}}(this)),e.defineImmutableProperty(this,"searchResult",function(t){return function(){return t._searchResult}}(this)),e.defineImmutableProperty(this,"nextSearchPage",function(t){return function(){return t._nextSearchPage}}(this)),e.defineImmutableProperty(this,"projectsCount",function(t){return function(){return t._projectsCount}}(this))}var i;return r(n,t),n.$inject=["tgResources","tgProjectsService"],i={discover_mode:!0},n.prototype.fetchMostLiked=function(t){var e;return e=_.extend({},i,t),this.rs.projects.getProjects(e,!1).then(function(t){return function(e){var r,n;return r=e.data.slice(0,5),n=Immutable.fromJS(r),n=n.map(t.decorate),t._mostLiked=n}}(this))},n.prototype.fetchMostActive=function(t){var e;return e=_.extend({},i,t),this.rs.projects.getProjects(e,!1).then(function(t){return function(e){var r,n;return r=e.data.slice(0,5),n=Immutable.fromJS(r),n=n.map(t.decorate),t._mostActive=n}}(this))},n.prototype.fetchFeatured=function(){var t;return t=_.extend({},i),t.is_featured=!0,this.rs.projects.getProjects(t,!1).then(function(t){return function(e){var r,n;return r=e.data.slice(0,4),n=Immutable.fromJS(r),n=n.map(t.decorate),t._featured=n}}(this))},n.prototype.resetSearchList=function(){return this._searchResult=Immutable.List()},n.prototype.fetchStats=function(){return this.rs.stats.discover().then(function(t){return function(e){return t._projectsCount=e.getIn(["projects","total"])}}(this))},n.prototype.fetchSearch=function(t){var e;return e=_.extend({},i,t),this.rs.projects.getProjects(e).then(function(t){return function(e){var r;return t._nextSearchPage=!!e.headers("X-Pagination-Next"),r=Immutable.fromJS(e.data),r=r.map(t.decorate),t._searchResult=t._searchResult.concat(r)}}(this))},n}(e.Service),angular.module("taigaDiscover").service("tgDiscoverProjectsService",t)}.call(this),function(){var t,e,r,n;r=this.taiga,n=r.trim,e=r.getRandomDefaultColor,t=function(){function t(t,r,n){this.confirm=t,this.projectService=r,this.epicsService=n,this.project=this.projectService.project.toJS(),this.newEpic={color:e(),status:this.project.default_epic_status,tags:[]},this.attachments=Immutable.List(),this.loading=!1}return t.$inject=["$tgConfirm","tgProjectService","tgEpicsService"],t.prototype.createEpic=function(){if(this.validateForm())return this.loading=!0,this.epicsService.createEpic(this.newEpic,this.attachments).then(function(t){return function(e){return t.onCreateEpic(),t.loading=!1}}(this))["catch"](function(t){return function(e){if(t.loading=!1,t.setFormErrors(e.data),e.data._error_message)return t.confirm.notify("error",e.data._error_message)}}(this))},t.prototype.selectColor=function(t){return this.newEpic.color=t},t.prototype.addTag=function(t,e){if(t=n(t.toLowerCase()),!_.find(this.newEpic.tags,function(e){return e[0]===t}))return this.newEpic.tags.push([t,e])},t.prototype.deleteTag=function(t){return _.remove(this.newEpic.tags,function(e){return e[0]===t[0]})},t.prototype.addAttachment=function(t){return this.attachments.push(t)},t}(),angular.module("taigaEpics").controller("CreateEpicCtrl",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){var i;return i=e.find("form").checksley(),n.validateForm=function(t){return function(){return i.validate()}}(this),n.setFormErrors=function(t){return function(t){return i.setErrors(t)}}(this)},{link:t,templateUrl:"epics/create-epic/create-epic.html",controller:"CreateEpicCtrl",controllerAs:"vm",bindToController:{onCreateEpic:"&"},scope:{}}},angular.module("taigaEpics").directive("tgCreateEpic",t)}.call(this),function(){var t;t=function(){function t(t,e,r){this.confirm=t,this.projectService=e,this.epicsService=r,this.displayUserStories=!1,this.displayAssignedTo=!1,this.displayStatusList=!1,this.loadingStatus=!1,this.project=this.projectService.project.toJS(),this._calculateProgressBar()}return t.$inject=["$tgConfirm","tgProjectService","tgEpicsService"],t.prototype._calculateProgressBar=function(){var t,e,r;return this.epic.getIn(["status_extra_info","is_closed"])===!0?this.percentage="100%":(e=this.epic.getIn(["user_stories_counts","opened"]),t=this.epic.getIn(["user_stories_counts","closed"]),r=e+t,0===r?this.percentage="0%":this.percentage=100*t/r+"%")},t.prototype.canEditEpics=function(){return this.projectService.hasPermission("modify_epic")},t.prototype.toggleUserStoryList=function(){return this.displayUserStories?this.displayUserStories=!1:this.epicsService.listRelatedUserStories(this.epic).then(function(t){return function(e){return t.epicStories=e,t.displayUserStories=!0}}(this))["catch"](function(t){return function(){return t.confirm.notify("error")}}(this))},t.prototype.updateStatus=function(t){return this.displayStatusList=!1,this.loadingStatus=!0,this.epicsService.updateEpicStatus(this.epic,t)["catch"](function(t){return function(){return t.confirm.notify("error")}}(this))["finally"](function(t){return function(){return t.loadingStatus=!1}}(this))},t.prototype.updateAssignedTo=function(t){return this.assignLoader=!0,this.epicsService.updateEpicAssignedTo(this.epic,(null!=t?t.id:void 0)||null)["catch"](function(t){return function(){return t.confirm.notify("error")}}(this)).then(function(t){return function(){return t.assignLoader=!1}}(this))},t}(),angular.module("taigaEpics").controller("EpicRowCtrl",t)}.call(this),function(){var t;t=function(){return{templateUrl:"epics/dashboard/epic-row/epic-row.html",controller:"EpicRowCtrl",controllerAs:"vm",bindToController:!0,scope:{epic:"=",column:"="}}},angular.module("taigaEpics").directive("tgEpicRow",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,r,n,i,o,s,a,u,c){this.params=t,this.errorHandlingService=r,this.lightboxFactory=n,this.lightboxService=i,this.confirm=o,this.projectService=s,this.epicsService=a,this.appMetaService=u,this.translate=c,this.sectionName="EPICS.SECTION_NAME",e.defineImmutableProperty(this,"project",function(t){return function(){return t.projectService.project}}(this)),e.defineImmutableProperty(this,"epics",function(t){return function(){return t.epicsService.epics}}(this)),this.appMetaService.setfn(this._setMeta.bind(this))}return t.$inject=["$routeParams","tgErrorHandlingService","tgLightboxFactory","lightboxService","$tgConfirm","tgProjectService","tgEpicsService","tgAppMetaService","$translate"],t.prototype._setMeta=function(){var t;return this.project?(t={projectName:this.project.get("name"),projectDescription:this.project.get("description")},{title:this.translate.instant("EPICS.PAGE_TITLE",t),description:this.translate.instant("EPICS.PAGE_DESCRIPTION",t) }):null},t.prototype.loadInitialData=function(){return this.epicsService.clear(),this.projectService.setProjectBySlug(this.params.pslug).then(function(t){return function(){return t.projectService.isEpicsDashboardEnabled()?t.projectService.hasPermission("view_epics")?t.epicsService.fetchEpics():t.errorHandlingService.permissionDenied():t.errorHandlingService.notFound()}}(this))},t.prototype.canCreateEpics=function(){return this.projectService.hasPermission("add_epic")},t.prototype.onCreateEpic=function(){var t;return t=function(t){return function(){t.lightboxService.closeAll(),t.confirm.notify("success")}}(this),this.lightboxFactory.create("tg-create-epic",{"class":"lightbox lightbox-create-epic open","on-create-epic":"onCreateEpic()"},{onCreateEpic:t.bind(this)})},t}(),angular.module("taigaEpics").controller("EpicsDashboardCtrl",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(r,n,i){var o,s,a;if(e.hasPermission("modify_epic"))return o=t(i.tgEpicsSortable),s=dragula([n[0]],{copySortSource:!1,copy:!1,mirrorContainer:n[0],moves:function(t){return $(t).is("div.epics-table-body-row")}}),s.on("dragend",function(t){var e,n,i;return n=$(t),e=n.scope().epic,i=n.index(),r.$apply(function(){return o(r,{epic:e,newIndex:i})})}),a=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&s.dragging}}),r.$on("$destroy",function(){return n.off(),s.destroy()})},{link:r}},t.$inject=["$parse","tgProjectService"],angular.module("taigaComponents").directive("tgEpicsSortable",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,r,n){this.confirm=t,this.epicsService=r,this.timeout=n,this.displayOptions=!1,this.displayVotes=!0,this.column={votes:!0,name:!0,project:!0,sprint:!0,assigned:!0,status:!0,progress:!0},e.defineImmutableProperty(this,"epics",function(t){return function(){return t.epicsService.epics}}(this))}return t.$inject=["$tgConfirm","tgEpicsService","$timeout"],t.prototype.toggleEpicTableOptions=function(){return this.displayOptions=!this.displayOptions},t.prototype.reorderEpic=function(t,e){return this.epicsService.reorderEpic(t,e).then(null,function(t){return function(){return t.confirm.notify("error")}}(this))},t.prototype.hoverEpicTableOption=function(){if(this.timer)return this.timeout.cancel(this.timer)},t.prototype.hideEpicTableOption=function(){return this.timer=this.timeout(function(t){return function(){return t.displayOptions=!1}}(this),400)},t}(),angular.module("taigaEpics").controller("EpicsTableCtrl",t)}.call(this),function(){var t;t=function(){return{templateUrl:"epics/dashboard/epics-table/epics-table.html",controller:"EpicsTableCtrl",controllerAs:"vm",scope:{}}},angular.module("taigaEpics").directive("tgEpicsTable",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(){this._calculateProgressBar()}return t.$inject=[],t.prototype._calculateProgressBar=function(){var t,e;return this.story.get("is_closed")===!0?this.percentage="100%":(t=this.story.get("tasks").size,e=this.story.get("tasks").filter(function(t){return t.get("is_closed")}).size,0===t?this.percentage="0%":this.percentage=100*e/t+"%")},t}(),e.controller("StoryRowCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){return{templateUrl:"epics/dashboard/story-row/story-row.html",controller:"StoryRowCtrl",controllerAs:"vm",bindToController:!0,scope:{story:"=",column:"="}}},e.directive("tgStoryRow",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,r,n,i){this.projectService=t,this.attachmentsService=r,this.resources=n,this.xhrError=i,this._epics=Immutable.List(),e.defineImmutableProperty(this,"epics",function(t){return function(){return t._epics}}(this))}return t.$inject=["tgProjectService","tgAttachmentsService","tgResources","tgXhrErrorService"],t.prototype.clear=function(){return this._epics=Immutable.List()},t.prototype.fetchEpics=function(){return this.resources.epics.list(this.projectService.project.get("id")).then(function(t){return function(e){return t._epics=e}}(this))["catch"](function(t){return function(e){return t.xhrError.response(e)}}(this))},t.prototype.listRelatedUserStories=function(t){return this.resources.userstories.listInEpic(t.get("id"))},t.prototype.createEpic=function(t,e){return t.project=this.projectService.project.get("id"),this.resources.epics.post(t).then(function(t){return function(r){var n;return n=_.map(e.toJS(),function(e){return t.attachmentsService.upload(e.file,r.get("id"),r.get("project"),"epic")}),Promise.all(n).then(function(){return t.fetchEpics()})}}(this))},t.prototype.reorderEpic=function(t,e){var r,n,i,o,s,a,u;return u=this.epics.filter(function(e){return function(e){return e.get("id")!==t.get("id")}}(this)),r=u.slice(0,e),o=r.last(),i=o?o.get("epics_order")+1:0,s=r.filter(function(t){return function(t){return t.get("epics_order")===o.get("epics_order")}}(this)),a=_.fromPairs(s.map(function(t){return function(t){return[t.get("id"),t.get("epics_order")]}}(this)).toJS()),n={epics_order:i,version:t.get("version")},this.resources.epics.reorder(t.get("id"),n,a).then(function(t){return function(){return t.fetchEpics()}}(this))},t.prototype.reorderRelatedUserstory=function(t,e,r,n){var i,o,s,a,u,c,l,p,f;return f=e.filter(function(t){return function(t){return t.get("id")!==r.get("id")}}(this)),i=f.slice(0,n),u=i.last(),a=u?u.get("epic_order")+1:0,c=i.filter(function(t){return function(t){return t.get("epic_order")===u.get("epic_order")}}(this)),l=_.fromPairs(c.map(function(t){return function(t){return[t.get("id"),t.get("epic_order")]}}(this)).toJS()),o={order:a},s=t.get("id"),p=r.get("id"),this.resources.epics.reorderRelatedUserstory(s,p,o,l).then(function(e){return function(){return e.listRelatedUserStories(t)}}(this))},t.prototype.updateEpicStatus=function(t,e){var r;return r={status:e,version:t.get("version")},this.resources.epics.patch(t.get("id"),r).then(function(t){return function(){return t.fetchEpics()}}(this))},t.prototype.updateEpicAssignedTo=function(t,e){var r;return r={assigned_to:e,version:t.get("version")},this.resources.epics.patch(t.get("id"),r).then(function(t){return function(){return t.fetchEpics()}}(this))},t}(),angular.module("taigaEpics").service("tgEpicsService",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(t,e){this.projectService=t,this.epicsService=e,this.sectionName="Epics",this.showCreateRelatedUserstoriesLightbox=!1}return t.$inject=["tgProjectService","tgEpicsService"],t.prototype.showRelatedUserStoriesSection=function(){var t;return this.projectService.hasPermission("modify_epic")||(null!=(t=this.userstories)?t.legth:void 0)>0},t.prototype.userCanSort=function(){return this.projectService.hasPermission("modify_epic")},t.prototype.loadRelatedUserstories=function(){return this.epicsService.listRelatedUserStories(this.epic).then(function(t){return function(e){return t.userstories=e}}(this))},t.prototype.reorderRelatedUserstory=function(t,e){return this.epicsService.reorderRelatedUserstory(this.epic,this.userstories,t,e).then(function(t){return function(e){return t.userstories=e}}(this))},t}(),e.controller("RelatedUserStoriesCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(t,e,r,n){this.currentUserService=t,this.rs=e,this.confirm=r,this.analytics=n,this.projects=this.currentUserService.projects.get("all"),this.projectUserstories=Immutable.List(),this.loading=!1}return t.$inject=["tgCurrentUserService","tgResources","$tgConfirm","$tgAnalytics"],t.prototype.selectProject=function(t,e){return this.rs.userstories.listAllInProject(t).then(function(t){return function(r){var n,i;if(n=t.epicUserstories.map(function(t){return t.get("id")}),i=r.filter(function(t){return n.indexOf(t.get("id"))===-1}),t.projectUserstories=i,e)return e()}}(this))},t.prototype.saveRelatedUserStory=function(t,e){var r,n,i;if(this.validateExistingUserstoryForm())return this.loading=!0,n=function(t){return function(e){return t.loading=!1,t.confirm.notify("error"),t.setExistingUserstoryFormErrors(e)}}(this),i=function(t){return function(){return t.analytics.trackEvent("epic related user story","create","create related user story on epic",1),t.loading=!1,e&&e(),t.loadRelatedUserstories()}}(this),r=this.epic.get("id"),this.rs.epics.addRelatedUserstory(r,t).then(i,n)},t.prototype.bulkCreateRelatedUserStories=function(t,e,r){var n,i,o;if(this.validateNewUserstoryForm())return this.loading=!0,i=function(t){return function(e){return t.loading=!1,t.confirm.notify("error"),t.setNewUserstoryFormErrors(e)}}(this),o=function(t){return function(){return t.analytics.trackEvent("epic related user story","create","create related user story on epic",1),t.loading=!1,r&&r(),t.loadRelatedUserstories()}}(this),n=this.epic.get("id"),this.rs.epics.bulkCreateRelatedUserStories(n,t,e).then(o,i)},t}(),e.controller("RelatedUserstoriesCreateCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(t){var e;return this.lightboxService=t,e=function(t,e,r,n){var i,o;return o=e.find(".new-user-story-form").checksley(),i=e.find(".existing-user-story-form").checksley(),n.validateNewUserstoryForm=function(t){return function(){return o.validate()}}(this),n.setNewUserstoryFormErrors=function(t){return function(t){return o.setErrors(t)}}(this),n.validateExistingUserstoryForm=function(t){return function(){return i.validate()}}(this),n.setExistingUserstoryFormErrors=function(t){return function(t){return i.setErrors(t)}}(this),t.showLightbox=function(r){return t.selectProject(r).then(function(t){return function(){return lightboxService.open(e.find(".lightbox-create-related-user-stories"))}}(this))},t.closeLightbox=function(){return t.selectedUserstory=null,t.searchUserstory="",t.relatedUserstoriesText="",lightboxService.close(e.find(".lightbox-create-related-user-stories"))},t.$watch("vm.project",function(e){if(null!=e)return t.selectedProject=e.get("id")}),t.selectProject=function(e){return t.selectedUserstory=null,t.searchUserstory="",n.selectProject(e)},t.onUpdateSearchUserstory=function(){return t.selectedUserstory=null}},{link:e,templateUrl:"epics/related-userstories/related-userstories-create/related-userstories-create.html",controller:"RelatedUserstoriesCreateCtrl",controllerAs:"vm",bindToController:!0,scope:{showCreateRelatedUserstoriesLightbox:"=",project:"=",epic:"=",epicUserstories:"=",loadRelatedUserstories:"&"}}},t.$inject=["lightboxService"],e.directive("tgRelatedUserstoriesCreate",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(t,e){var r;return r=function(r,n,i){var o,s,a;if(e.hasPermission("modify_epic"))return o=t(i.tgRelatedUserstoriesSortable),s=dragula([n[0]],{copySortSource:!1,copy:!1,mirrorContainer:n[0],moves:function(t){return $(t).is("tg-related-userstory-row")}}),s.on("dragend",function(t){var e,n,i;return e=$(t),i=e.scope().us,n=e.index(),r.$apply(function(){return o(r,{us:i,newIndex:n})})}),a=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&s.dragging}}),r.$on("$destroy",function(){return n.off(),s.destroy()})},{link:r}},t.$inject=["$parse","tgProjectService"],e.directive("tgRelatedUserstoriesSortable",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){return{templateUrl:"epics/related-userstories/related-userstories.html",controller:"RelatedUserStoriesCtrl",controllerAs:"vm",bindToController:!0,scope:{userstories:"=",project:"=",epic:"="}}},t.$inject=[],e.directive("tgRelatedUserstories",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(t,e,r,n){this.avatarService=t,this.translate=e,this.confirm=r,this.rs=n}return t.$inject=["tgAvatarService","$translate","$tgConfirm","tgResources"],t.prototype.setAvatarData=function(){var t;return t=this.userstory.get("assigned_to_extra_info"),this.avatar=this.avatarService.getAvatar(t)},t.prototype.getAssignedToFullNameDisplay=function(){return this.userstory.get("assigned_to")?this.userstory.getIn(["assigned_to_extra_info","full_name_display"]):this.translate.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED")},t.prototype.onDeleteRelatedUserstory=function(){var t,e;return e=this.translate.instant("EPIC.TITLE_LIGHTBOX_UNLINK_RELATED_USERSTORY"),t=this.translate.instant("EPIC.MSG_LIGHTBOX_UNLINK_RELATED_USERSTORY",{subject:this.userstory.get("subject")}),this.confirm.askOnDelete(e,t).then(function(e){return function(r){var n,i,o,s;return i=function(){return t=e.translate.instant("EPIC.ERROR_UNLINK_RELATED_USERSTORY",{errorMessage:t}),e.confirm.notify("error",null,t),r.finish(!1)},o=function(){return e.loadRelatedUserstories(),r.finish()},n=e.epic.get("id"),s=e.userstory.get("id"),e.rs.epics.deleteRelatedUserstory(n,s).then(o,i)}}(this))},t}(),e.controller("RelatedUserstoryRowCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){var t;return t=function(t,e,r,n){return n.setAvatarData()},{link:t,templateUrl:"epics/related-userstories/related-userstory-row/related-userstory-row.html",controller:"RelatedUserstoryRowCtrl",controllerAs:"vm",bindToController:!0,scope:{userstory:"=",epic:"=",project:"=",loadRelatedUserstories:"&"}}},t.$inject=[],e.directive("tgRelatedUserstoryRow",t)}.call(this),function(){var t,e,r=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;e=this.taiga,t=function(t){function i(t,n,i,o,s,a,u,c){var l,p;this.routeParams=t,this.externalAppsService=n,this.window=i,this.currentUserService=o,this.location=s,this.navUrls=a,this.xhrError=u,this.loader=c,this.createApplicationToken=r(this.createApplicationToken,this),this._getApplicationToken=r(this._getApplicationToken,this),this._redirect=r(this._redirect,this),this.loader.start(!1),this._applicationId=this.routeParams.application,this._state=this.routeParams.state,this._getApplicationToken(),this._user=this.currentUserService.getUser(),this._application=null,p=encodeURIComponent(this.location.url()),l=this.navUrls.resolve("login"),this.loginWithAnotherUserUrl=l+"?next="+p,e.defineImmutableProperty(this,"user",function(t){return function(){return t._user}}(this)),e.defineImmutableProperty(this,"application",function(t){return function(){return t._application}}(this))}return n(i,t),i.$inject=["$routeParams","tgExternalAppsService","$window","tgCurrentUserService","$location","$tgNavUrls","tgXhrErrorService","tgLoader"],i.prototype._redirect=function(t){var e;return e=t.get("next_url"),this.window.open(e,"_self")},i.prototype._getApplicationToken=function(){return this.externalAppsService.getApplicationToken(this._applicationId,this._state).then(function(t){return function(e){return t._application=e.get("application"),e.get("auth_code")?t._redirect(e):t.loader.pageLoaded()}}(this))["catch"](function(t){return function(e){return t.loader.pageLoaded(),t.xhrError.response(e)}}(this))},i.prototype.cancel=function(){return this.window.history.back()},i.prototype.createApplicationToken=function(){return this.externalAppsService.authorizeApplicationToken(this._applicationId,this._state).then(function(t){return function(e){return t._redirect(e)}}(this))["catch"](function(t){return function(e){return t.xhrError.response(e)}}(this))},i}(e.Controller),angular.module("taigaExternalApps").controller("ExternalApp",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.rs=t}return e(r,t),r.$inject=["tgResources"],r.prototype.getApplicationToken=function(t,e){return this.rs.externalapps.getApplicationToken(t,e)},r.prototype.authorizeApplicationToken=function(t,e){return this.rs.externalapps.authorizeApplicationToken(t,e)},r}(taiga.Service),angular.module("taigaExternalApps").service("tgExternalAppsService",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.lightboxFactory=t}return e(r,t),r.$inject=["tgLightboxFactory"],r.prototype.sendFeedback=function(){return this.lightboxFactory.create("tg-lb-feedback",{"class":"lightbox lightbox-feedback lightbox-generic-form"})},r}(taiga.Service),angular.module("taigaFeedback").service("tgFeedbackService",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(t,e,r){this.currentUserService=t,this.permissionService=e,this.lightboxFactory=r,this.hiddenDeletedComment=!0,this.commentContent=angular.copy(this.comment)}return t.$inject=["tgCurrentUserService","tgCheckPermissionsService","tgLightboxFactory"],t.prototype.showDeletedComment=function(){return this.hiddenDeletedComment=!1},t.prototype.hideDeletedComment=function(){return this.hiddenDeletedComment=!0},t.prototype.checkCancelComment=function(t){if(27===t.keyCode)return this.onEditMode({commentId:this.comment.id})},t.prototype.canEditDeleteComment=function(){if(this.currentUserService.getUser())return this.user=this.currentUserService.getUser(),this.user.get("id")===this.comment.user.pk||this.permissionService.check("modify_project")},t.prototype.displayCommentHistory=function(){return this.lightboxFactory.create("tg-lb-display-historic",{"class":"lightbox lightbox-display-historic",comment:"comment",name:"name",object:"object"},{comment:this.comment,name:this.name,object:this.object})},t}(),e.controller("CommentCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){return{scope:{name:"@",object:"@",comment:"<",type:"<",loading:"<",editing:"<",deleting:"<",objectId:"<",editMode:"<",onEditMode:"&",onDeleteComment:"&",onRestoreDeletedComment:"&",onEditComment:"&"},templateUrl:"history/comments/comment.html",bindToController:!0,controller:"CommentCtrl",controllerAs:"vm"}},e.directive("tgComment",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(){}return t.$inject=[],t.prototype.initializePermissions=function(){return this.canAddCommentPermission="comment_"+this.name},t}(),e.controller("CommentsCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r,n){return n.initializePermissions()},{scope:{type:"<",name:"@",object:"@",comments:"<",onEditMode:"&",onDeleteComment:"&",onRestoreDeletedComment:"&",onAddComment:"&",onEditComment:"&",editMode:"<",loading:"<",deleting:"<",editing:"<",projectId:"="},templateUrl:"history/comments/comments.html",bindToController:!0,controller:"CommentsCtrl",controllerAs:"vm",link:t}},e.directive("tgComments",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(t){this.rs=t}return t.$inject=["$tgResources"],t.prototype._loadHistoric=function(){var t,e,r;return r=this.name,e=this.object,t=this.comment.id,this.rs.history.getCommentHistory(r,e,t).then(function(t){return function(e){return t.commentHistoryEntries=e}}(this))},t}(),e.controller("LightboxDisplayHistoricCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(t){var e;return e=function(e,r,n,i){return i._loadHistoric(),t.open(r)},{scope:{},bindToController:{name:"=",object:"=",comment:"="},templateUrl:"history/history-lightbox/comment-history-lightbox.html",controller:"LightboxDisplayHistoricCtrl",controllerAs:"vm",link:e}},e.directive("tgLbDisplayHistoric",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(t){return{scope:{entry:"<"},templateUrl:"history/history-lightbox/history-entry.html"}},e.directive("tgHistoryEntry",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){return{templateUrl:"history/history-tabs/history-tabs.html",scope:{showCommentTab:"&",showActivityTab:"&",onActiveComments:"&",onActiveActivities:"&",onOrderComments:"&",activeTab:"<",commentsNum:"<",activitiesNum:"<",onReverse:"<"}}},e.directive("tgHistoryTabs",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(t,e,r,n){this.rs=t,this.repo=e,this.storage=r,this.projectService=n,this.editing=null,this.deleting=null,this.editMode={},this.viewComments=!0,this._loadHistory(),this.reverse=this.storage.get("orderComments")}return t.$inject=["$tgResources","$tgRepo","$tgStorage","tgProjectService"],t.prototype._loadHistory=function(){return this.rs.history.get(this.name,this.id).then(function(t){return function(e){return t._getComments(e),t._getActivities(e)}}(this))},t.prototype._getComments=function(t){return this.comments=_.filter(t,function(t){return""!==t.comment}),this.reverse&&this.comments-_.reverse(this.comments),this.commentsNum=this.comments.length},t.prototype._getActivities=function(t){return this.activities=_.filter(t,function(t){return Object.keys(t.values_diff).length>0}),this.activitiesNum=this.activities.length},t.prototype.showHistorySection=function(){return this.showCommentTab()||this.showActivityTab()},t.prototype.showCommentTab=function(){return this.commentsNum>0||this.projectService.hasPermission("comment_"+this.name)},t.prototype.showActivityTab=function(){return this.activitiesNum>0},t.prototype.toggleEditMode=function(t){return this.editMode[t]=!this.editMode[t]},t.prototype.onActiveHistoryTab=function(t){return this.viewComments=t},t.prototype.deleteComment=function(t){var e,r,n;return n=this.name,r=this.id,e=t,this.deleting=t,this.rs.history.deleteComment(n,r,e).then(function(e){return function(){return e._loadHistory(),e.deleting=t}}(this))},t.prototype.editComment=function(t,e){var r,n,i;return i=this.name,n=this.id,r=t,this.editing=t,this.rs.history.editComment(i,n,r,e).then(function(e){return function(){return e._loadHistory(),e.toggleEditMode(t),e.editing=null}}(this))},t.prototype.restoreDeletedComment=function(t){var e,r,n;return n=this.name,r=this.id,e=t,this.editing=t,this.rs.history.undeleteComment(n,r,e).then(function(t){return function(){return t._loadHistory(),t.editing=null}}(this))},t.prototype.addComment=function(){var t;return t=this.type,this.loading=!0,this.repo.save(this.type).then(function(t){return function(){return t._loadHistory(),t.loading=!1}}(this))},t.prototype.onOrderComments=function(){return this.reverse=!this.reverse,this.storage.set("orderComments",this.reverse),this._loadHistory()},t}(),e.controller("HistorySection",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r,n){return t.$on("object:updated",function(){return n._loadHistory(t.type,t.id)})},{link:t,templateUrl:"history/history.html",controller:"HistorySection",controllerAs:"vm",bindToController:!0,scope:{type:"=",name:"@",id:"=",projectId:"="}}},t.$inject=[],e.directive("tgHistorySection",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(){}return t.$inject=[],t.prototype.diffTags=function(){if("tags"===this.type)return this.diffRemoveTags=_.difference(this.diff[0],this.diff[1]).toString(),this.diffAddTags=_.difference(this.diff[1],this.diff[0]).toString()},t}(),e.controller("ActivitiesDiffCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r,n){return n.diffTags()},{scope:{type:"<",diff:"<"},templateUrl:"history/history/history-diff.html",controller:"ActivitiesDiffCtrl",controllerAs:"vm",bindToController:!0,link:t}},e.directive("tgHistoryDiff",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r){},{scope:{activities:"<"},templateUrl:"history/history/history.html",link:t}},e.directive("tgHistory",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(t,r,n,i){return t.vm={},t.vm.duty=t.duty,t.vm.type=t.type,t.vm.getDutyType=function(){if(t.vm.duty){if("epics"===t.vm.duty.get("_name"))return e.instant("COMMON.EPIC");if("userstories"===t.vm.duty.get("_name"))return e.instant("COMMON.USER_STORY");if("tasks"===t.vm.duty.get("_name"))return e.instant("COMMON.TASK");if("issues"===t.vm.duty.get("_name"))return e.instant("COMMON.ISSUE")}}},{templateUrl:"home/duties/duty.html",scope:{duty:"=tgDuty",type:"@"},link:r}},t.$inject=["$tgNavUrls","$translate"],angular.module("taigaHome").directive("tgDuty",t)}.call(this),function(){var t;t=function(){function t(t,e,r){this.currentUserService=t,this.location=e,this.navUrls=r,this.currentUserService.getUser()||this.location.path(this.navUrls.resolve("discover"))}return t.$inject=["tgCurrentUserService","$location","$tgNavUrls"],t}(),angular.module("taigaHome").controller("Home",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga.groupBy,t=function(t){function n(t,e,r){this.navurls=t,this.rs=e,this.projectsService=r}return r(n,t),n.$inject=["$tgNavUrls","tgResources","tgProjectsService"],n.prototype._attachProjectInfoToWorkInProgress=function(t,e){var r,n,i,o,s;return r=function(t){return function(r,n){var i,o,s;return o=e.get(String(r.get("project"))),i={project:o.get("slug"),ref:r.get("ref")},s=t.navurls.resolve("project-"+n+"-detail",i),r=r.set("url",s),r=r.set("project",o),r=r.set("_name",n)}}(this),i=function(t,n){return t=t.filter(function(t){return e.get(String(t.get("project")))}),t=t.map(function(t){return r(t,n)})},o=t.get("assignedTo"),o.get("epics")&&(n=i(o.get("epics"),"epics"),o=o.set("epics",n)),o.get("userStories")&&(n=i(o.get("userStories"),"userstories"),o=o.set("userStories",n)),o.get("tasks")&&(n=i(o.get("tasks"),"tasks"),o=o.set("tasks",n)),o.get("issues")&&(n=i(o.get("issues"),"issues"),o=o.set("issues",n)),s=t.get("watching"),s.get("epics")&&(n=i(s.get("epics"),"epics"),s=s.set("epics",n)),s.get("userStories")&&(n=i(s.get("userStories"),"userstories"),s=s.set("userStories",n)),s.get("tasks")&&(n=i(s.get("tasks"),"tasks"),s=s.set("tasks",n)),s.get("issues")&&(n=i(s.get("issues"),"issues"),s=s.set("issues",n)),t=t.set("assignedTo",o),t=t.set("watching",s)},n.prototype.getWorkInProgress=function(t){var r,n,i,o,s,a,u,c,l,p,f,d,h,g,m,v;return l=Immutable.Map(),p=this.projectsService.getProjectsByUserId(t).then(function(t){return l=Immutable.fromJS(e(t.toJS(),function(t){return t.id}))}),o=Immutable.Map(),a={status__is_closed:!1,assigned_to:t},c={is_closed:!1,assigned_to:t},u={is_closed:!1,assigned_to:t},r=this.rs.epics.listInAllProjects(u).then(function(t){return o=o.set("epics",t)}),s=this.rs.userstories.listInAllProjects(c).then(function(t){return o=o.set("userStories",t)}),i=this.rs.tasks.listInAllProjects(a).then(function(t){return o=o.set("tasks",t)}),n=this.rs.issues.listInAllProjects(a).then(function(t){return o=o.set("issues",t)}),a={status__is_closed:!1,watchers:t},c={is_closed:!1,watchers:t},u={is_closed:!1,watchers:t},f=Immutable.Map(),d=this.rs.epics.listInAllProjects(u).then(function(t){return f=f.set("epics",t)}),m=this.rs.userstories.listInAllProjects(c).then(function(t){return f=f.set("userStories",t)}),g=this.rs.tasks.listInAllProjects(a).then(function(t){return f=f.set("tasks",t)}),h=this.rs.issues.listInAllProjects(a).then(function(t){return f=f.set("issues",t)}),v=Immutable.Map(),Promise.all([p,r,d,s,m,i,g,n,h]).then(function(t){return function(){return v=v.set("assignedTo",o),v=v.set("watching",f),v=t._attachProjectInfoToWorkInProgress(v,l)}}(this))},n}(taiga.Service),angular.module("taigaHome").service("tgHomeService",t)}.call(this),function(){var t;t=function(t,e){var r,n;return n=function(r,n,i,o){return r.vm={},taiga.defineImmutableProperty(r.vm,"projects",function(){return t.projects.get("recents")}),r.vm.newProject=function(){return e.newProject()}},r={templateUrl:"home/projects/home-project-list.html",scope:{},link:n}},t.$inject=["tgCurrentUserService","tgProjectsService"],angular.module("taigaHome").directive("tgHomeProjectList",t)}.call(this),function(){var t;t=function(){function t(t){this.homeService=t,this.assignedTo=Immutable.Map(),this.watching=Immutable.Map()}return t.$inject=["tgHomeService"],t.prototype._setAssignedTo=function(t){var e,r,n,i;if(e=t.get("assignedTo").get("epics"),i=t.get("assignedTo").get("userStories"),n=t.get("assignedTo").get("tasks"),r=t.get("assignedTo").get("issues"),this.assignedTo=i.concat(n).concat(r).concat(e),this.assignedTo.size>0)return this.assignedTo=this.assignedTo.sortBy(function(t){return t.get("modified_date")}).reverse()},t.prototype._setWatching=function(t){var e,r,n,i;if(e=t.get("watching").get("epics"),i=t.get("watching").get("userStories"),n=t.get("watching").get("tasks"),r=t.get("watching").get("issues"),this.watching=i.concat(n).concat(r).concat(e),this.watching.size>0)return this.watching=this.watching.sortBy(function(t){return t.get("modified_date")}).reverse()},t.prototype.getWorkInProgress=function(t){return this.homeService.getWorkInProgress(t).then(function(t){return function(e){return t._setAssignedTo(e),t._setWatching(e)}}(this))},t}(),angular.module("taigaHome").controller("WorkingOn",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(t,r,n,i){var o,s;if(o=e.getUser())return s=o.get("id"),i.getWorkInProgress(s)},{controller:"WorkingOn",controllerAs:"vm",templateUrl:"home/working-on/working-on.html",scope:{},link:r}},t.$inject=["tgHomeService","tgCurrentUserService"],angular.module("taigaHome").directive("tgWorkingOn",t)}.call(this),function(){var t;t=function(t,e){var r,n;return n=function(r,n,i,o){return r.vm={},taiga.defineImmutableProperty(r.vm,"projects",function(){return t.projects.get("recents")}),r.vm.newProject=function(){return e.newProject()}},r={templateUrl:"navigation-bar/dropdown-project-list/dropdown-project-list.html",scope:{},link:n}},t.$inject=["tgCurrentUserService","tgProjectsService"],angular.module("taigaNavigationBar").directive("tgDropdownProjectList",t)}.call(this),function(){var t;t=function(t,e,r,n,i,o){var s,a;return a=function(s,a,u,c){return s.vm={},s.vm.isFeedbackEnabled=e.get("feedbackEnabled"),taiga.defineImmutableProperty(s.vm,"user",function(){return t.userData}),s.vm.logout=function(){return t.logout(),r.url(n.resolve("discover")),r.search({})},s.vm.sendFeedback=function(){return i.sendFeedback()},s.vm.userSettingsPlugins=_.filter(o.userSettingsPlugins,{userMenu:!0})},s={templateUrl:"navigation-bar/dropdown-user/dropdown-user.html",scope:{},link:a}},t.$inject=["$tgAuth","$tgConfig","$tgLocation","$tgNavUrls","tgFeedbackService","$rootScope"],angular.module("taigaNavigationBar").directive("tgDropdownUser",t)}.call(this),function(){var t;t=function(t,e,r,n,i){var o,s;return s=function(o,s,a,u){return o.vm={},taiga.defineImmutableProperty(o.vm,"projects",function(){return t.projects.get("recents")}),taiga.defineImmutableProperty(o.vm,"isAuthenticated",function(){return t.isAuthenticated()}),taiga.defineImmutableProperty(o.vm,"isEnabledHeader",function(){return e.isEnabledHeader()}),o.vm.publicRegisterEnabled=i.get("publicRegisterEnabled"),o.vm.login=function(){var t;return t=encodeURIComponent(r.url()),r.url(n.resolve("login")),r.search({next:t})},o.vm.register=function(){var t;return t=encodeURIComponent(r.url()),r.url(n.resolve("register")),r.search({next:t})},o.$on("$routeChangeSuccess",function(){return"/"===r.path()?o.vm.active=!0:o.vm.active=!1})},o={templateUrl:"navigation-bar/navigation-bar.html",scope:{},link:s}},t.$inject=["tgCurrentUserService","tgNavigationBarService","$tgLocation","$tgNavUrls","$tgConfig"],angular.module("taigaNavigationBar").directive("tgNavigationBar",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype, t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){this.disableHeader()}return e(r,t),r.prototype.enableHeader=function(){return this.enabledHeader=!0},r.prototype.disableHeader=function(){return this.enabledHeader=!1},r.prototype.isEnabledHeader=function(){return this.enabledHeader},r}(taiga.Service),angular.module("taigaNavigationBar").service("tgNavigationBarService",t)}.call(this),function(){var t;t=function(){function t(t){this.userService=t,this.loadStats()}return t.$inject=["tgUserService"],t.prototype.loadStats=function(){return this.userService.getStats(this.user.get("id")).then(function(t){return function(e){return t.stats=e}}(this))},t}(),angular.module("taigaProfile").controller("ProfileBar",t)}.call(this),function(){var t;t=function(){return{templateUrl:"profile/profile-bar/profile-bar.html",controller:"ProfileBar",controllerAs:"vm",scope:{user:"=user",isCurrentUser:"=iscurrentuser"},bindToController:!0}},angular.module("taigaProfile").directive("tgProfileBar",t)}.call(this),function(){var t;t=function(){function t(t,e){this.userService=t,this.currentUserService=e,this.currentUser=this.currentUserService.getUser(),this.isCurrentUser=!1,this.currentUser&&this.currentUser.get("id")===this.user.get("id")&&(this.isCurrentUser=!0)}return t.$inject=["tgUserService","tgCurrentUserService"],t.prototype.loadContacts=function(){return this.userService.getContacts(this.user.get("id")).then(function(t){return function(e){return t.contacts=e}}(this))},t}(),angular.module("taigaProfile").controller("ProfileContacts",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.loadContacts()},{templateUrl:"profile/profile-contacts/profile-contacts.html",scope:{user:"="},controllerAs:"vm",controller:"ProfileContacts",link:t,bindToController:!0}},angular.module("taigaProfile").directive("tgProfileContacts",t)}.call(this),function(){var t;t=function(){var t,e;return t=function(t,e,r,n){return t.vm={item:t.item}},e=function(t,e){return"project"===e.itemType?"profile/profile-favs/items/project.html":"profile/profile-favs/items/ticket.html"},{scope:{item:"=tgFavItem"},link:t,templateUrl:e}},angular.module("taigaProfile").directive("tgFavItem",t)}.call(this),function(){var t,e,r,n,i,o=function(t,e){function r(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},s={}.hasOwnProperty;i=this.taiga.debounceLeading,t=function(){function t(){this._init()}return t.prototype._init=function(){return this.enableFilterByAll=!0,this.enableFilterByProjects=!0,this.enableFilterByEpics=!0,this.enableFilterByUserStories=!0,this.enableFilterByTasks=!0,this.enableFilterByIssues=!0,this.enableFilterByTextQuery=!0,this._resetList(),this.q=null,this.type=null},t.prototype._resetList=function(){return this.items=Immutable.List(),this.scrollDisabled=!1,this._page=1},t.prototype._enableLoadingSpinner=function(){return this.isLoading=!0},t.prototype._disableLoadingSpinner=function(){return this.isLoading=!1},t.prototype._enableScroll=function(){return this.scrollDisabled=!1},t.prototype._disableScroll=function(){return this.scrollDisabled=!0},t.prototype._checkIfHasMorePages=function(t){return t?(this._page+=1,this._enableScroll()):this._disableScroll()},t.prototype._checkIfHasNoResults=function(){return this.hasNoResults=0===this.items.size},t.prototype.loadItems=function(){return this._enableLoadingSpinner(),this._disableScroll(),this._getItems(this.user.get("id"),this._page,this.type,this.q).then(function(t){return function(e){return t.items=t.items.concat(e.get("data")),t._checkIfHasMorePages(e.get("next")),t._checkIfHasNoResults(),t._disableLoadingSpinner(),t.items}}(this))["catch"](function(t){return function(){return t._disableLoadingSpinner(),t.items}}(this))},t.prototype.filterByTextQuery=i(500,function(){return this._resetList(),this.loadItems()}),t.prototype.showAll=function(){if(null!==this.type)return this.type=null,this._resetList(),this.loadItems()},t.prototype.showProjectsOnly=function(){if("project"!==this.type)return this.type="project",this._resetList(),this.loadItems()},t.prototype.showEpicsOnly=function(){if("epic"!==this.type)return this.type="epic",this._resetList(),this.loadItems()},t.prototype.showUserStoriesOnly=function(){if("userstory"!==this.type)return this.type="userstory",this._resetList(),this.loadItems()},t.prototype.showTasksOnly=function(){if("task"!==this.type)return this.type="task",this._resetList(),this.loadItems()},t.prototype.showIssuesOnly=function(){if("issue"!==this.type)return this.type="issue",this._resetList(),this.loadItems()},t}(),e=function(t){function e(t){this.userService=t,e.__super__.constructor.call(this),this.tabName="likes",this.enableFilterByAll=!1,this.enableFilterByProjects=!1,this.enableFilterByEpics=!1,this.enableFilterByUserStories=!1,this.enableFilterByTasks=!1,this.enableFilterByIssues=!1,this.enableFilterByTextQuery=!0,this._getItems=this.userService.getLiked}return o(e,t),e.$inject=["tgUserService"],e}(t),angular.module("taigaProfile").controller("ProfileLiked",e),r=function(t){function e(t){this.userService=t,e.__super__.constructor.call(this),this.tabName="upvotes",this.enableFilterByAll=!0,this.enableFilterByProjects=!1,this.enableFilterByEpics=!0,this.enableFilterByUserStories=!0,this.enableFilterByTasks=!0,this.enableFilterByIssues=!0,this.enableFilterByTextQuery=!0,this._getItems=this.userService.getVoted}return o(e,t),e.$inject=["tgUserService"],e}(t),angular.module("taigaProfile").controller("ProfileVoted",r),n=function(t){function e(t){this.userService=t,e.__super__.constructor.call(this),this.tabName="watchers",this._getItems=this.userService.getWatched}return o(e,t),e.$inject=["tgUserService"],e}(t),angular.module("taigaProfile").controller("ProfileWatched",n)}.call(this),function(){var t,e,r,n;n={scope:{},bindToController:{user:"=",type:"@",q:"@",scrollDisabled:"@",isLoading:"@",hasNoResults:"@"},controller:null,controllerAs:"vm",templateUrl:"profile/profile-favs/profile-favs.html"},t=function(){return _.extend({},n,{controller:"ProfileLiked"})},angular.module("taigaProfile").directive("tgProfileLiked",t),e=function(){return _.extend({},n,{controller:"ProfileVoted"})},angular.module("taigaProfile").directive("tgProfileVoted",e),r=function(){return _.extend({},n,{controller:"ProfileWatched"})},angular.module("taigaProfile").directive("tgProfileWatched",r)}.call(this),function(){var t;t=function(){function t(t){var e;this.translate=t,e=Math.floor(Math.random()*this.HINTS.length)+1,this.hint=this.HINTS[e-1],this.hint.linkText=this.hint.linkText||"HINTS.LINK",this.hint.title=this.translate.instant("HINTS.HINT"+e+"_TITLE"),this.hint.text=this.translate.instant("HINTS.HINT"+e+"_TEXT")}return t.prototype.HINTS=[{url:"https://tree.taiga.io/support/admin/import-export-projects/"},{url:"https://tree.taiga.io/support/admin/custom-fields/"},{},{}],t}(),t.$inject=["$translate"],angular.module("taigaProfile").controller("ProfileHints",t)}.call(this),function(){var t;t=function(t){return{scope:{},controller:"ProfileHints",controllerAs:"vm",templateUrl:"profile/profile-hints/profile-hints.html"}},t.$inject=["$translate"],angular.module("taigaProfile").directive("tgProfileHints",t)}.call(this),function(){var t;t=function(){function t(t,e){this.projectsService=t,this.userService=e}return t.$inject=["tgProjectsService","tgUserService"],t.prototype.loadProjects=function(){return this.projectsService.getProjectsByUserId(this.user.get("id")).then(function(t){return function(e){return t.userService.attachUserContactsToProjects(t.user.get("id"),e)}}(this)).then(function(t){return function(e){return t.projects=e}}(this))},t}(),angular.module("taigaProfile").controller("ProfileProjects",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.loadProjects()},{templateUrl:"profile/profile-projects/profile-projects.html",scope:{user:"="},link:t,bindToController:!0,controllerAs:"vm",controller:"ProfileProjects"}},angular.module("taigaProfile").directive("tgProfileProjects",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n,i){if(t.tab={},r.$observe("tgProfileTab",function(e){return t.tab.name=e}),r.$observe("tabTitle",function(e){return t.tab.title=e}),t.tab.icon=r.tabIcon,t.tab.active=!!r.tabActive,t.$eval(r.tabDisabled)!==!0)return n.addTab(t.tab)},{templateUrl:"profile/profile-tab/profile-tab.html",scope:{},require:"^tgProfileTabs",link:t,transclude:!0}},angular.module("taigaProfile").directive("tgProfileTab",t)}.call(this),function(){var t;t=function(){function t(){this.tabs=[]}return t.prototype.addTab=function(t){return this.tabs.push(t)},t.prototype.toggleTab=function(t){return _.map(this.tabs,function(t){return t.active=!1}),t.active=!0},t}(),angular.module("taigaProfile").controller("ProfileTabs",t)}.call(this),function(){var t;t=function(){return{scope:{},controller:"ProfileTabs",controllerAs:"vm",templateUrl:"profile/profile-tabs/profile-tabs.html",transclude:!0}},angular.module("taigaProfile").directive("tgProfileTabs",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n,i,o){this.appMetaService=t,this.currentUserService=e,this.routeParams=r,this.userService=n,this.xhrError=i,this.translate=o,this.isCurrentUser=!1,this.routeParams.slug?this.userService.getUserByUserName(this.routeParams.slug).then(function(t){return function(e){return e.get("is_active")?(t.user=e,t.isCurrentUser=!1,t._setMeta(t.user),e):t.xhrError.notFound()}}(this))["catch"](function(t){return function(e){return t.xhrError.response(e)}}(this)):(this.user=this.currentUserService.getUser(),this.isCurrentUser=!0,this._setMeta(this.user))}return t.$inject=["tgAppMetaService","tgCurrentUserService","$routeParams","tgUserService","tgXhrErrorService","$translate"],t.prototype._setMeta=function(t){var e,r,n;return e={userFullName:t.get("full_name_display"),userUsername:t.get("username")},n=this.translate.instant("USER.PROFILE.PAGE_TITLE",e),r=t.get("bio"),this.appMetaService.setAll(n,r)},t}(),angular.module("taigaProfile").controller("Profile",t)}.call(this),function(){var t;t=function(){return{templateUrl:"projects/project/blocked-project-explanation.html"}},angular.module("taigaProjects").directive("tgBlockedProjectExplanation",t)}.call(this),function(){var t;t=function(){function t(t,e){this.confirm=t,this.likeButtonService=e,this.isMouseOver=!1,this.loading=!1}return t.$inject=["$tgConfirm","tgLikeProjectButtonService"],t.prototype.showTextWhenMouseIsOver=function(){return this.isMouseOver=!0},t.prototype.showTextWhenMouseIsLeave=function(){return this.isMouseOver=!1},t.prototype.toggleLike=function(){var t;return this.loading=!0,t=this.project.get("is_fan")?this._unlike():this._like(),t["finally"](function(t){return function(){return t.loading=!1}}(this)),t},t.prototype._like=function(){return this.likeButtonService.like(this.project.get("id")).then(function(t){return function(){return t.showTextWhenMouseIsLeave()}}(this))["catch"](function(t){return function(){return t.confirm.notify("error")}}(this))},t.prototype._unlike=function(){return this.likeButtonService.unlike(this.project.get("id"))["catch"](function(t){return function(){return t.confirm.notify("error")}}(this))},t}(),angular.module("taigaProjects").controller("LikeProjectButton",t)}.call(this),function(){var t;t=function(){return{scope:{},controller:"LikeProjectButton",bindToController:{project:"="},controllerAs:"vm",templateUrl:"projects/components/like-project-button/like-project-button.html"}},angular.module("taigaProjects").directive("tgLikeProjectButton",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga,t=function(t){function e(t,e,r){this.rs=t,this.currentUserService=e,this.projectService=r}return r(e,t),e.$inject=["tgResources","tgCurrentUserService","tgProjectService"],e.prototype._getProjectIndex=function(t){return this.currentUserService.projects.get("all").findIndex(function(e){return e.get("id")===t})},e.prototype._updateProjects=function(t,e){var r,n;if(r=this._getProjectIndex(t),r!==-1)return n=this.currentUserService.projects.get("all").update(r,function(t){var r;return r=t.get("total_fans"),e?r++:r--,t.merge({is_fan:e,total_fans:r})}),this.currentUserService.setProjects(n)},e.prototype._updateCurrentProject=function(t){var e,r;return r=this.projectService.project.get("total_fans"),t?r++:r--,e=this.projectService.project.merge({is_fan:t,total_fans:r}),this.projectService.setProject(e)},e.prototype.like=function(t){return this.rs.projects.likeProject(t).then(function(e){return function(){return e._updateProjects(t,!0),e._updateCurrentProject(!0)}}(this))},e.prototype.unlike=function(t){return this.rs.projects.unlikeProject(t).then(function(e){return function(){return e._updateProjects(t,!1),e._updateCurrentProject(!1)}}(this))},e}(e.Service),angular.module("taigaProjects").service("tgLikeProjectButtonService",t)}.call(this),function(){var t;t=function(t){var e,r;return r=function(e,r,n,i){var o,s,a;return s=null,o=dragula([r[0]],{copySortSource:!1,copy:!1,mirrorContainer:r[0],moves:function(t){return $(t).hasClass("list-itemtype-project")}}),o.on("dragend",function(r){var n,i,o,a,u,c,l;for(s=$(r),a=s.scope().project,i=s.index(),c=_.map(e.projects.toJS(),function(t){return t.id}),c=_.without(c,a.get("id")),c.splice(i,0,a.get("id")),u=[],i=n=0,o=c.length;nf?(d={status:413,data:{_error_message:"'"+c.name+"' ("+r(c.size)+") is too heavy for our oompa loompas, try it with a smaller than ("+r(f)+")"}},p.reject(d),p.promise):(v=function(t){return function(t){return i.$apply(function(){return c.status="in-progress",c.size=r(t.total),c.progressMessage="upload "+r(t.loaded)+" of "+r(t.total),c.progressPercent=Math.round(t.loaded/t.total*100)+"%"})}}(this),g=function(t){return function(t){return i.$apply(function(){var e,r,n;c.status="done",n=t.target.status;try{e=JSON.parse(t.target.responseText)}catch(i){e={}}return n>=200&&n<400?(e=Immutable.fromJS(e),p.resolve(e)):(d={status:n,data:{_error_message:null!=(r=l.attached_file)?r[0]:void 0}},p.reject(d))})}}(this),m=function(t){return function(t){return i.$apply(function(){return c.status="error",p.reject("fail")})}}(this),l=new FormData,l.append("project",a),l.append("object_id",u),l.append("attached_file",c),b=new XMLHttpRequest,b.upload.addEventListener("progress",v,!1),b.addEventListener("load",g,!1),b.addEventListener("error",m,!1),h=s.get("token"),b.open("POST",y),b.setRequestHeader("Authorization","Bearer "+h),b.setRequestHeader("Accept","application/json"),b.send(l),p.promise))},function(){return{attachments:a}}},t.$inject=["$tgUrls","$tgHttp","$tgConfig","$rootScope","$q","$tgStorage"],e=angular.module("taigaResources2"),e.factory("tgAttachmentsResource",t)}.call(this),function(){var t,e;t=function(t,e){var r;return r={},r.listInAllProjects=function(r){var n,i;return i=t.resolve("epics"),n={headers:{"x-disable-pagination":"1"}},e.get(i,r,n).then(function(t){return Immutable.fromJS(t.data)})},r.list=function(r){var n,i;return i=t.resolve("epics"),n={project:r},e.get(i,n).then(function(t){return Immutable.fromJS(t.data)})},r.patch=function(r,n){var i;return i=t.resolve("epics")+("/"+r),e.patch(i,n).then(function(t){return Immutable.fromJS(t.data)})},r.post=function(r){var n;return n=t.resolve("epics"),e.post(n,r).then(function(t){return Immutable.fromJS(t.data)})},r.reorder=function(r,n,i){var o,s;return s=t.resolve("epics")+("/"+r),o={headers:{"set-orders":JSON.stringify(i)}},e.patch(s,n,null,o)},r.addRelatedUserstory=function(r,n){var i,o;return o=t.resolve("epic-related-userstories",r),i={user_story:n,epic:r},e.post(o,i)},r.reorderRelatedUserstory=function(r,n,i,o){var s,a;return a=t.resolve("epic-related-userstories",r)+("/"+n),s={headers:{"set-orders":JSON.stringify(o)}},e.patch(a,i,null,s)},r.bulkCreateRelatedUserStories=function(r,n,i){var o,s;return s=t.resolve("epic-related-userstories-bulk-create",r),o={bulk_userstories:i,project_id:n},e.post(s,o)},r.deleteRelatedUserstory=function(r,n){var i;return i=t.resolve("epic-related-userstories",r)+("/"+n),e["delete"](i)},function(){return{epics:r}}},t.$inject=["$tgUrls","$tgHttp"],e=angular.module("taigaResources2"),e.factory("tgEpicsResource",t)}.call(this),function(){var t,e;t=function(t,e){var r;return r={},r.getApplicationToken=function(r,n){var i;return i=t.resolve("applications"),i=i+"/"+r+"/token?state="+n,e.get(i).then(function(t){return Immutable.fromJS(t.data)})},r.authorizeApplicationToken=function(r,n){var i,o;return o=t.resolve("application-tokens"),o+="/authorize",i={state:n,application:r},e.post(o,i).then(function(t){return Immutable.fromJS(t.data)})},function(){return{externalapps:r}}},t.$inject=["$tgUrls","$tgHttp"],e=angular.module("taigaResources2"),e.factory("tgExternalAppsResource",t)}.call(this),function(){var t,e;t=function(t,e){var r;return r={},r.listInAllProjects=function(r){var n,i;return i=t.resolve("issues"),n={headers:{"x-disable-pagination":"1"}},e.get(i,r,n).then(function(t){return Immutable.fromJS(t.data)})},function(){return{issues:r}}},t.$inject=["$tgUrls","$tgHttp"],e=angular.module("taigaResources2"),e.factory("tgIssuesResource",t)}.call(this),function(){var t,e,r;r=function(){},t=function(t,e,r){var n;return n={},n.getProjects=function(r,n){var i,o;return null==r&&(r={}),null==n&&(n=!0),o=t.resolve("projects"),i={},n||(i={headers:{"x-lazy-pagination":!0}}),e.get(o,r,i)},n.getProjectBySlug=function(r){var n;return n=t.resolve("projects"),n=n+"/by_slug?slug="+r,e.get(n).then(function(t){return Immutable.fromJS(t.data)})},n.getProjectsByUserId=function(r,n){var i,o,s;return null==n&&(n=!1),s=t.resolve("projects"),i={},n||(i.headers={"x-disable-pagination":"1"}),o={member:r,order_by:"user_order"},e.get(s,o,i).then(function(t){return Immutable.fromJS(t.data)})},n.getProjectStats=function(r){var n;return n=t.resolve("projects"),n=n+"/"+r,e.get(n).then(function(t){return Immutable.fromJS(t.data)})},n.bulkUpdateOrder=function(r){var n;return n=t.resolve("bulk-update-projects-order"),e.post(n,r)},n.getTimeline=function(n,i){var o,s;return o={page:i,only_relevant:!0},s=t.resolve("timeline-project"),s=s+"/"+n,e.get(s,o,{headers:{"x-lazy-pagination":!0}}).then(function(t){return t=Immutable.fromJS(t),r(t)})},n.likeProject=function(r){var n;return n=t.resolve("project-like",r),e.post(n)},n.unlikeProject=function(r){var n;return n=t.resolve("project-unlike",r),e.post(n)},n.watchProject=function(r,n){var i,o;return i={notify_level:n},o=t.resolve("project-watch",r),e.post(o,i)},n.unwatchProject=function(r){var n;return n=t.resolve("project-unwatch",r),e.post(n)},n.transferValidateToken=function(r,n){var i,o;return i={token:n},o=t.resolve("project-transfer-validate-token",r),e.post(o,i)},n.transferAccept=function(r,n,i){var o,s;return o={token:n,reason:i},s=t.resolve("project-transfer-accept",r),e.post(s,o)},n.transferReject=function(r,n,i){var o,s;return o={token:n,reason:i},s=t.resolve("project-transfer-reject",r),e.post(s,o)},n.transferRequest=function(r){var n;return n=t.resolve("project-transfer-request",r),e.post(n)},n.transferStart=function(r,n,i){var o,s;return o={user:n,reason:i},s=t.resolve("project-transfer-start",r),e.post(s,o)},function(){return{projects:n}}},t.$inject=["$tgUrls","$tgHttp","tgPaginateResponseService"],e=angular.module("taigaResources2"),e.factory("tgProjectsResources",t)}.call(this),function(){var t,e;e=["tgProjectsResources","tgUserResources","tgUsersResources","tgUserstoriesResource","tgTasksResource","tgIssuesResource","tgExternalAppsResource","tgAttachmentsResource","tgStatsResource","tgWikiHistory","tgEpicsResource"],t=function(t){var r,n,i,o,s,a,u,c,l;for(r=0,i=e.length;r"),$("head").append(r)),r.text(e||"")):0===t.indexOf("og:")?(r=$("head meta[property='"+t+"']"),0===r.length&&(r=$(""),$("head").append(r)),r.attr("content",e||"")):(r=$("head meta[name='"+t+"']"),0===r.length&&(r=$(""),$("head").append(r)),r.attr("content",e||""))},t.prototype.setTitle=function(t){return this._set("title",t)},t.prototype.setDescription=function(t){return this._set("description",r(t,250))},t.prototype.setTwitterMetas=function(t,e){return this._set("twitter:card","summary"),this._set("twitter:site","@taigaio"),this._set("twitter:title",t),this._set("twitter:description",r(e,300)),this._set("twitter:image",window.location.origin+"/"+window._version+"/images/logo-color.png")},t.prototype.setOpenGraphMetas=function(t,e){return this._set("og:type","object"),this._set("og:site_name","Taiga - Love your projects"),this._set("og:title",t),this._set("og:description",r(e,300)),this._set("og:image",window.location.origin+"/"+window._version+"/images/logo-color.png"),this._set("og:url",window.location.href)},t.prototype.setAll=function(t,e){return this.setTitle(t),this.setDescription(e),this.setTwitterMetas(t,e),this.setOpenGraphMetas(t,e)},t.prototype.addMobileViewport=function(){return $("head").append('')},t.prototype.removeMobileViewport=function(){return $('head meta[name="viewport"]').remove()},t.prototype.setfn=function(t){return this.listener&&this._listener(),this._listener=this.rootScope.$watchCollection(t,function(t){return function(e){if(e)return t.setAll(e.title,e.description),t._listener()}}(this))},t}(),angular.module("taigaCommon").service("tgAppMetaService",t)}.call(this),function(){var t,e;e=this.taiga.sizeFormat,t=function(){function t(t,r,n,i){this.confirm=t,this.config=r,this.translate=n,this.rs=i,this.maxFileSize=this.getMaxFileSize(),this.maxFileSize&&(this.maxFileSizeFormated=e(this.maxFileSize))}return t.$inject=["$tgConfirm","$tgConfig","$translate","tgResources"],t.prototype.sizeError=function(t){var r;return r=this.translate.instant("ATTACHMENT.ERROR_MAX_SIZE_EXCEEDED",{fileName:t.name,fileSize:e(t.size),maxFileSize:this.maxFileSizeFormated}),this.confirm.notify("error",r)},t.prototype.validate=function(t){return!(this.maxFileSize&&t.size>this.maxFileSize)||(this.sizeError(t),!1)},t.prototype.getMaxFileSize=function(){return this.config.get("maxUploadFileSize",null)},t.prototype.list=function(t,e,r){return this.rs.attachments.list(t,e,r).then(function(t){return function(t){return t.sortBy(function(t){return t.get("order")})}}(this))},t.prototype["delete"]=function(t,e){return this.rs.attachments["delete"](t,e)},t.prototype.saveError=function(t,e){var r;return r="",t&&(r=this.translate.instant("ATTACHMENT.ERROR_UPLOAD_ATTACHMENT",{fileName:t.name,errorMessage:e.data._error_message})),this.confirm.notify("error",r)},t.prototype.upload=function(t,e,r,n){var i;return i=this.rs.attachments.create(n,r,e,t),i.then(null,this.saveError.bind(this,t)),i},t.prototype.patch=function(t,e,r){var n;return n=this.rs.attachments.patch(e,t,r),n.then(null,this.saveError.bind(this,null)),n},t}(),angular.module("taigaCommon").service("tgAttachmentsService",t)}.call(this),function(){var t,e=function(t,e){return(+t%(e=+e)+e)%e};t=function(){function t(){var t,e;e=["/"+window._version+"/images/user-avatars/user-avatar-01.png","/"+window._version+"/images/user-avatars/user-avatar-02.png","/"+window._version+"/images/user-avatars/user-avatar-03.png","/"+window._version+"/images/user-avatars/user-avatar-04.png","/"+window._version+"/images/user-avatars/user-avatar-05.png"],t=["rgba( 178, 176, 204, 1 )","rgba( 183, 203, 131, 1 )","rgba( 210, 198, 139, 1 )","rgba( 214, 161, 212, 1 )","rgba( 247, 154, 154, 1 )"],this.logos=_.cartesianProduct(e,t)}return t.prototype.getDefault=function(t){var r,n;return r=e(murmurhash3_32_gc(t,42),this.logos.length),n=this.logos[r],{src:n[0],color:n[1]}},t.prototype.getUnnamed=function(){return{url:"/"+window._version+"/images/unnamed.png"}},t.prototype.getAvatar=function(t,e){var r,n,i,o,s,a;return t?(r="photo","avatarBig"===e&&(r="big_photo"),s=null,t instanceof Immutable.Map?(n=t.get("gravatar_id"),s=t.get(r)):(n=t.gravatar_id,s=t[r]),n?s?{url:s}:location.host.indexOf("localhost")!==-1?(a=location.protocol+"//"+location.host,i=this.getDefault(n),{url:a+i.src,bg:i.color}):(a=location.protocol+"//"+location.host,i=this.getDefault(n),o=encodeURIComponent(a+i.src),{url:"https://www.gravatar.com/avatar/"+n+"?d="+o,bg:i.color}):this.getUnnamed()):this.getUnnamed()},t}(),angular.module("taigaCommon").service("tgAvatarService",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t){this.projectService=t}return t.$inject=["tgProjectService"],t.prototype.check=function(t){return!!this.projectService.project&&this.projectService.project.get("my_permissions").indexOf(t)!==-1},t}(),angular.module("taigaCommon").service("tgCheckPermissionsService",t)}.call(this),function(){var t,e,r;r=this.taiga,e=this.taiga.groupBy,t=function(){function t(t,e,n){this.projectsService=t,this.storageService=e,this.rs=n,this._user=null,this._projects=Immutable.Map(),this._projectsById=Immutable.Map(),this._joyride=null,r.defineImmutableProperty(this,"projects",function(t){return function(){return t._projects}}(this)),r.defineImmutableProperty(this,"projectsById",function(t){return function(){return t._projectsById}}(this))}return t.$inject=["tgProjectsService","$tgStorage","tgResources"],t.prototype.isAuthenticated=function(){return null!==this.getUser()},t.prototype.getUser=function(){var t;return this._user||(t=this.storageService.get("userInfo"),t&&(t=Immutable.fromJS(t),this.setUser(t))),this._user},t.prototype.removeUser=function(){return this._user=null,this._projects=Immutable.Map(),this._projectsById=Immutable.Map(),this._joyride=null},t.prototype.setUser=function(t){return this._user=t,this._loadUserInfo()},t.prototype.bulkUpdateProjectsOrder=function(t){return this.projectsService.bulkUpdateProjectsOrder(t).then(function(t){return function(){return t.loadProjects()}}(this))},t.prototype.loadProjects=function(){return this.projectsService.getProjectsByUserId(this._user.get("id")).then(function(t){return function(e){return t.setProjects(e)}}(this))},t.prototype.disableJoyRide=function(t){return t?this._joyride[t]=!1:this._joyride={backlog:!1,kanban:!1,dashboard:!1},this.rs.user.setUserStorage("joyride",this._joyride)},t.prototype.loadJoyRideConfig=function(){return new Promise(function(t){return function(e){return null!==t._joyride?void e(t._joyride):t.rs.user.getUserStorage("joyride").then(function(r){return t._joyride=r,e(t._joyride)})["catch"](function(){return t._joyride={backlog:!0,kanban:!0,dashboard:!0},t.rs.user.createUserStorage("joyride",t._joyride),e(t._joyride)})}}(this))},t.prototype._loadUserInfo=function(){return Promise.all([this.loadProjects()])},t.prototype.setProjects=function(t){return this._projects=this._projects.set("all",t),this._projects=this._projects.set("recents",t.slice(0,10)),this._projectsById=Immutable.fromJS(e(t.toJS(),function(t){return t.id})),this.projects},t.prototype.canCreatePrivateProjects=function(){var t;return t=this.getUser(),null!==t.get("max_private_projects")&&t.get("total_private_projects")>=t.get("max_private_projects")?{valid:!1,reason:"max_private_projects",type:"private_project"}:{valid:!0}},t.prototype.canCreatePublicProjects=function(){var t;return t=this.getUser(),null!==t.get("max_public_projects")&&t.get("total_public_projects")>=t.get("max_public_projects")?{valid:!1,reason:"max_public_projects",type:"public_project"}:{valid:!0}},t.prototype.canOwnProject=function(t){var e,r;if(r=this.getUser(),t.get("is_private")){if(e=this.canCreatePrivateProjects(),!e.valid)return e;if(null!==r.get("max_memberships_private_projects")&&t.get("total_memberships")>r.get("max_memberships_private_projects"))return{valid:!1,reason:"max_members_private_projects",type:"private_project"}}else{if(e=this.canCreatePublicProjects(),!e.valid)return e;if(null!==r.get("max_memberships_public_projects")&&t.get("total_memberships")>r.get("max_memberships_public_projects"))return{valid:!1,reason:"max_members_public_projects",type:"public_project"}}return{valid:!0}},t}(),angular.module("taigaCommon").service("tgCurrentUserService",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t){this.rootScope=t}return t.$inject=["$rootScope"],t.prototype.init=function(){return this.rootScope.errorHandling={}},t.prototype.notfound=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.notfound=!0},t.prototype.error=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.error=!0},t.prototype.permissionDenied=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.permissionDenied=!0},t.prototype.block=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.blocked=!0},t}(),angular.module("taigaCommon").service("tgErrorHandlingService",t)}.call(this),function(){var t;t=function(){function t(t,e){this.rootScope=t,this.compile=e}return t.$inject=["$rootScope","$compile"],t.prototype.create=function(t,e,r){var n,i,o;o=this.rootScope.$new(),o=_.merge(o,r),n=$("
").attr(t,!0).attr("tg-bind-scope",!0),e&&n.attr(e),n.addClass("remove-on-close"),i=this.compile(n)(o),$(document.body).append(i)},t}(),angular.module("taigaCommon").service("tgLightboxFactory",t)}.call(this),function(){var t;t=function(){return function(t){var e;return e=Immutable.Map({data:t.get("data"),next:!!t.get("headers")("x-pagination-next"),prev:!!t.get("headers")("x-pagination-prev"),current:t.get("headers")("x-pagination-current"),count:t.get("headers")("x-pagination-count")})}},angular.module("taigaCommon").factory("tgPaginateResponseService",t)}.call(this),function(){var t,e=function(t,e){return(+t%(e=+e)+e)%e};t=function(){function t(){var t,e;e=["/"+window._version+"/images/project-logos/project-logo-01.png","/"+window._version+"/images/project-logos/project-logo-02.png","/"+window._version+"/images/project-logos/project-logo-03.png","/"+window._version+"/images/project-logos/project-logo-04.png","/"+window._version+"/images/project-logos/project-logo-05.png"],t=["rgba( 153, 214, 220, 1 )","rgba( 213, 156, 156, 1 )","rgba( 214, 161, 212, 1 )","rgba( 164, 162, 219, 1 )","rgba( 152, 224, 168, 1 )"],this.logos=_.cartesianProduct(e,t)}return t.prototype.getDefaultProjectLogo=function(t,r){var n,i,o;return i=t+"-"+r,n=e(murmurhash3_32_gc(i,42),this.logos.length),o=this.logos[n],{src:o[0],color:o[1]}},t}(),angular.module("taigaCommon").service("tgProjectLogoService",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,r){this.projectsService=t,this.xhrError=r,this._project=null,this._section=null,this._sectionsBreadcrumb=Immutable.List(),this._activeMembers=Immutable.List(),e.defineImmutableProperty(this,"project",function(t){return function(){return t._project}}(this)),e.defineImmutableProperty(this,"section",function(t){return function(){return t._section}}(this)),e.defineImmutableProperty(this,"sectionsBreadcrumb",function(t){return function(){return t._sectionsBreadcrumb}}(this)),e.defineImmutableProperty(this,"activeMembers",function(t){return function(){return t._activeMembers}}(this))}return t.$inject=["tgProjectsService","tgXhrErrorService"],t.prototype.cleanProject=function(){return this._project=null,this._activeMembers=Immutable.List(),this._section=null,this._sectionsBreadcrumb=Immutable.List()},t.prototype.setSection=function(t){return this._section=t,t?this._sectionsBreadcrumb=this._sectionsBreadcrumb.push(this._section):this._sectionsBreadcrumb=Immutable.List()},t.prototype.setProject=function(t){return this._project=t,this._activeMembers=this._project.get("members").filter(function(t){return t.get("is_active")})},t.prototype.setProjectBySlug=function(t){return new Promise(function(e){return function(r,n){return e.project&&e.project.get("slug")===t?r():e.projectsService.getProjectBySlug(t).then(function(t){return e.setProject(t),r()})["catch"](function(t){return e.xhrError.response(t)})}}(this))},t.prototype.fetchProject=function(){var t;return t=this.project.get("slug"),this.projectsService.getProjectBySlug(t).then(function(t){return function(e){return t.setProject(e)}}(this))},t.prototype.hasPermission=function(t){return this._project.get("my_permissions").indexOf(t)!==-1},t.prototype.isEpicsDashboardEnabled=function(){return this._project.get("is_epics_activated")},t}(),angular.module("taigaCommon").service("tgProjectService",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga,t=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return r(e,t),e}(e.Service=function(){return{use:function(t){var e;return e=$("link[rel='stylesheet']:first"),0===e.length&&(e=$(""),$("head").append(e)),e.attr("href","/"+window._version+"/styles/theme-"+t+".css")}}}),angular.module("taigaCommon").service("tgThemeService",t)}.call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;r=this.taiga,e=r.bindMethods,t=function(t){function r(t){this.rs=t,e(this)}return n(r,t),r.$inject=["tgResources"],r.prototype.getUserByUserName=function(t){return this.rs.users.getUserByUsername(t)},r.prototype.getContacts=function(t){return this.rs.users.getContacts(t)},r.prototype.getLiked=function(t,e,r,n){return this.rs.users.getLiked(t,e,r,n)},r.prototype.getVoted=function(t,e,r,n){return this.rs.users.getVoted(t,e,r,n)},r.prototype.getWatched=function(t,e,r,n){return this.rs.users.getWatched(t,e,r,n)},r.prototype.getStats=function(t){return this.rs.users.getStats(t)},r.prototype.attachUserContactsToProjects=function(t,e){return this.getContacts(t).then(function(t){return e=e.map(function(e){var r;return r=t.filter(function(t){var r;return r=t.get("id"),e.get("members").indexOf(r)!==-1}),e=e.set("contacts",r)})})},r}(r.Service),angular.module("taigaCommon").service("tgUserService",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,e){this.q=t,this.errorHandlingService=e}return e(r,t),r.$inject=["$q","tgErrorHandlingService"],r.prototype.notFound=function(){return this.errorHandlingService.notfound()},r.prototype.permissionDenied=function(){return this.errorHandlingService.permissionDenied()},r.prototype.response=function(t){return t&&(404===t.status?this.notFound():403===t.status&&this.permissionDenied()),this.q.reject(t)},r}(taiga.Service),angular.module("taigaCommon").service("tgXhrErrorService",t)}.call(this),function(){var t;t=function(t,e){var r,n,i;return i=[".jpg",".jpeg",".bmp",".gif",".png"],r=function(t){return t=t.toLowerCase(),_.some(i,function(e){return t.indexOf(e,t-e.length)!==-1})},n=function(n,i){var o,s;return o=r(n.attachment.get("url")),s=o?t.get("user-timeline/user-timeline-attachment/user-timeline-attachment-image.html"):t.get("user-timeline/user-timeline-attachment/user-timeline-attachment.html"),i.html(s),e(i.contents())(n),i.find("img").error(function(){return this.remove()})},{link:n,scope:{attachment:"=tgUserTimelineAttachment"}}},t.$inject=["$tgTemplate","$compile"],angular.module("taigaUserTimeline").directive("tgUserTimelineAttachment",t)}.call(this),function(){var t,e;e=this.taiga.unslugify,t=function(){function t(t,e){this.translate=t,this.sce=e}return t.$inject=["$translate","$sce"],t.prototype._fieldTranslationKey={status:"COMMON.FIELDS.STATUS",subject:"COMMON.FIELDS.SUBJECT",description_diff:"COMMON.FIELDS.DESCRIPTION",points:"COMMON.FIELDS.POINTS",assigned_to:"COMMON.FIELDS.ASSIGNED_TO",severity:"ISSUES.FIELDS.SEVERITY",priority:"ISSUES.FIELDS.PRIORITY",type:"ISSUES.FIELDS.TYPE",is_iocaine:"TASK.FIELDS.IS_IOCAINE",is_blocked:"COMMON.FIELDS.IS_BLOCKED",color:"COMMON.FIELDS.COLOR"},t.prototype._params={username:function(t,e){var r,n,i;return i=t.getIn(["data","user"]),i.get("is_profile_visible")?(r=this.translate.instant("COMMON.SEE_USER_PROFILE",{username:i.get("username")}),n="user-profile:username=timeline.getIn(['data', 'user', 'username'])",this._getLink(n,i.get("name"),r)):this._getUsernameSpan(i.get("name"))},field_name:function(t,e){var r;return r=t.getIn(["data","value_diff","key"]),this.translate.instant(this._fieldTranslationKey[r])},project_name:function(t,e){var r;return r="project:project=timeline.getIn(['data', 'project', 'slug'])",this._getLink(r,t.getIn(["data","project","name"]))},new_value:function(t,e){var r,n;return _.isArray(t.getIn(["data","value_diff","value"]).toJS())?(n=t.getIn(["data","value_diff","value"]).get(1),null===n&&"assigned_to"===t.getIn(["data","value_diff","key"])&&(n=this.translate.instant("ACTIVITY.VALUES.UNASSIGNED")),r=n):r=t.getIn(["data","value_diff","value"]).first().get(1),_.escape(r)},sprint_name:function(t,e){var r;return r="project-taskboard:project=timeline.getIn(['data', 'project', 'slug']),sprint=timeline.getIn(['data', 'milestone', 'slug'])",this._getLink(r,t.getIn(["data","milestone","name"]))},us_name:function(t,e){var r,n,i,o;return n=this._getTimelineObj(t,e).get("userstory"),r={obj:"parent_userstory"},o=this._getDetailObjUrl(r),i="#"+n.get("ref")+" "+n.get("subject"),this._getLink(o,i)},related_us_name:function(t,e){var r,n,i;return r=t.getIn(["data","userstory"]),i="project-userstories-detail:project=timeline.getIn(['data', 'userstory', 'project', 'slug']),ref=timeline.getIn(['data', 'userstory', 'ref'])",n="#"+r.get("ref")+" "+r.get("subject"),this._getLink(i,n)},epic_name:function(t,e){var r,n,i;return r=t.getIn(["data","epic"]),i="project-epics-detail:project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['data', 'epic', 'ref'])",n="#"+r.get("ref")+" "+r.get("subject"),this._getLink(i,n)},obj_name:function(t,r){var n,i,o;return n=this._getTimelineObj(t,r),o=this._getDetailObjUrl(r),i="wikipage"===r.obj?e(n.get("slug")):"milestone"===r.obj?n.get("name"):"#"+n.get("ref")+" "+n.get("subject"),this._getLink(o,i)},role_name:function(t,e){return _.escape(t.getIn(["data","value_diff","value"]).keySeq().first())}},t.prototype._translateTitleParams=function(t,e,r){return this._params[t].call(this,e,r)},t.prototype._getTimelineObj=function(t,e){return t.getIn(["data",e.obj])},t.prototype._getDetailObjUrl=function(t){var e;return e={issue:["project-issues-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"],wikipage:["project-wiki-page",":project=timeline.getIn(['data', 'project', 'slug']),slug=timeline.getIn(['obj', 'slug'])"],task:["project-tasks-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"],userstory:["project-userstories-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"],parent_userstory:["project-userstories-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'userstory', 'ref'])"],milestone:["project-taskboard",":project=timeline.getIn(['data', 'project', 'slug']),sprint=timeline.getIn(['obj', 'slug'])"],epic:["project-epics-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"]},e[t.obj][0]+e[t.obj][1]},t.prototype._getLink=function(t,e,r){var n;return r=r||e,n=$("").attr("ng-non-bindable",!0).text(e),$("").attr("tg-nav",t).attr("title",r).append(n).prop("outerHTML")},t.prototype._getUsernameSpan=function(t){var e;return e=e||t,$("").addClass("username").text(t).prop("outerHTML")},t.prototype._getParams=function(t,e,r){var n;return n={},r.translate_params.forEach(function(r){return function(i){return n[i]=r._translateTitleParams(i,t,e)}}(this)),n},t.prototype.getTitle=function(t,e,r){var n,i,o;return n=this._getParams(t,e,r),i={},Object.keys(n).forEach(function(t){return i[t]="{{"+t+"}}"}),o=this.translate.instant(r.key,i),Object.keys(n).forEach(function(t){var e;return e="{{"+t+"}}",o=o.replace(new RegExp(e,"g"),n[t])}),o},t}(),angular.module("taigaUserTimeline").service("tgUserTimelineItemTitle",t)}.call(this),function(){var t,e;e=function(t,e){var r;return r=[{check:function(t,e){return"membership"===e.obj},key:"TIMELINE.NEW_MEMBER",translate_params:["project_name"],member:function(t){return Immutable.Map({user:t.getIn(["data","user"]),role:t.getIn(["data","role"])})}},{check:function(t,e){return"project"===e.obj&&"create"===e.type},key:"TIMELINE.NEW_PROJECT",translate_params:["username","project_name"],description:function(t){return t.getIn(["data","project","description"])}},{check:function(t,e){return"change"===e.type&&t.hasIn(["data","value_diff"])&&"attachments"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.UPLOAD_ATTACHMENT",translate_params:["username","obj_name"]},{check:function(t,e){return"userstory"===e.obj&&"create"===e.type},key:"TIMELINE.US_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"issue"===e.obj&&"create"===e.type},key:"TIMELINE.ISSUE_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"wikipage"===e.obj&&"create"===e.type},key:"TIMELINE.WIKI_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"task"===e.obj&&"create"===e.type&&!t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"task"===e.obj&&"create"===e.type&&t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_CREATED_WITH_US",translate_params:["username","project_name","obj_name","us_name"]},{check:function(t,e){return"milestone"===e.obj&&"create"===e.type},key:"TIMELINE.MILESTONE_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"epic"===e.obj&&"create"===e.type},key:"TIMELINE.EPIC_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"relateduserstory"===e.obj&&"create"===e.type},key:"TIMELINE.EPIC_RELATED_USERSTORY_CREATED",translate_params:["username","project_name","related_us_name","epic_name"]},{check:function(t,e){return t.getIn(["data","comment"])&&"userstory"===e.obj},key:"TIMELINE.NEW_COMMENT_US",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.getIn(["data","comment"])&&"issue"===e.obj},key:"TIMELINE.NEW_COMMENT_ISSUE",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.getIn(["data","comment"])&&"task"===e.obj},key:"TIMELINE.NEW_COMMENT_TASK",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.getIn(["data","comment"])&&"epic"===e.obj},key:"TIMELINE.NEW_COMMENT_EPIC",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.hasIn(["data","value_diff"])&&"moveInBacklog"===t.getIn(["data","value_diff","key"])&&t.hasIn(["data","value_diff","value","backlog_order"])&&"change"===e.type},key:"TIMELINE.US_MOVED",translate_params:["username","obj_name"]},{check:function(t,e){return!(!t.hasIn(["data","value_diff"])||"moveInBacklog"!==t.getIn(["data","value_diff","key"])||"change"!==e.type||"userstory"!==e.obj)&&null===t.getIn(["data","value_diff","value","milestone"]).get(1)},key:"TIMELINE.US_REMOVED_FROM_MILESTONE",translate_params:["username","obj_name"]},{check:function(t,e){return t.hasIn(["data","value_diff"])&&"moveInBacklog"===t.getIn(["data","value_diff","key"])&&"change"===e.type&&"userstory"===e.obj},key:"TIMELINE.US_ADDED_MILESTONE",translate_params:["username","obj_name","sprint_name"]},{check:function(t,e){return!(!t.hasIn(["data","value_diff"])||"blocked"!==t.getIn(["data","value_diff","key"])||"change"!==e.type)&&t.getIn(["data","value_diff","value","is_blocked"]).get(1)===!0},key:"TIMELINE.BLOCKED",translate_params:["username","obj_name"],description:function(t){var e;return!!t.hasIn(["data","value_diff","value","blocked_note_html"])&&(e=t.getIn(["data","value_diff","value","blocked_note_html"]).get(1),$($.parseHTML(e)).text())}},{check:function(t,e){return!(!t.hasIn(["data","value_diff"])||"blocked"!==t.getIn(["data","value_diff","key"])||"change"!==e.type)&&t.getIn(["data","value_diff","value","is_blocked"]).get(1)===!1},key:"TIMELINE.UNBLOCKED",translate_params:["username","obj_name"]},{check:function(t,e){return"milestone"===e.obj&&"change"===e.type},key:"TIMELINE.MILESTONE_UPDATED",translate_params:["username","obj_name"]},{check:function(t,e){return"wikipage"===e.obj&&"change"===e.type},key:"TIMELINE.WIKI_UPDATED",translate_params:["username","obj_name"]},{check:function(t,e){return"userstory"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"points"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.US_UPDATED_POINTS",translate_params:["username","field_name","obj_name","new_value","role_name"]},{check:function(t,e){return"userstory"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.US_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"userstory"===e.obj&&"change"===e.type},key:"TIMELINE.US_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"issue"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.ISSUE_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"issue"===e.obj&&"change"===e.type},key:"TIMELINE.ISSUE_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&!t.getIn(["data","task","userstory"])&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.TASK_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&t.getIn(["data","task","userstory"])&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.TASK_UPDATED_WITH_US",translate_params:["username","field_name","obj_name","us_name"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&!t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_UPDATED_WITH_US_NEW_VALUE",translate_params:["username","field_name","obj_name","us_name","new_value"]},{check:function(t,e){return"epic"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.EPIC_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"epic"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"color"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.EPIC_UPDATED_WITH_NEW_COLOR",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"epic"===e.obj&&"change"===e.type},key:"TIMELINE.EPIC_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"user"===e.obj&&"create"===e.type},key:"TIMELINE.NEW_USER",translate_params:["username"]}],_.find(r,function(r){return r.check(t,e)})},t=function(){function t(){}return t.prototype.getType=function(t,r){return e(t,r)},t}(),angular.module("taigaUserTimeline").service("tgUserTimelineItemType",t)}.call(this),function(){var t;t=function(){return{templateUrl:"user-timeline/user-timeline-item/user-timeline-item.html",scope:{timeline:"=tgUserTimelineItem"}}},angular.module("taigaUserTimeline").directive("tgUserTimelineItem",t)}.call(this),function(){var t;t=function(){var t;return t={}, t.generate=function(t){var e,r,n,i;return i=1,r=Immutable.List(),t.minItems=t.minItems||20,n=function(){return r=Immutable.List(),e()},e=function(){return t.fetch(i).then(function(n){var o;return i++,o=n.get("data"),t.filter&&(o=t.filter(o)),t.map&&(o=o.map(t.map)),r=r.concat(o),r.size