angular.module("Wizdom365.Currentmenu",[]).factory("currentmenuConfig",["configuration","contextInfo",function(r,n){function e(){return angular.isObject(window.WizdomScriptLoaderVars)&&angular.isArray(window.WizdomScriptLoaderVars.CurrentMenuUrls)&&angular.isString(n.spWebUrl)&&null!=_.find(window.WizdomScriptLoaderVars.CurrentMenuUrls,function(r){return r==encodeURI(n.spWebUrl.toLowerCase())})}return{isCurrentmenuRequired:e()}}]),angular.module("Wizdom365.Currentmenu").run(["contextInfo","currentmenuConfig",function(r,n){n.isCurrentmenuRequired&&$(".ms-core-sideNavBox-removeLeftMargin").attr("wizdom365-currentmenu","")}]);
!function(){function e(e){return{scope:{},templateUrl:e.Currentmenu.Template,controllerAs:"Currentmenu",controller:n,link:function(e,n,t){n&&jQuery(n).show()}}}function n(e,n,t,r){function u(e){var n=_.chain(a.menuItems).traverse("childs").find({selected:!0}).value();return null!=n&&e&&(null==n.childs||0==n.childs.length)&&angular.isObject(n.parent)&&(n=n.parent.childs),null==n&&(n=a.menuItems),angular.isArray(n)||(n=[n]),n}function l(){var e=_.chain(a.menuItems).traverse("childs").find({selected:!0}).value();if(angular.isObject(e)){for(var n=[],t=e;angular.isObject(t.parent);)n.unshift(t=t.parent);return n}return null}function i(){n.navigation.getNavigation(window.encodeURIComponent(e.spWebUrl)).then(function(n){function t(n){return n.selected=n.url==e.requestPath||null!=n.url&&n.url.endsWith(e.requestPath),_.each(n.childs,function(e){e.parent=n}),n.url==e.requestPath||null!=n.url&&n.url.endsWith(e.requestPath)||_.find(n.childs,t)?(n.open=!0,n):null}a.menuItems=n,a.menuItems&&_.forEach(a.menuItems,t)})}var a=this;a.menuItems=[],a.webUrl=e.spHostUrl,a.getTreeFromCurrentNode=u,a.getParentsForCurrentNode=l,i()}angular.module("Wizdom365.Currentmenu").directive("wizdom365Currentmenu",e),e.$inject=["configuration"],n.$inject=["contextInfo","currentMenuApi","$timeout","configuration"]}();
!function(){function e(e){var t={navigation:{baseUrl:"api/wizdom/currentMenu/currentNavigation",getNavigation:function(t,n){return void 0===n&&(n=!1),e.getAppCached(this.baseUrl+"?CurrentSite="+t+(n?"&IncludeHostLink=true":""))}},configuration:{baseUrl:"api/wizdom/currentMenu/configuration",deleteWebsite:function(t){return e.post(this.baseUrl+"/websites/delete",t)},addWebsite:function(t){return e.post(this.baseUrl+"/Websites",t)},getAllTermsets:function(){return e.get(this.baseUrl+"/AllTermSets")},getAllTemplates:function(){return e.get(this.baseUrl+"/allTemplates")},webExists:function(t){return e.get(this.baseUrl+"/webExists?webUrl="+encodeURIComponent(t))}}};return t}angular.module("Wizdom365.Currentmenu").factory("currentMenuApi",e),e.$inject=["webapiService"]}();
angular.module("Wizdom365").requires.push("Wizdom365.Currentmenu");
angular.module("Wizdom365").run(["$templateCache", function($templateCache) {if($templateCache.get('Currentmenu/Templates/ViewTemplates/SharepointMultilevel.html') == null) $templateCache.put('Currentmenu/Templates/ViewTemplates/SharepointMultilevel.html','<div id=\"ctl00_PlaceHolderLeftNavBar_QuickLaunchNavigationManager\">\r\n    <div id=\"zz11_V4QuickLaunchMenu\" class=\" noindex ms-core-listMenu-verticalBox\">\r\n        <ul id=\"zz12_RootAspMenu\" class=\"currentmenu root ms-core-listMenu-root static\">\r\n            <li class=\"static\" ng-repeat=\"menuItem in Currentmenu.menuItems\" wizdom-include=\"\'Currentmenu/Templates/SharepointMultilevelMenuItem.html\'\"></li>\r\n        </ul>\r\n    </div>\r\n</div>\r\n\r\n\r\n');
if($templateCache.get('Currentmenu/Templates/ViewTemplates/WizdomTwoLevel.html') == null) $templateCache.put('Currentmenu/Templates/ViewTemplates/WizdomTwoLevel.html','<div id=\"ctl00_PlaceHolderLeftNavBar_QuickLaunchNavigationManager\">\r\n    <div id=\"zz11_V4QuickLaunchMenu\" class=\" noindex ms-core-listMenu-verticalBox\">\r\n        <ul id=\"zz12_RootAspMenu\" class=\"currentmenu root ms-core-listMenu-root static\">\r\n            <li class=\"static\" ng-repeat=\"menuItem in Currentmenu.getTreeFromCurrentNode(true)\">\r\n                <a class=\"static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode\" ng-class=\'{\"ms-core-listMenu-selected\":menuItem.selected}\' ng-href=\"{{Currentmenu.weburl + menuItem.url}}\">\r\n                    <span class=\"additional-background ms-navedit-flyoutArrow\">\r\n                        <span class=\"menu-item-text\">{{menuItem.name}}</span>\r\n                    </span>\r\n                </a>\r\n                <ul class=\"static\" ng-if=\"menuItem.childs.length>0 && menuItem.open\">\r\n                    <li class=\"static\" ng-repeat=\"menuItem in menuItem.childs\">\r\n                        <a class=\"static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode\" ng-class=\'{\"ms-core-listMenu-selected\":menuItem.selected}\' ng-href=\"{{Currentmenu.weburl + menuItem.url}}\">\r\n                            <span class=\"additional-background ms-navedit-flyoutArrow\">\r\n                                <span class=\"menu-item-text\">{{menuItem.name}}</span>\r\n                            </span>\r\n                        </a>\r\n                    </li>\r\n                </ul>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n</div>');
if($templateCache.get('Currentmenu/Templates/ViewTemplates/WizdomTwoLevelWithParents.html') == null) $templateCache.put('Currentmenu/Templates/ViewTemplates/WizdomTwoLevelWithParents.html','<style>\r\n    .currentmenu li.parent .arrow\r\n    {\r\n        background: url(\"/_layouts/15/images/spcommon.png?rev=23\") no-repeat -197px -140px;\r\n        height:12px;\r\n        width:12px;\r\n        display:inline-block;\r\n        margin-left:-16px;\r\n        float: left;margin-top: 5px;\r\n    }\r\n</style>\r\n<div id=\"ctl00_PlaceHolderLeftNavBar_QuickLaunchNavigationManager\">\r\n    <div id=\"zz11_V4QuickLaunchMenu\" class=\" noindex ms-core-listMenu-verticalBox\">\r\n        <ul class=\"currentmenu root ms-core-listMenu-root static\">\r\n            <li class=\"static parent\" ng-repeat=\"parent in Currentmenu.getParentsForCurrentNode()\">\r\n                <span class=\"arrow\">&nbsp;</span><a class=\"static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode\" ng-href=\"{{Currentmenu.weburl + parent.url}}\">\r\n                    <span class=\"additional-background ms-navedit-flyoutArrow\">\r\n                        <span class=\"menu-item-text\">{{parent.name}}</span>\r\n                    </span>\r\n                </a>\r\n            </li>\r\n        </ul>\r\n\r\n        <ul id=\"zz12_RootAspMenu\" class=\"currentmenu root ms-core-listMenu-root static\">\r\n            <li class=\"static\" ng-repeat=\"menuItem in Currentmenu.getTreeFromCurrentNode(true)\">\r\n                <a class=\"static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode\" ng-class=\'{\"ms-core-listMenu-selected\":menuItem.selected}\' ng-href=\"{{Currentmenu.weburl + menuItem.url}}\">\r\n                    <span class=\"additional-background ms-navedit-flyoutArrow\">\r\n                        <span class=\"menu-item-text\">{{menuItem.name}}</span>\r\n                    </span>\r\n                </a>\r\n                <ul class=\"static\" ng-if=\"menuItem.childs.length>0 && menuItem.open\">\r\n                    <li class=\"static\" ng-repeat=\"menuItem in menuItem.childs\">\r\n                        <a class=\"static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode\" ng-class=\'{\"ms-core-listMenu-selected\":menuItem.selected}\' ng-href=\"{{Currentmenu.weburl + menuItem.url}}\">\r\n                            <span class=\"additional-background ms-navedit-flyoutArrow\">\r\n                                <span class=\"menu-item-text\">{{menuItem.name}}</span>\r\n                            </span>\r\n                        </a>\r\n                    </li>\r\n                </ul>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n</div>');}]);