!function(e){define("angular-ui-scroll",["angular","jquery"],(function(){return function(){
/*!
* angular-ui-scroll (uncompressed)
* https://github.com/angular-ui/ui-scroll
* Version: 1.6.1 -- 2017-03-06T07:25:29.944Z
* License: MIT
*/!function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={exports:{},id:i,loaded:!1};return e[i].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";var i=u(n(1)),a=u(n(2)),r=u(n(3)),o=u(n(4)),s=u(n(6));function u(e){return e&&e.__esModule?e:{default:e}}angular.module("ui.scroll",[]).service("jqLiteExtras",(function(){return new i.default})).run(["jqLiteExtras",function(e){return window.jQuery?null:e.registerFor(angular.element)}]).directive("uiScrollViewport",(function(){return{restrict:"A",controller:["$scope","$element",function(e,t){var n=this;return this.container=t,this.viewport=t,this.scope=e,angular.forEach(t.children(),(function(e){"tbody"===e.tagName.toLowerCase()&&(n.viewport=angular.element(e))})),this}]}})).directive("uiScroll",["$log","$injector","$rootScope","$timeout","$q","$parse",function(e,t,n,i,u,l){return{require:["?^uiScrollViewport"],restrict:"A",transclude:"element",priority:1e3,terminal:!0,link:function(e,c,d,f,m){var p=d.uiScroll.match(/^\s*(\w+)\s+in\s+([(\w|\$)\.]+)\s*$/);if(!p)throw new Error("Expected uiScroll in form of '_item_ in _datasource_' but got '"+d.uiScroll+"'");function _(t,n){var i=l(t)(e);return isNaN(i)?n:i}var h=null,g=p[1],v=p[2],x=f[0],w=Math.max(3,_(d.bufferSize,10)),b=Math.max(.3,_(d.padding,.5)),S=_(d.startIndex,1),y=0,k=[],A=new a.default(t,u),E=new r.default(A,w),L=new o.default(A,E,c,x,n,b),P=new s.default(L,E,z,I,d,l,c,e);x&&(x.adapter=P);var D=function(){return angular.isObject(h)&&angular.isFunction(h.get)};if(!(h=l(v)(e),D()||(h=t.get(v),D())))throw new Error(v+" is not a valid datasource");var C={};function T(e,t,n){var a=Object.getOwnPropertyDescriptor(e,t);a&&(a.set||a.get)||Object.defineProperty(e,t,{set:function(e){C[t]=e,i((function(){if(E[n]=e,!k.length){var i=L.topDataPos();L.adjustPadding(),"minIndex"===t&&L.adjustScrollTopAfterMinIndexSet(i)}}))},get:function(){return C[t]}})}T(h,"minIndex","minIndexUser"),T(h,"maxIndex","maxIndexUser");var j=2!==h.get.length?function(e){return h.get(E.next,w,e)}:function(e){h.get({index:E.next,append:E.length?E[E.length-1].item:void 0,count:w},e)},O=2!==h.get.length?function(e){return h.get(E.first-w,w,e)}:function(e){h.get({index:E.first-w,prepend:E.length?E[0].item:void 0,count:w},e)};function $(t){return t&&t!==y||e.$$destroyed}function V(){L.unbind("resize",R),L.unbind("scroll",R)}function I(){L.resetTopPadding(),L.resetBottomPadding(),arguments.length&&(S=arguments[0]),E.reset(S),z()}function U(e){return e.element.height()&&e.element[0].offsetParent}function M(e,t){F(e,t,L.insertElement),U(e)||(e.unregisterVisibilityWatcher=e.scope.$watch((function(){return function(e){U(e)&&(E.forEach((function(e){angular.isFunction(e.unregisterVisibilityWatcher)&&(e.unregisterVisibilityWatcher(),delete e.unregisterVisibilityWatcher)})),k.length||z())}(e)}))),e.element.addClass("ng-hide")}function F(e,t,n){var i=null,a=t>0?E[t-1].element:void 0;return m((function(t,r){i=n(t,a),e.element=t,e.scope=r,r[g]=e.item})),P.transform&&P.transform(e.scope,e.element),i}function N(){var e=[],t=[],n=[],i=[];return E.forEach((function(a,r){switch(a.op){case"prepend":t.unshift(a);break;case"append":M(a,r),a.op="none",i.push(a);break;case"insert":e=e.concat(F(a,r,L.insertElementAnimated)),a.op="none",i.push(a);break;case"remove":n.push(a)}})),n.forEach((function(t){return e=e.concat(E.remove(t))})),t.length&&t.forEach((function(e){M(e),e.op="none"})),E.forEach((function(e,t){return e.scope.$index=E.first+t})),{prepended:t,removed:n,inserted:i,animated:e}}function H(e,t){t.animated.length?u.all(t.animated).then((function(){L.adjustPadding(),z(e)})):L.adjustPadding()}function B(e,t){L.shouldLoadBottom()?(!t||E.effectiveHeight(t.inserted)>0)&&1===k.push(!0)&&(q(e),P.loading(!0)):L.shouldLoadTop()&&(!t||E.effectiveHeight(t.prepended)>0||k[0])&&1===k.push(!1)&&(q(e),P.loading(!0))}function z(e){e||(k=[],e=++y);var t=N();i((function(){t.inserted.forEach((function(e){return e.element.removeClass("ng-hide")})),t.prepended.forEach((function(e){return e.element.removeClass("ng-hide")})),$(e)||(H(e,t),B(e),k.length||P.calculateProperties())}))}function G(e){var t=N();i((function(){t.inserted.forEach((function(e){return e.element.removeClass("ng-hide")})),t.prepended.forEach((function(e){return e.element.removeClass("ng-hide")})),L.adjustScrollTopAfterPrepend(t),$(e)||(H(e,t),B(e,t),k.shift(),k.length?q(e):(P.loading(!1),L.bind("resize",R),L.bind("scroll",R),P.calculateProperties()))}))}function q(e){k[0]?E.length&&!L.shouldLoadBottom()?G(e):j((function(t){$(e)||(t.length<w&&(E.eof=!0),t.length>0&&(L.clipTop(),E.append(t)),G(e))})):E.length&&!L.shouldLoadTop()?G(e):O((function(t){$(e)||(t.length<w&&(E.bof=!0),t.length>0&&(E.length&&L.clipBottom(),E.prepend(t)),G(e))}))}function R(){n.$$phase||P.isLoading||P.disabled||(B(y),k.length?V():(P.calculateProperties(),e.$apply()))}function W(e){if(!P.disabled){var t=L[0].scrollTop,n=L[0].scrollHeight-L[0].clientHeight;(0===t&&!E.bof||t===n&&!E.eof)&&e.preventDefault()}}m((function(e,t){L.createPaddingElements(e[0]),t.$destroy(),e.remove()})),e.$on("$destroy",(function(){V(),L.unbind("mousewheel",W)})),L.bind("mousewheel",W),i((function(){L.applyContainerStyle(),I()}))}}}])},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){a=!0,r=e}finally{try{!i&&s.return&&s.return()}finally{if(a)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();
/*!
globals: angular, window
List of used element methods available in JQuery but not in JQuery Lite
element.before(elem)
element.height()
element.outerHeight(true)
element.height(value) = only for Top/Bottom padding elements
element.scrollTop()
element.scrollTop(value)
*/
var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,[{key:"registerFor",value:function(e){var t,i=void 0,a=void 0,r=void 0;function o(e,i,a){var r=e[0],o=n({top:["scrollTop","pageYOffset","scrollLeft"],left:["scrollLeft","pageXOffset","scrollTop"]}[i],3),s=o[0],u=o[1],l=o[2];return t(r)?angular.isDefined(a)?r.scrollTo(e[l].call(e),a):u in r?r[u]:r.document.documentElement[s]:(angular.isDefined(a)&&(r[s]=a),r[s])}function s(e,a,o){var s=void 0,u=function(e,a){var o,s,u,l,c,d,f,m,p,_=void 0;if(t(e))return{base:_=document.documentElement[{height:"clientHeight",width:"clientWidth"}[a]],padding:0,border:0,margin:0};var h=n({width:[e.offsetWidth,"Left","Right"],height:[e.offsetHeight,"Top","Bottom"]}[a],3);return _=h[0],d=h[1],f=h[2],c=r(e),m=i(e,c["padding"+d])||0,p=i(e,c["padding"+f])||0,o=i(e,c["border"+d+"Width"])||0,s=i(e,c["border"+f+"Width"])||0,u=c["margin"+d],l=c["margin"+f],{base:_,padding:m+p,border:o+s,margin:(i(e,u)||0)+(i(e,l)||0)}}(e,a);return u.base>0?{base:u.base-u.padding-u.border,outer:u.base,outerfull:u.base+u.margin}[o]:(((s=r(e)[a])<0||null===s)&&(s=e.style[a]||0),{base:(s=parseFloat(s)||0)-u.padding-u.border,outer:s,outerfull:s+u.padding+u.border+u.margin}[o])}return a=angular.element.prototype.css,e.prototype.css=function(e,t){var n=this[0];if(n&&3!==n.nodeType&&8!==n.nodeType&&n.style)return a.call(this,e,t)},t=function(e){return e&&e.document&&e.location&&e.alert&&e.setInterval},window.getComputedStyle?(r=function(e){return window.getComputedStyle(e,null)},i=function(e,t){return parseFloat(t)}):(r=function(e){return e.currentStyle},i=function(e,t){var n,i,a,r=void 0,o=void 0;return new RegExp("^("+/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source+")(?!px)[a-z%]+$","i").test(t)?(n=(o=e.style).left,a=(r=e.runtimeStyle)&&r.left,r&&(r.left=o.left),o.left=t,i=o.pixelLeft,o.left=n,a&&(r.left=a),i):parseFloat(t)}),angular.forEach({before:function(e){var t,n,i,a,r,o;if(n=this[0],(t=(r=this.parent()).contents())[0]===n)return r.prepend(e);for(i=a=1,o=t.length-1;1<=o?a<=o:a>=o;i=1<=o?++a:--a)if(t[i]===n)return void angular.element(t[i-1]).after(e);throw new Error("invalid DOM structure "+n.outerHTML)},height:function(e){return angular.isDefined(e)?(angular.isNumber(e)&&(e+="px"),a.call(this,"height",e)):s(this[0],"height","base")},outerHeight:function(e){return s(this[0],"height",e?"outerfull":"outer")},outerWidth:function(e){return s(this[0],"width",e?"outerfull":"outer")},offset:function(e){var t,n,i={top:0,left:0},a=this[0],r=a&&a.ownerDocument;if(arguments.length){if(void 0===e)return this;throw new Error("offset setter method is not implemented")}if(r)return t=r.documentElement,null!=a.getBoundingClientRect&&(i=a.getBoundingClientRect()),n=r.defaultView||r.parentWindow,{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}},scrollTop:function(e){return o(this,"top",e)},scrollLeft:function(e){return o(this,"left",e)}},(function(t,n){if(!e.prototype[n])return e.prototype[n]=t}))}}]),e}();t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$animate=t.has&&t.has("$animate")?t.get("$animate"):null,this.isAngularVersionLessThen1_3=1===angular.version.major&&angular.version.minor<3,this.$q=n}return i(e,[{key:"insertElement",value:function(e,t){return t.after(e),[]}},{key:"removeElement",value:function(e){return e.element.remove(),e.scope.$destroy(),[]}},{key:"insertElementAnimated",value:function(e,t){var i,a=this;if(!this.$animate)return this.insertElement(e,t);if(this.isAngularVersionLessThen1_3){var r=(i=a.$q.defer(),a.$animate.enter(e,null,t,(function(){return i.resolve()})),{v:[i.promise]});if("object"===(void 0===r?"undefined":n(r)))return r.v}return[this.$animate.enter(e,null,t)]}},{key:"removeElementAnimated",value:function(e){var t,i=this;if(!this.$animate)return this.removeElement(e);if(this.isAngularVersionLessThen1_3){var a=(t=i.$q.defer(),i.$animate.leave(e.element,(function(){return e.scope.$destroy(),t.resolve()})),{v:[t.promise]});if("object"===(void 0===a?"undefined":n(a)))return a.v}return[this.$animate.leave(e.element).then((function(){return e.scope.$destroy()}))]}}]),e}();t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=Object.create(Array.prototype);return angular.extend(n,{size:t,reset:function(e){n.remove(0,n.length),n.eof=!1,n.bof=!1,n.first=e,n.next=e,n.minIndex=e,n.maxIndex=e,n.minIndexUser=null,n.maxIndexUser=null},append:function(e){e.forEach((function(e){++n.next,n.insert("append",e)})),n.maxIndex=n.eof?n.next-1:Math.max(n.next-1,n.maxIndex)},prepend:function(e){e.reverse().forEach((function(e){--n.first,n.insert("prepend",e)})),n.minIndex=n.bof?n.minIndex=n.first:Math.min(n.first,n.minIndex)},insert:function(e,t){var i={item:t};if(e%1==0)i.op="insert",n.splice(e,0,i);else switch(i.op=e,e){case"append":n.push(i);break;case"prepend":n.unshift(i)}},remove:function(t,i){if(angular.isNumber(t)){for(var a=t;a<i;a++)e.removeElement(n[a]);return n.splice(t,i-t)}return n.splice(n.indexOf(t),1),e.removeElementAnimated(t)},effectiveHeight:function(e){if(!e.length)return 0;var t=Number.MAX_VALUE,n=Number.MIN_VALUE;return e.forEach((function(e){e.element[0].offsetParent&&(t=Math.min(t,e.element.offset().top),n=Math.max(n,e.element.offset().top+e.element.outerHeight(!0)))})),Math.max(0,n-t)}}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i,a,o){var s=null,u=null,l=i&&i.viewport?i.viewport:angular.element(window),c=i&&i.container?i.container:void 0,d=i&&i.scope?i.scope:a;function f(){return l.outerHeight()*o}return l.css({"overflow-anchor":"none","overflow-y":"auto",display:"block"}),angular.extend(l,{getScope:function(){return d},createPaddingElements:function(e){s=new r.default(e),u=new r.default(e),n.before(s),n.after(u)},applyContainerStyle:function(){c&&c!==l&&l.css("height",window.getComputedStyle(c[0]).height)},bottomDataPos:function(){var e=l[0].scrollHeight;return(e=null!=e?e:l[0].document.documentElement.scrollHeight)-u.height()},topDataPos:function(){return s.height()},bottomVisiblePos:function(){return l.scrollTop()+l.outerHeight()},topVisiblePos:function(){return l.scrollTop()},insertElement:function(t,n){return e.insertElement(t,n||s)},insertElementAnimated:function(t,n){return e.insertElementAnimated(t,n||s)},shouldLoadBottom:function(){return!t.eof&&l.bottomDataPos()<l.bottomVisiblePos()+f()},clipBottom:function(){for(var e=0,n=0,i=0,a=l.bottomDataPos()-l.bottomVisiblePos()-f(),r=t.length-1;r>=0&&!(n+(i=t[r].element.outerHeight(!0))>a);r--)u.cache.add(t[r]),n+=i,e++;e>0&&(t.eof=!1,t.remove(t.length-e,t.length),t.next-=e,l.adjustPadding())},shouldLoadTop:function(){return!t.bof&&l.topDataPos()>l.topVisiblePos()-f()},clipTop:function(){for(var e=0,n=0,i=0,a=l.topVisiblePos()-l.topDataPos()-f(),r=0;r<t.length&&!(n+(i=t[r].element.outerHeight(!0))>a);r++)s.cache.add(t[r]),n+=i,e++;e>0&&(s.height(s.height()+n),t.bof=!1,t.remove(0,e),t.first+=e)},adjustPadding:function(){if(t.length){var e=s.cache.reduce((function(e,n){return e+(n.index<t.first?n.height:0)}),0),n=u.cache.reduce((function(e,n){return e+(n.index>=t.next?n.height:0)}),0),i=(t.reduce((function(e,t){return e+t.element.outerHeight(!0)}),0)+e+n)/(t.maxIndex-t.minIndex+1),a=null!==t.minIndexUser&&t.minIndex>t.minIndexUser,r=null!==t.maxIndexUser&&t.maxIndex<t.maxIndexUser,o=a?(t.minIndex-t.minIndexUser)*i:0,l=r?(t.maxIndexUser-t.maxIndex)*i:0;s.height(e+o),u.height(n+l)}},adjustScrollTopAfterMinIndexSet:function(e){if(null!==t.minIndexUser&&t.minIndex>t.minIndexUser){var n=s.height()-e;l.scrollTop(l.scrollTop()+n)}},adjustScrollTopAfterPrepend:function(e){if(e.prepended.length){var n=t.effectiveHeight(e.prepended),i=s.height()-n;i>=0?s.height(i):(s.height(0),l.scrollTop(l.scrollTop()-i))}},resetTopPadding:function(){s.height(0),s.cache.clear()},resetBottomPadding:function(){u.height(0),u.cache.clear()}}),l};var i,a=n(5),r=(i=a)&&i.__esModule?i:{default:i}},function(e,t){"use strict";function n(){var e=Object.create(Array.prototype);return angular.extend(e,{add:function(t){for(var n=e.length-1;n>=0;n--)if(e[n].index===t.scope.$index)return void(e[n].height=t.element.outerHeight());e.push({index:t.scope.$index,height:t.element.outerHeight()})},clear:function(){e.length=0}}),e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=void 0;switch(e.tagName){case"dl":throw new Error("ui-scroll directive does not support <"+e.tagName+"> as a repeating tag: "+e.outerHTML);case"tr":t=angular.element("<table><tr><td><div></div></td></tr></table>").find("tr");break;case"li":t=angular.element("<li></li>");break;default:t=angular.element("<div></div>")}return t.cache=new n,t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var i=function(){function e(t,n,i,a,r,o,s,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.viewport=t,this.buffer=n,this.adjustBuffer=i,this.reload=a,this.isLoading=!1,this.disabled=!1;var l=t.getScope();this.startScope=l.$parent?l:u,this.publicContext={},this.assignAdapter(r.adapter,o,s),this.generatePublicContext(r,o)}return n(e,[{key:"assignAdapter",value:function(e,t,n){if(e&&(e=e.replace(/^\s+|\s+$/gm,""))){var i=function(e,t){var n=e.match(/^(.+)(\s+on\s+)(.+)?/);if(n&&4===n.length){window.console.log('Angular ui-scroll adapter assignment warning. "Controller On" syntax has been deprecated since ui-scroll v1.6.1.');for(var i=n[3],a=n[1],r=t;r.length;){var o=r.scope(),s=(r.attr("ng-controller")||"").match(/(\w(?:\w|\d)*)(?:\s+as\s+(\w(?:\w|\d)*))?/);if(s&&s[1]===i)return{target:o,source:a};r=r.parent()}throw new Error('Angular ui-scroll adapter assignment error. Failed to locate target controller "'+i+'" to inject "'+a+'"')}}(e,n),a=void 0;try{i?(t(i.source).assign(i.target,{}),a=t(i.source)(i.target)):(t(e).assign(this.startScope,{}),a=t(e)(this.startScope))}catch(t){throw t.message="Angular ui-scroll Adapter assignment exception.\nCan't parse \""+e+'" expression.\n'+t.message,t}angular.extend(a,this.publicContext),this.publicContext=a}}},{key:"generatePublicContext",value:function(e,t){for(var n=this,i=["reload","applyUpdates","append","prepend","isBOF","isEOF","isEmpty"],a=i.length-1;a>=0;a--)this.publicContext[i[a]]=this[i[a]].bind(this);for(var r=["isLoading","topVisible","topVisibleElement","topVisibleScope"],o=function(i){var a=void 0,o=e[r[i]];Object.defineProperty(n,r[i],{get:function(){return a},set:function(e){a=e,n.publicContext[r[i]]=e,o&&t(o).assign(n.startScope,e)}})},s=r.length-1;s>=0;s--)o(s);Object.defineProperty(this.publicContext,"disabled",{get:function(){return n.disabled},set:function(e){return(n.disabled=e)?null:n.adjustBuffer()}})}},{key:"loading",value:function(e){this.isLoading=e}},{key:"isBOF",value:function(){return this.buffer.bof}},{key:"isEOF",value:function(){return this.buffer.eof}},{key:"isEmpty",value:function(){return!this.buffer.length}},{key:"applyUpdates",value:function(e,t){var n=this;if(angular.isFunction(e))this.buffer.slice(0).forEach((function(t){n.applyUpdate(t,e(t.item,t.scope,t.element))}));else{if(e%1!=0)throw new Error("applyUpdates - "+e+" is not a valid index");var i=e-this.buffer.first;i>=0&&i<this.buffer.length&&this.applyUpdate(this.buffer[i],t)}this.adjustBuffer()}},{key:"append",value:function(e){this.buffer.append(e),this.adjustBuffer()}},{key:"prepend",value:function(e){this.buffer.prepend(e),this.adjustBuffer()}},{key:"calculateProperties",value:function(){for(var e=void 0,t=void 0,n=void 0,i=void 0,a=null,r=0,o=0;o<this.buffer.length;o++){if(i=a!==(n=(e=this.buffer[o]).element.offset().top),a=n,i&&(t=e.element.outerHeight(!0)),!(i&&this.viewport.topDataPos()+r+t<=this.viewport.topVisiblePos())){i&&(this.topVisible=e.item,this.topVisibleElement=e.element,this.topVisibleScope=e.scope);break}r+=t}}},{key:"applyUpdate",value:function(e,t){var n=this;if(angular.isArray(t)){var i=void 0,a=this.buffer.indexOf(e)+1;t.reverse().forEach((function(t){t===e.item?(i=!0,a--):n.buffer.insert(a,t)})),i||(e.op="remove")}}}]),e}();t.default=i}])}.apply(e,arguments)}))}(this),define("app/services/DomainsService",["angular","lodash","cjt/util/locale","cjt/services/APICatcher","cjt/io/batch-request","cjt/io/uapi-request","cjt/io/uapi"],(function(e,t,n,i,a,r){"use strict";var o=e.module("App"),s=new Date;return o.factory("DomainsService",["APICatcher","AUTOSSL_CAN_WILDCARD",function(i,o){var u,l,c,d,f,m=null,p=null,_=null,h=null,g=null,v={},x={unsecured:0,"self-signed":0,dv:1,autossl:1,ov:2,ev:3},w={"self-signed":n.maketext("Self-signed"),unsecured:n.maketext("Unsecured"),dv:n.maketext("Domain Validated"),ov:n.maketext("Organization Validated"),ev:n.maketext("Extended Validation"),autossl:n.maketext("[asis,AutoSSL] Domain Validated")};function b(e){e.is_self_signed=1===parseInt(e.is_self_signed,10),e.is_autossl="1"===e.is_autossl.toString(),e.validation_type=e.is_self_signed?"self-signed":e.validation_type,e.validation_type="dv"===e.validation_type&&e.is_autossl?"autossl":e.validation_type,e.type_name=y(e),e.view_crt_url="",e.view_crt_url+="../../ssl/install.html",e.id&&(e.view_crt_url+="?id="+encodeURIComponent(e.id)),e.will_autossl=function(e){if(!o&&-1!==e.domains.join().indexOf("*"))return!1;if(k()){if(e.is_autossl)return!0;if(x[e.validation_type]<x.dv)return!0;if(E())return!0}return!1}(e),e.expiration_date=new Date(1e3*e.not_after),e.is_expired=e.expiration_date<s;var t=(e.expiration_date-s)/1e3/60/60/24;return e.expiring_soon=t<30&&t>0,e}function S(e){return w[e]?w[e]:n.maketext("Unknown Certificate Type")}function y(e){return e?S(e.validation_type,e.is_autossl):""}function k(){return null!==m?m:(m="1"===PAGE.autossl_enabled.toString()&&""!==PAGE.autossl_provider,k())}function A(){return"1"===PAGE.ddnsEnabled.toString()&&""!==PAGE.ddnsEnabled}function E(){return null!==p?p:(p="1"===PAGE.autossl_override_enabled.toString(),E())}function L(e){return T()[e.virtual_host]}function P(e){var t="",i=L(e);return i?(t=e.certificate_covers_domain?i.is_expired?n.maketext("Expired on [datetime,_1].",i.not_after):n.maketext("Expires on [datetime,_1].",i.not_after):n.maketext("The installed certificate does not cover this domain."),e.certificate_will_autossl&&e.excluded_from_autossl?e.is_www?t+=" "+n.maketext("The certificate will renew via [asis,AutoSSL] when the parent domain “[_1]” renews, but this domain will be excluded.",e.www_parent):t+=" "+n.maketext("The certificate will renew via [asis,AutoSSL], but this domain will be excluded."):e.certificate_will_autossl?e.is_www?t+=" "+n.maketext("The certificate will renew via [asis,AutoSSL] when the parent domain “[_1]” renews.",e.www_parent):t+=" "+n.maketext("The certificate will renew via [asis,AutoSSL]."):!o&&e.is_wildcard?t+=" "+n.maketext("This server cannot provision [asis,AutoSSL] certificates that secure wildcard domains."):i.is_autossl||E()||(t+=" "+n.maketext("The certificate will not renew via [asis,AutoSSL] because it was not issued via [asis,AutoSSL]."))):(t=n.maketext("No certificate available."),k()&&(e.is_wildcard&&!o?t+=" "+n.maketext("The configured [asis,AutoSSL] provider does not support explicit wildcard domains.")+" "+n.maketext("You must purchase a certificate to secure this domain."):e.excluded_from_autossl?t+=" "+n.maketext("[asis,AutoSSL] will attempt to secure this website, but the domain will be excluded."):e.is_www?t+=" "+n.maketext("[asis,AutoSSL] will attempt to secure the domain when the parent domain “[_1]” renews.",e.www_parent):t+=" "+n.maketext("[asis,AutoSSL] will attempt to secure the domain the next time it runs."))),t}function D(e){var t=e?e.validation_type:"unsecured",n=x[t]||0;if(v[n])return v[n];var i=j();return v[n]=i.filter((function(e){return x[e]>n})),D(e)}function C(){return c||(d={},c=[],PAGE.installed_hosts.forEach((function(e){e.certificate=b(e.certificate),c.push(e),d[e.servername]=e.certificate})),C())}function T(){return d||(C(),T())}function j(){if(g)return g;g=[];var t={},n=O();return e.forEach(n,(function(e){t[e.x_validation_type]=1})),e.forEach(t,(function(e,t){g.push(t)})),j()}function O(){return _||(_=[],PAGE.products&&e.forEach(PAGE.products,(function(e){var t;(t=e).id=t.product_id,t.provider=t.provider_name,t.provider_display_name=t.provider_display_name||t.provider,t.price=Number(t.x_price_per_domain),t.wildcard_price=Number(t.x_price_per_wildcard_domain),t.wildcard_parent_domain_included=t.x_wildcard_parent_domain_free&&"1"===t.x_wildcard_parent_domain_free.toString(),t.icon_mime_type=t.icon_mime_type?t.icon_mime_type:"image/png",t.is_wildcard=!isNaN(t.wildcard_price),t.x_certificate_term=t.x_certificate_term||[1,"year"],t.x_certificate_term_key=t.x_certificate_term.join("_"),t.validity_period=t.x_certificate_term,_.push(t)})),O())}function $(){return l||(l={},e.forEach(PAGE.domain_types,(function(t,n){"main_domain"===n&&(t=[t]),e.forEach(t,(function(e){l[e]=n}))})),$())}function V(e){var t=$(),i=e.replace(/^www./gi,"");return t[i]?t[i]:n.maketext("Unknown")}function I(t){var i={domain:t.domain,vhost_name:t.vhost_name,virtual_host:t.vhost_name,isDDNS:!!t.isDDNS,certificate_type:"unsecured",certificate_type_name:n.maketext("Unsecured"),certificateStatusMessage:"",certificate_is_self_signed:!1,certificate_is_autossl:!1,certificate_will_autossl:!1,certificate_status:"unsecured",can_autossl_include:!1,can_autossl_exclude:!1,validation_rank:0,excluded_from_autossl:!1,domain_autossl_status:"included",expiring_soon:!1,is_autosubdomain:!1,is_expired:!1,is_proxy:!1,is_www:!1,showCertActions:!0,type:V(t.domain)};i.isDDNS&&(i.showCertActions=!1,i.type="ddns_domain"),U()[i.domain]&&(i.excluded_from_autossl=!0,i.domain_autossl_status="excluded");var a=L(i);return i.is_wildcard=0===t.domain.indexOf("*."),i.is_proxy="1"===t.is_proxy.toString(),i.is_www=i.domain.match(/^www\./),i.is_mail=i.domain.match(/^mail\./),i.www_parent=i.domain.replace(/^www\./,""),i.is_www||i.is_mail?i.type="www_mail_domains":i.is_proxy&&(i.type="proxy_sub_domains"),a?(i.certificate=a,i.certificate_type=a.validation_type,i.certificate_is_autossl=a.is_autossl,i.certificate_will_autossl=a.will_autossl,i.certificate_type_name=S(i.certificate_type,a.is_autossl),i.certificate_is_self_signed=a.is_self_signed,i.expiring_soon=a.expiring_soon,i.is_expired=a.is_expired,i.view_crt_url=a.view_crt_url,i.validation_rank=x[a.validation_type],i.certificate_covers_domain=0,e.forEach(a.domains,(function(e){i.domain===e&&(i.certificate_covers_domain=1),i.domain.replace(/^[^.]+\./,"*.")===e&&(i.certificate_covers_domain=1)})),i.certificate_covers_domain||(i.certificate_type="unsecured",i.certificate_type_name=S(i.certificate_type,a.is_autossl)),i.is_active=!i.is_expired&&!i.expiring_soon):i.certificate_will_autossl=k()&&!i.is_wildcard,i.can_autossl_exclude=k()&&i.certificate_will_autossl&&!i.is_wildcard,i.is_autosubdomain=/^www./.test(t.domain),i.is_active?i.certificate_status="active":i.is_expired?(i.certificate_status="expired",i.certificate_type="unsecured",i.certificate_type_name=S(i.certificate_type,a.is_autossl)):i.expiring_soon&&(i.certificate_status="expiring_soon"),i.available_upgrades=D(a),i.certificateStatusMessage=P(i),i.upgrade_btn_label=function(e){var t="",i=D();return!e||e.is_self_signed?t=n.maketext("Purchase Certificate"):e.will_autossl&&i.length?t=n.maketext("Upgrade Certificate"):e.is_expired||e.expiring_soon?t=n.maketext("Renew Certificate"):i.length&&(t=n.maketext("Upgrade Certificate")),t}(a),i.view_certificate_title=n.maketext("View certificate for the website “[_1]”.",i.virtual_host,i.domain),i.exclude_autossl_btn_title=n.maketext("Exclude “[_1]” from [asis,AutoSSL].",i.domain),i.include_autossl_btn_title=n.maketext("Include “[_1]” during [asis,AutoSSL].",i.domain),i}function U(){return h||(h={},e.forEach(PAGE.autossl_excluded_domains,(function(e){this[e.excluded_domain]=e.excluded_domain}),h),U())}return{get_domains:function t(){if(u)return u;var n={};return u=[],PAGE.domains.forEach((function(e){var t=I(e);n[t.domain]=t})),e.forEach(n,(function(e){u.push(e)})),t()},get_products:O,get_upgrade_btn_title:function(e,t){var i=j(),a="";return!t||t.is_self_signed?a=n.maketext("Purchase certificate for “[_1]”.",e):t.will_autossl&&i.length?a=n.maketext("Upgrade certificate for “[_1]”.",e):t.is_expired||t.expiring_soon?a=n.maketext("Renew certificate for “[_1]”.",e):i.length&&(a=n.maketext("Upgrade certificate for “[_1]”.",e)),a},autossl_include_domains:function(e){var t=(new r.Class).initialize("SSL","remove_autossl_excluded_domains",{domains:e.join(",")});return i.promise(t)},autossl_exclude_domains:function(e){var t=(new r.Class).initialize("SSL","add_autossl_excluded_domains",{domains:e.join(",")});return i.promise(t)},get_ssl_domains:T,get_installed_hosts:C,get_domain_search_options:function e(){return f||(f={domainType:{label:n.maketext("Domain Types:"),item_key:"type",options:[{value:"main_domain",label:n.maketext("Main"),description:n.maketext("Only list Main domains.")},{value:"sub_domains",label:n.maketext("Subdomain"),description:n.maketext("Only list Subdomains.")},{value:"addon_domains",label:n.maketext("Addon Domains"),description:n.maketext("Only list Addon domains.")},{value:"parked_domains",label:n.maketext("Parked Domains"),description:n.maketext("Only list Parked domains.")},{value:"www_mail_domains",label:n.maketext("[asis,www] and [asis,mail] Domains"),description:n.maketext("Only list [asis,www] and [asis,mail] domains.")},{value:"proxy_sub_domains",label:n.maketext("Service Subdomains"),description:n.maketext("Only list Service Subdomains.")}]},sslType:{label:n.maketext("[asis,SSL] Types:"),item_key:"certificate_type",options:[{value:"unsecured",label:n.maketext("Unsecured"),description:n.maketext("Only list unsecured domains.")},{value:"self-signed",label:n.maketext("Self-signed"),description:n.maketext("Only list self-signed domains.")},{value:"autossl",label:n.maketext("[asis,AutoSSL DV] Certificate"),description:n.maketext("Only list domains with [asis,AutoSSL DV] Certificates.")},{value:"dv",label:n.maketext("DV Certificate"),description:n.maketext("Only list domains with [asis,DV] Certificates.")},{value:"ov",label:n.maketext("OV Certificate"),description:n.maketext("Only list domains with [asis,OV] Certificates.")},{value:"ev",label:n.maketext("EV Certificate"),description:n.maketext("Only list domains with [asis,EV] Certificates.")}]},sslStatus:{label:n.maketext("[asis,SSL] Statuses:"),item_key:"certificate_status",options:[{value:"active",label:n.maketext("Active"),description:n.maketext("Only list the domains with active certificates.")},{value:"expired",label:n.maketext("Expired"),description:n.maketext("Only list domains whose certificate is expiring soon.")},{value:"expiring_soon",label:n.maketext("Expiring Soon"),description:n.maketext("Only list domains whose certificate is expiring soon.")},{value:"unsecured",label:n.maketext("Unsecured"),description:n.maketext("Only list unsecured domains.")},{value:"has_autossl_problem",label:n.maketext("Has [asis,AutoSSL] Problems"),description:n.maketext("Only list the domains with [asis,AutoSSL] problems.")}]}},A()&&f.domainType.options.push({value:"ddns_domain",label:n.maketext("[asis,DDNS] Domains"),description:n.maketext("Only list Dynamic [asis,DNS] ([asis,DDNS]) Domains.")}),k()&&(f.autoSSLStatus={label:n.maketext("[asis,AutoSSL] Statuses:"),item_key:"domain_autossl_status",options:[{value:"included",label:n.maketext("Included"),description:n.maketext("Only list domains that are not explicitly excluded during [asis,AutoSSL].")},{value:"excluded",label:n.maketext("Excluded"),description:n.maketext("Only list domains that will be explicitly excluded from [asis,AutoSSL].")}]}),e())},is_autossl_enabled:k,make_ssl_type_name:y,get_validation_type_name:S,get_validation_ranks:function(){return x},get_certificate_status:P,getAutoSSLStatuses:function(){if(!k())return!1;var e=(new r.Class).initialize("SSL","get_autossl_problems");PAGE.hasWebServerRole||e.addFilter("domain","matches","^(?!www\\.)");var t=[e],o=[],s=PAGE.ddns_domains.map((function(e){return o.push(e.domain),(new r.Class).initialize("SSL","fetch_best_for_domain",{domain:e.domain})}));PAGE.ddns_domains=[],t=t.concat(s);var l=new a.Class(t);return i.promise(l).then((function(e){var t={},i=e.data[0].data,a=e.data.slice(1);return i.forEach((function(e){var i=e.domain;t[i]={domain:i,status:n.maketext("An error occurred during the last [asis,AutoSSL] run for this domain."),runTime:new Date(e.time),error:e.problem}})),a.forEach((function(e,t){var n={domain:o[t],vhost_name:"_ddns_"+o[t],is_proxy:"0",isDDNS:!0};if(e.data.crt){var i=CPANEL.ssl.parseCertificateText(e.data.crt),a=b({is_self_signed:i.isSelfSigned?"1":"0",is_autossl:"1",domains:i.domains,validation_type:"autossl",id:null,not_after:i.notAfter.getTime()/1e3});d[n.vhost_name]=a}n=I(n),u.push(n)})),Object.keys(t).map((function(e){return t[e]}))}))},startUserAutoSSL:function(){var e=new r.Class;return e.initialize("SSL","start_autossl_check"),i.promise(e)},isAutoSSLCheckInProgress:function(){if(!k())return!1;var e=new r.Class;return e.initialize("SSL","is_autossl_check_in_progress"),i.promise(e).then((function(e){return"1"===e.data.toString()}))},areMarketProductsAvailable:function(){return PAGE.has_tls_wizard_feature&&O().length||!1},isDDNSEnabled:t.memoize(A)}}])})),define("app/views/ViewDomainsController",["angular","cjt/core","cjt/util/locale","cjt/util/query","cjt/services/fuzzy","uiBootstrap","cjt/modules","cjt/directives/cpanel/searchSettingsPanel","cjt/models/searchSettingsModel","app/services/DomainsService","cjt/directives/actionButtonDirective"],(function(e,t,n,i,a){"use strict";var r=e.module("App");r.value("PAGE",PAGE);var o=new a;r.controller("ViewDomainsController",["$scope","$timeout","$filter","$window","$location","DomainsService","$routeParams","SearchSettingsModel","user_domains","search_filter_settings","alertService","PAGE",function(a,r,s,u,l,c,d,f,m,p,_,h){a.domains=m,a.filteredDomains=a.domains,a.selected_auto_ssl_domains={excluded:[],included:[]},a.unsecuredDomains=[],a.quickFilterValue="",a.showPager=!0,a.autossl_enabled=c.is_autossl_enabled,a.autoSSLErrorsExist=!1,a.meta={filterValue:""};var g=null;function v(){r((function(){c.isAutoSSLCheckInProgress().then((function(e){e?v():(a.autoSSLCheckActive=!1,_.add({type:"success",message:n.maketext("The [asis,AutoSSL] check has completed. The page will refresh in [quant,_1,second,seconds].",5),closeable:!0,replace:!1,autoClose:5e3,group:"tlsStatus"}),r((function(){u.location.reload()}),5e3))}))}),6e4)}a.datasource={get:function(e,t){t(a.filteredDomains.slice(Math.max(e.index,0),e.index+e.count)),(g=e).position=u.pageYOffset}},a.check_for_reload=function(){if(g){var e=-1,t=g.index+g.count;if(0===u.pageYOffset)e=0;else{var n=u.pageYOffset;e=t*(g.position/n)}t-e>200&&(e=Math.max(e,0),a.uiScrollAdapter.reload(e))}},a.autossl_include_domains=function(e){var t=e.map((function(e){return e.updating=!0,e.domain}));return c.autossl_include_domains(t).then((function(){_.add({type:"success",message:n.maketext("The following domains have had their [asis,AutoSSL] exclusion removed: [list_and_quoted,_1]",t),closeable:!0,replace:!1,autoClose:1e4,group:"tlsStatus"}),e.forEach((function(e){e.excluded_from_autossl=!1,e.domain_autossl_status="included",e.certificate_status_name=c.get_certificate_status(e)}))})).finally((function(){e.forEach((function(e){e.updating=!1})),a.update_auto_ssl_domains()}))},a.autossl_exclude_domains=function(e){var t=e.map((function(e){return e.updating=!0,e.domain}));return c.autossl_exclude_domains(t).then((function(){_.add({type:"success",message:n.maketext("The following domains will now be excluded from the [asis,AutoSSL] process: [list_and_quoted,_1]",t),closeable:!0,replace:!1,autoClose:1e4,group:"tlsStatus"}),e.forEach((function(e){e.excluded_from_autossl=!0,e.domain_autossl_status="excluded",e.certificate_status_name=c.get_certificate_status(e)}))})).finally((function(){e.forEach((function(e){e.updating=!1})),a.update_auto_ssl_domains()}))},a.autossl_include_domain=function(e){return a.autossl_include_domains([e])},a.autossl_exclude_domain=function(e){return a.autossl_exclude_domains([e])},a.exclude_autossl_label=function(e){return 0===e.length?n.maketext("Exclude Domains from AutoSSL",e.length):n.maketext("Exclude [quant,_1,Domain,Domains] from AutoSSL",e.length)},a.include_autossl_label=function(e){return 0===e.length?n.maketext("Include Domains during AutoSSL",e.length):n.maketext("Include [quant,_1,Domain,Domains] during AutoSSL",e.length)},a.searchFilterOptions=new f(p),a.clearSearch=function(){a.meta.filterValue="",a.domainSearchFilterChanged()},a.filter_domains=function(e){var t=e;if(a.meta.filterValue){var n=[],i={},r=e.map((function(e){return i[e.domain]=e,e.domain}));o.loadSet(r),o.search(a.meta.filterValue).filter((function(e){return e.distance<3})).sort((function(e,t){return e.distance===t.distance?e.match===t.match?0:e.match<t.match?-1:1:e.distance<t.distance?-1:1})).forEach((function(e){n.push(i[e.match])})),t=n}return t=a.searchFilterOptions.filter(t)},a.update_auto_ssl_domains=function(){a.selected_auto_ssl_domains={excluded:[],included:[]},e.forEach(a.filteredDomains,(function(e){e.can_autossl_exclude&&e.selected&&(e.excluded_from_autossl?a.selected_auto_ssl_domains.excluded.push(e):a.selected_auto_ssl_domains.included.push(e))}),a.selected_auto_ssl_domains)},a.searchSettingsPanelUpdated=function(){a.fetch()},a.lastFetch="",a.fetch=function(){var t=a.domains,n=(t=a.filter_domains(t)).map((function(e){return e.domain})).join("|"),i=a.filteredDomains.length!==a.domains.length||t.length!==a.filteredDomains.length||a.lastFetch!==n;a.lastFetch=n,i&&(a.filteredDomains=t,a.uiScrollAdapter&&e.isFunction(a.uiScrollAdapter.reload)&&a.uiScrollAdapter.reload(0)),a.update_auto_ssl_domains(),a.update_showing_text()},a.no_results_msg=function(){return n.maketext("No results found…")},a.get_advanced_filter_label=function(e){if("displayAutoSubdomains"===e)return a.advancedFilters.displayAutoSubdomains?n.maketext("Yes"):n.maketext("No");var t=a[e+"Options"];if(t)for(var i=0;i<t.length;i++)if(t[i].value===a.advancedFilters[e])return t[i].label;return""},a.advanced_filters_set=function(){return"all"!==a.advancedFilters.domainType||"all"!==a.advancedFilters.sslType||"all"!==a.advancedFilters.sslStatus||!a.advancedFilters.displayAutoSubdomains},a.update_showing_text=function(){a.showing_text=n.maketext("[output,strong,Showing] [numf,_1] of [quant,_2,domain,domains]",a.filteredDomains.length,a.domains.length)},a.get_showing_text=function(){return a.showing_text},a.view_certificate=function(e){return u.open(e.view_crt_url)},a._get_tls_wizard_url=function(e){var n="security/tls_wizard/#/create";return-1===n.search(/^http/i)&&(n=-1!==n.search(/^\//)?t.getRootPath()+n:t.buildFullPath(n)),n+="?"+i.make_query_string(e)},a.get_root_domain=function(e){var t;return e.domain.match(/^www\./)&&(t=a.find_domain_by_domain(e.domain.replace(/^www\./,""))),t||e},a.upgrade_certificate_url=function(e){if(e){var t={domain:a.get_root_domain(e).domain,certificate_type:e.available_upgrades};return a._get_tls_wizard_url(t)}},a.purchase_certificate=function(e){var t={domain:e.map((function(e){return a.get_root_domain(e).domain})),certificate_type:["dv","ov","ev"]};return window.open(a._get_tls_wizard_url(t),"_self"),!1},a.domainSearchFilterChanged=function(){a.meta.filterValue?l.search("domain",a.meta.filterValue):l.search("domain",null),a.fetch()},a.get_unsecured_domains_message=function(e){return n.maketext("You have [numf,_1] unsecured parent [numerate,_1,domain,domains]. Would you like to purchase [numerate,_1,a certificate for that domain, certificates for those domains]?",e.length)},a.getUnsecuredDomainsMessageNote=function(){return h.hasWebServerRole&&n.maketext("[output,strong,Note:] The number of “parent” domains excludes the “[_1]” domains because the system automatically includes them during purchase if they pass [output,acronym,DCV,Domain Control Validation].","www")},a.find_domain_by_domain=function(e){for(var t=0;t<a.domains.length;t++)if(a.domains[t].domain===e)return a.domains[t]},a.get_domain_lock_tooltip=function(e,t,i){var a=c.get_validation_ranks();return a[i]>a[e]?c.get_validation_type_name(e,!1):a[i]===a[e]?c.get_validation_type_name(e,t):c.tls_wizard_can_do_validation_type(e)?n.maketext("Upgrade to [_1]",c.get_validation_type_name(e,!1)):""},a.show_unsecured_domains=function(){a.searchFilterOptions.show_only("sslType","unsecured"),a.fetch()},a.get_upgrade_btn_title=function(e){if(e.upgrade_btn_title)return e.upgrade_btn_title;var t=a.get_root_domain(e);return e.upgrade_btn_title=c.get_upgrade_btn_title(t.domain,e.certificate),e.upgrade_btn_title},a.selectAllItems=function(t){e.forEach(a.filteredDomains,(function(e){e.selected=t})),a.update_auto_ssl_domains()},a.getRawLogWarning=function(){return n.maketext("Because some entries contain raw log data, the system may not translate it into the chosen language or locale.")},a.startUserAutoSSLLabel=function(){return a.autoSSLCheckActive?n.maketext("[asis,AutoSSL] is in progress …"):n.maketext("Run [asis,AutoSSL]")},a.startUserAutoSSL=function(){a.autoSSLCheckActive=!0,c.startUserAutoSSL().then(v)},a.init=function(){d.domain&&(a.meta.filterValue=d.domain),e.element(u).bind("scroll",a.check_for_reload);var t=[];a.domains.forEach((function(e){e.upgrade_btn_title=a.get_upgrade_btn_title(e),"unsecured"===e.certificate_type&&t.push(e)}));var i=[],o={};e.forEach(t,(function(e){if(!e.isDDNS){var t=a.get_root_domain(e);if("unsecured"!==t.certificate_type)return!1;t&&!o[t.domain]&&(o[t.domain]=t,i.push(t))}})),a.market_products_available=c.areMarketProductsAvailable(),a.unsecuredDomains=i,a.fetch(),c.is_autossl_enabled()&&r((function(){c.getAutoSSLStatuses().then((function(e){e.forEach((function(e){var t=a.find_domain_by_domain(e.domain);t&&(t.autoSSLStatus=e,e.error?(a.autoSSLErrorsExist=!0,t.certificate_status="has_autossl_problem",t.autoSSLStatus.lastRunMessage=n.maketext("An error occurred the last time [asis,AutoSSL] ran, on [local_datetime,_1]:",t.autoSSLStatus.runTime.getTime()/1e3)):t.autoSSLStatus.lastRunMessage=n.maketext("[asis,AutoSSL] last ran on [local_datetime,_1].",t.autoSSLStatus.runTime.getTime()/1e3))})),a.fetch()})),c.isAutoSSLCheckInProgress().then((function(e){a.initialAutoSSLCheckComplete=!0,a.autoSSLCheckActive=e,a.autoSSLCheckActive&&v()}))}),50)},a.$on("$destroy",(function(){e.element(u).unbind("scroll",a.check_for_reload)})),a.init()}])})),define("app/index",["angular","cjt/core","cjt/modules","uiBootstrap","ngRoute","ngAnimate","angular-ui-scroll"],(function(e,t){"use strict";return function(){return e.module("App",["ui.bootstrap","cjt2.cpanel","ui.scroll","ngAnimate"]),require(["cjt/bootstrap","cjt/services/alertService","cjt/directives/alertList","app/services/DomainsService","app/views/ViewDomainsController"],(function(n){var i=e.module("App"),a="1"===PAGE.autossl_can_wildcard.toString();i.value("PAGE",PAGE),i.value("AUTOSSL_CAN_WILDCARD",a),i.controller("BaseController",["$rootScope","$scope","$route","$location",function(e,t,n,i){t.loading=!1,e.$on("$routeChangeStart",(function(e,n,i){i&&n.loadedTemplateURL===i.loadedTemplateURL||(t.loading=!0)})),e.$on("$routeChangeSuccess",(function(){t.loading=!1})),e.$on("$routeChangeError",(function(){t.loading=!1})),t.current_route_matches=function(e){return i.path().match(e)},t.go=function(e){i.path(e)}}]),i.config(["$routeProvider",function(e){e.when("/",{controller:"ViewDomainsController",templateUrl:t.buildFullPath("security/tls_status/views/view_domains.html.tt"),resolve:{user_domains:["DomainsService",function(e){return e.get_domains()}],search_filter_settings:["DomainsService",function(e){return e.get_domain_search_options()}]}}),e.otherwise({redirectTo:"/"})}]),n("#content","App")}))}}));