angular.module("Wizdom365.EditorRevision",[]);
angular.module("Wizdom365.EditorRevision").factory("dateService",["$q",function(e){return{isFuture:function(e){var t=new Date,i=new Date(e);return i.getTime()>t.getTime()?!1:!0}}}]);
!function(){function e(e){var t={baseUrl:"api/wizdom/EditorRevision/pages",allowBatching:!1,getPagesForContactPerson:function(t){return e.get(this.baseUrl+"/contactperson?path="+t.path+"&contentTypeId="+t.contentTypeId+"&daysBeforeRevision="+t.daysBeforeRevision+"&resultSource="+t.resultSource+"&account="+t.account,this.allowBatching)},getPagesForEditor:function(t){return e.get(this.baseUrl+"/editor?path="+t.path+"&contentTypeId="+t.contentTypeId+"&daysBeforeRevision="+t.daysBeforeRevision+"&resultSource="+t.resultSource+"&account="+t.account,this.allowBatching)},getPagesForMe:function(t){return e.get(this.baseUrl+"/mine?path="+t.path+"&contentTypeId="+t.contentTypeId+"&daysBeforeRevision="+t.daysBeforeRevision+"&resultSource="+t.resultSource+"&account="+t.account,this.allowBatching)},searchByUser:function(t){return e.get(this.baseUrl+"/searchEditor?account="+t.account+"&path="+t.path+"&contentTypeId="+t.contentTypeId+"&daysBeforeRevision="+t.daysBeforeRevision+"&resultSource="+t.resultSource,this.allowBatching)}};return t}angular.module("Wizdom365.EditorRevision").factory("revisionApi",e),e.$inject=["webapiService"]}();
angular.module("Wizdom365.EditorRevision").directive("wizdom365RevisionSearchPersons",[function(){return{scope:{onSelectedUser:"&",selectedUser:"=",userModel:"="},template:'<div><script type="text/ng-template" id="customTemplate.html"><a href="" class="suggestionlist-li-a"> <div> <div style="margin-bottom:0;"> <div style="width: 100%; overflow: hidden;"> <div style="width: 36px; float: left;"> <div style="display:inline-block" wizdom365-presence-picture="" size="SMALLROUNDED" accountname="match.model.AccountName" email="match.model.WorkEmail" name="match.model.PreferredName"></div> </div> <div style="margin-left: 36px;"> <h3 class="suggestionslist-li-heading"> {{match.model.PreferredName}} </h3> <div class="suggestionlist-li-content"> {{match.model.WorkEmail}} </div> </div> </div> </div> </div> </a></script><div class="gamification"><input type="text" ng-model="userModel" placeholder="{{\'Search\' | translate}}" typeahead="item.PreferredName as item.PreferredName for item in searchPrincipal($viewValue)" typeahead-loading="searchPlaceholder" typeahead-no-results="noResults" typeahead-template-url="customTemplate.html" typeahead-min-length="2" typeahead-on-select="onSelect($item, $model, $label)" class="form-control"> <i ng-show="searchPlaceholder" class="glyphicon glyphicon-refresh"></i><div ng-show="noResults">{{\'No Results Found\' | translate}}</div></div></div>',link:function(e,t,i){},controller:["$scope","contextInfo","webApiProxy",function(e,t,i){e.userModel=void 0,e.searchPrincipal=function(e){return i.searchPerson.search(e,0,5,["PreferredName","AccountName","Path","WorkPhone","WorkEmail"]).then(function(e){return e.users},function(e){})},e.onSelect=function(t,i,l){angular.copy(t,e.selectedUser),e.onSelectedUser()}}]}}]);
angular.module("Wizdom365.EditorRevision").directive("wizdom365RevisionMyContactPages",[function(){return{scope:{},template:'<div class="bootstrap-wrapper">\n                            <div class="webpart-edit-button-container" ng-if="editMode">\n                                <button class="editWebpartButton btn" ng-click="editWebpart()" type="button" title=\'{{"Edit Webpart" | translate}}\'>\n                                    <span class="ms-Icon ms-Icon--Edit"></span><span class="editWebpartButtonText">{{"Edit" | translate}}</span>\n                                </button>\n                            </div>\n                        	<div wizdom-include=\'webpartProperties.templateUrl\'></div>\n                        </div>',link:function(e,t,r){},controller:["$scope","$element","$attrs","webpartPropertiesService","contextInfo","revisionApi","dateService","$modal",function(e,t,r,n,i,o,a,s){function p(t){e.dataReady=!1,e.pages=[];var r={path:e.webpartProperties.path,contentTypeId:e.webpartProperties.contentTypeId,daysBeforeRevision:e.webpartProperties.numberOfDaysBeforeRevision,resultSource:e.webpartProperties.resultSource,account:t};o.getPagesForContactPerson(r).then(function(t){e.pages=t.pages,e.dataReady=!0})}function d(){1!=e.webpartProperties.displayMode?p(""):e.dataReady=!0}e.webpartId=n.getWebpartId(t),n.hideEditCode(t),e.editMode=n.isInEditMode(t);var c=r.webpartProperties?JSON.parse(r.webpartProperties):null;e.webpartProperties={itemsPrPage:c&&c.itemsPrPage||10,contentTypeId:c&&c.contentTypeId||"",numberOfDaysBeforeRevision:c&&c.numberOfDaysBeforeRevision||14,path:c&&c.path||"",templateUrl:c&&c.templateUrl||"EditorRevision/Templates/ViewTemplates/RevisionPages/revision-my-contactpages.html",displayMode:c&&c.displayMode||0,resultSource:c&&c.resultSource||""},e.currentPage=0,e.setPage=function(t){e.currentPage=t},e.dataReady=!1,e.isFuture=function(e){return a.isFuture(e)},e.editWebpart=function(){s.open({templateUrl:"EditorRevision/Templates/Dialogs/EditWebpart.html",controller:"revisionEditCtrl",windowClass:"bootstrap-wrapper",resolve:{hideDays:function(){return!1},webpartId:function(){return e.webpartId},webpartProperties:function(){return e.webpartProperties},directoryPath:function(){return"EditorRevision/Templates/ViewTemplates/RevisionPages"},revisionType:function(){return"contact"}}}).result.then(function(t){t&&(e.webpartProperties=t,d())})},d(),e.selectedUser={},e.onSelect=function(){p(e.selectedUser.WorkEmail)},e.userModel={name:void 0},e.$watch("userModel.name",function(t,r){e.pages=[]},!0)}]}}]);
angular.module("Wizdom365.EditorRevision").directive("wizdom365RevisionMyModifiedPages",[function(){return{scope:{},template:'<div class="bootstrap-wrapper">\n                        <div class="webpart-edit-button-container" ng-if="editMode">\n                            <button class="editWebpartButton btn" ng-click="editWebpart()" type="button" title=\'{{"Edit Webpart" | translate}}\'>\n                                <span class="ms-Icon ms-Icon--Edit"></span><span class="editWebpartButtonText">{{"Edit" | translate}}</span>\n                            </button>\n                        </div>\n                    	<div wizdom-include=\'webpartProperties.templateUrl\'></div>\n                    </div>',link:function(e,t,r){},controller:["$scope","$element","$attrs","webpartPropertiesService","contextInfo","revisionApi","dateService","$modal",function(e,t,r,i,n,o,a,s){function p(t){e.dataReady=!1,e.pages=[];var r={path:e.webpartProperties.path,contentTypeId:e.webpartProperties.contentTypeId,daysBeforeRevision:e.webpartProperties.numberOfDaysBeforeRevision,resultSource:e.webpartProperties.resultSource,account:t};o.getPagesForEditor(r).then(function(t){e.pages=t.pages,e.dataReady=!0})}function d(){1!=e.webpartProperties.displayMode?p(""):e.dataReady=!0}e.webpartId=i.getWebpartId(t),e.editMode=i.isInEditMode(t),i.hideEditCode(t);var l=r.webpartProperties?JSON.parse(r.webpartProperties):null;e.webpartProperties={itemsPrPage:l&&l.itemsPrPage||10,contentTypeId:l&&l.contentTypeId||"0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900E1A7B5EB4F6D4536ABA24236F66055A1*",numberOfDaysBeforeRevision:l&&l.numberOfDaysBeforeRevision||14,path:l&&l.path||"",templateUrl:l&&l.templateUrl||"EditorRevision/Templates/ViewTemplates/RevisionPages/revision-my-editorpages.html",displayMode:l&&l.displayMode||0,resultSource:l&&l.resultSource||""},e.currentPage=0,e.dataReady=!1,e.setPage=function(t){e.currentPage=t},e.isFuture=function(e){return a.isFuture(e)},e.editWebpart=function(){s.open({templateUrl:"EditorRevision/Templates/Dialogs/EditWebpart.html",controller:"revisionEditCtrl",windowClass:"bootstrap-wrapper",resolve:{hideDays:function(){return!1},webpartId:function(){return e.webpartId},webpartProperties:function(){return e.webpartProperties},directoryPath:function(){return"EditorRevision/Templates/ViewTemplates/RevisionPages"},revisionType:function(){return"modified"}}}).result.then(function(t){t&&(e.webpartProperties=t,d())})},d(),e.selectedUser={},e.onSelect=function(){p(e.selectedUser.WorkEmail)},e.userModel={name:void 0},e.$watch("userModel.name",function(t,r){e.pages=[]},!0)}]}}]);
angular.module("Wizdom365.EditorRevision").directive("wizdom365RevisionMyPages",[function(e){return{scope:{},template:'<div class="bootstrap-wrapper">\n                            <div class="webpart-edit-button-container" ng-if="editMode">\n                                <button class="editWebpartButton btn" ng-click="editWebpart()" type="button" title=\'{{"Edit Webpart" | translate}}\'>\n                                    <span class="ms-Icon ms-Icon--Edit"></span><span class="editWebpartButtonText">{{"Edit" | translate}}</span>\n                                </button>\n                            </div>\n                        	<div wizdom-include=\'webpartProperties.templateUrl\'></div>\n                        </div>',link:function(e,t,r){},controller:["$scope","$element","$attrs","webpartPropertiesService","contextInfo","revisionApi","dateService","$modal",function(e,t,r,i,n,a,o,s){function p(t){e.dataReady=!1,e.pages=[];var r={path:e.webpartProperties.path,contentTypeId:e.webpartProperties.contentTypeId,daysBeforeRevision:e.webpartProperties.numberOfDaysBeforeRevision,resultSource:e.webpartProperties.resultSource,account:t};a.getPagesForMe(r).then(function(t){e.pages=t.pages,e.dataReady=!0})}function d(){1!=e.webpartProperties.displayMode?p(""):e.dataReady=!0}e.webpartId=i.getWebpartId(t),i.hideEditCode(t),e.editMode=i.isInEditMode(t);var l=r.webpartProperties?JSON.parse(r.webpartProperties):null;e.webpartProperties={itemsPrPage:l&&l.itemsPrPage||10,contentTypeId:l&&l.contentTypeId||"0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900E1A7B5EB4F6D4536ABA24236F66055A1*",numberOfDaysBeforeRevision:l&&l.numberOfDaysBeforeRevision||14,path:l&&l.path||"",templateUrl:l&&l.templateUrl||"EditorRevision/Templates/ViewTemplates/EditorPages/revision-my-editorpages.html",displayMode:l&&l.displayMode||0,resultSource:l&&l.resultSource||""},e.currentPage=0,e.setPage=function(t){e.currentPage=t},e.dataReady=!1,e.isFuture=function(e){return o.isFuture(e)},e.editWebpart=function(){s.open({templateUrl:"EditorRevision/Templates/Dialogs/EditWebpart.html",controller:"revisionEditCtrl",windowClass:"bootstrap-wrapper",resolve:{hideDays:function(){return!0},webpartId:function(){return e.webpartId},webpartProperties:function(){return e.webpartProperties},directoryPath:function(){return"EditorRevision/Templates/ViewTemplates/EditorPages"},revisionType:function(){return"mypages"}}}).result.then(function(t){t&&(e.webpartProperties=t,d())})},d(),e.selectedUser={},e.onSelect=function(){p(e.selectedUser.WorkEmail)},e.userModel={name:void 0},e.$watch("userModel.name",function(t,r){e.pages=[]},!0)}]}}]);

angular.module("Wizdom365").requires.push("Wizdom365.EditorRevision");